Time of Update: 2018-12-08
1 設定listview 的Item之間的橫線 顏色和高度 android:divider="#8E8E8E" android:dividerHeight="1px"2 設定 ListView在選擇多項時,背景變黑android:scrollingCache="false" 3 設定 ListView 選擇Item的高亮android:listSelector="@android:color/transparent"4 設定Item 獲得焦點樣式,選中樣式,未選擇樣式 分三部分
Time of Update: 2018-12-08
import java.util.concurrent.Callable; import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.ExecutorService; import java.util.
Time of Update: 2018-12-08
前沿:在android開發過程中,往往會需要建立組件層面的第三方包,下面將對android對第三方包支援的方式種類,各試用範圍,優缺點進行總結。最後分析當前開發過程中,一些大的平台的組件實現方式。 1. 匯出jar檔案方式,實現第三方組件1.1. 實現過程: 選擇項目--> 點擊右鍵,菜單,選擇Exportà選擇java/JAR -->選擇類和資源檔(推薦只選擇類檔案)-->選擇匯出檔案路徑,匯出JAR檔案。 1.2.
Time of Update: 2018-12-08
Step One 應用系統設定檔----應用版本配置資訊<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="TP.NationalTest" android:versionCode="4" android:versionName="1.4"> <uses-sdk android:minSdkVersion="4"
Time of Update: 2018-12-08
~~~應用推廣必備發布渠道~~~安智市場 http://www.goapk.com/小秘笈:註冊後台發布應用,比較簡單快捷。安卓市場 http://sc.hiapk.com/小秘笈:註冊後台發布應用,比較簡單快捷。機鋒市場 http://apk.gfan.com/小秘笈:註冊後台發布應用,比較簡單快捷。搜狐下載頻道 http://download.sohu.com/developer小秘笈:註冊開發人員身份前首先要註冊搜狐通行證,上傳應用程式名稱改為英文,icon最好是5
Time of Update: 2018-12-08
前言:在前面介紹過基於對話方塊形式,實現登陸和註冊帳號,沒有細說Android終端和互連網的服務之間的互動實現,在下面我將說明在在選擇Android傳輸的方案選型分析過程,登陸和註冊介面定義和實現.1 android傳輸方案分析和選型在談到android 傳輸方案,一般大家想到的就是Socket傳輸,基於http的web服務,還有直接是http的post,get擷取方式。接下來是從 【網路實現條件】,【使用範圍】, 【傳輸優缺點】,
Time of Update: 2018-12-08
HttpHelper.javapackage com.newcj.net;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.io.UnsupportedEncodingException;import java.net.*;import org.apache.http.util.ByteArrayBuffer;import
Time of Update: 2018-12-08
需要作為資源讀取的XML檔案,通常放置於res/xml目錄,打包的時候將會被編譯成二進位檔案。要訪問這些xml需要用到XmlPullParser對象。Resources res = activity.getResources(); XmlResourceParser xpp = res.getXml(R.xml.test); 這裡的XmlResourceParser就是XmlPullParser的執行個體下面就是XmlPullParser訪問XML節點的代碼private String
Time of Update: 2018-12-08
在應用程式中經常用到啟動畫面,會啟動一個後台線程為主程式的運行準備資源。Android要實現啟動畫面可以這樣做:這是splash.xml布局檔案的代碼代碼Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-08
關於listview和button都要改變android原來控制項的背景,在網上尋找了一些資料不是很全,所以現在總結一下android的selector的用法。首先android的selector是在drawable/xxx.xml中配置的。先看一下listview中的狀態:把下面的XML檔案儲存成你自己命名的.xml檔案(比如list_item_bg.xml),在系統使用時根據ListView中的清單項目的狀態來使用相應的背景圖片。drawable/list_item_bg.xml<?x
Time of Update: 2018-12-08
文章目錄 術語和概念 http://developer.android.com/guide/practices/screens_support.htmlTerms and conceptsScreen sizeActual physical size, measured as the screen's diagonal.For simplicity, Android groups all actual screen sizes into
Time of Update: 2018-12-08
一、相關概念1、Drawable就是一個可畫的對象,其可能是一張位元影像(BitmapDrawable),也可能是一個圖形(ShapeDrawable),還有可能是一個圖層(LayerDrawable),我們根據畫圖的需求,建立相應的可畫對象2、Canvas畫布,繪圖的目的地區,用於繪圖3、Bitmap位元影像,用於圖的處理4、Matrix矩陣二、Bitmap1、從資源中擷取Bitmap1 Resources res = getResources();2 Bitmap bmp
Time of Update: 2018-12-08
ValueDescriptiontopPut the object at the top of its container, not changing its size.將對象放在其容器的頂部,不改變其大小.bottomPut the object at the bottom of its container, not changing its size.將對象放在其容器的底部,不改變其大小.leftPut the object at the left edge of its
Time of Update: 2018-12-08
只需把代碼copy進入oncreate方法即可運行 Java代碼 RelativeLayout rl = new RelativeLayout(this); Button btn1 = new Button(this); btn1.setText("----------------------"); btn1.setId(1); RelativeLayout.LayoutParams lp1 =
Time of Update: 2018-12-08
1.整體概括: 用"button的繪製"做為執行個體.public class MyButton extends Button {--->繼承Button. 一般我們都繼承View,沒有樣式 public MyButton(Context context) { super(context); } @Override protected void onDraw(Canvas canvas) {--->activity載入的時候會自動調用該方法 super.onDraw(canvas);
Time of Update: 2018-12-08
1.匯入工程有錯. 可能是你匯入的版本SDK與eclipse裡的版本不匹配. I.你可以改一下properties裡的版本號碼. 再右鍵android tools --->fix project properties試試. (最後最好重新整理一下). II. 這個方法靠譜. ①。建立一個自己的工程。並開啟工程檔案夾。 ②。開啟有錯工程檔案夾。 ③。將建立工程檔案夾裡的三個檔案(androidManifest.xml, src,res)複製到有錯工程檔案夾裡。
Time of Update: 2018-12-08
Android Selector
Time of Update: 2018-12-08
在進行UI布局的時候,可能經常會用到 android:gravity 和 android:layout_Gravity 這兩個屬性。關於這兩個屬性的區別,網上已經有很多人進行了說明,這邊再簡單說一下。 (資料來自網路)LinearLayout有兩個非常相似的屬性:android:gravity與android:layout_gravity。他們的區別在於:android:gravity 屬性是對該view中內容的限定.比如一個button 上面的text. 你可以設定該text
Time of Update: 2018-12-08
有些時候我們需要我們的程式在系統開機後能自動運行,這個時候我們可以使用Android中的廣播機制,編寫一個繼承BroadcastReceiver的類,接受系統啟動關閉廣播。代碼如下:[java] view
Time of Update: 2018-12-08
兩種方法都是實現畫一個慢慢變大的圓, 自訂的view要sleep一下才能看到效果 . surfaceView不用. 可能與其兩級緩衝有關._____________________________________最美分割線_________________________________________使用它主要就是 SurfaceHolder sh = this.getHolder();--->1.得到SurfaceHolder Canvas canvas =