Time of Update: 2018-12-05
json資料格式解析我自己分為兩種;一種是普通的,一種是帶有數組形式的;普通形式的:伺服器端返回的json資料格式如下:{"userbean":{"Uid":"100196","Showname":"\u75af\u72c2\u7684\u7334\u5b50","Avtar":null,"State":1}}分析代碼如下:// TODO 狀態處理 500 200 int res = 0; res =
Time of Update: 2018-12-05
之前北京一位Android開發人員發起翻譯Android API的倡議,集中國Android開發人員每一個人之力來不斷壯大,為一些英語水平一般無法全面理解原文Android API的開發人員提供一個橋樑。畢竟,語言不應當是開發人員的一個阻礙。類Typeface詳細規定了字型的字型和固有特性。當繪製(和量測)時,使用畫筆尤其是在任意使用像textSize, textSkewX,
Time of Update: 2018-12-05
android提供的ListView在很多情況下滿足不了我們的展現需求,這裡我以一個圖書列表為例,實現自訂的ListView先看下要實現的效果,左側顯示圖片,右邊顯示標題以及章節等資訊,實現步驟如下:1. 建立一個用於控制每行顯示效果的layout,名稱為bookshelf <?xml version="1.0" encoding="utf-8"?><TableLayout
Time of Update: 2018-12-05
在android4.0以下用這個方法: private void cutScreen(){View v = getLayoutInflater().inflate(R.layout.activity_main, null);//開啟映像緩衝v.setDrawingCacheEnabled(true);//v.buildDrawingCache();//測量view的大小v.measure(MeasureSpec.makeMeasureSpec(0,
Time of Update: 2018-12-05
android入門(1)安裝及hello world1. 下載安裝jdk+eclipse+adt+android_sdk, 參考http://developer.android.com/sdk/index.html2。編寫helloworld,參考http://developer.android.com/resources/tutorials/hello-world.html注意一點,如果編譯時間出錯,Android Emulator is not starting showing “
Time of Update: 2018-12-05
NDK 編譯和使用靜態庫、動態庫情況一:編譯靜態庫情況二:編譯動態庫情況三:編譯動態庫+靜態庫情況四:已有第三方靜態庫(動態庫),編譯靜態庫(動態庫) 預設所有代碼和檔案在$project/jni下,否則特殊說明。情況一:編譯靜態庫檔案Android.mk:LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := hello-jniLOCAL_SRC_FILES := hello-jni.cinclude $(B
Time of Update: 2018-12-05
android中的一個應用程式可以單獨編譯,編譯後要重建system.img在源碼目錄下執行 . build/envsetup.sh (.後面有空格)就多出一些命令: - croot: Changes directory to the top of the tree. - m: Makes from the top of the tree. - mm: Builds all of the modules in the current directory. -
Time of Update: 2018-12-05
1.圖片載入方法,方便使用者載入圖片Java代碼 /*** * 載入本地圖片 * * @param context * :主運行函數執行個體 * @param bitAdress * :圖片地址,一般指向R下的drawable目錄 * @return */ public final Bitmap CreatImage(Context context, int bitAdress) { Bitmap bitmaptemp
Time of Update: 2018-12-05
代號為冰淇淋三明治的Android 4.0版本本周早些時候已經正式發布,雖然最初的反響相當積極,但來自行業觀察媒體DigiTimes的報道,平板廠商依然對這套系統持有懷疑態度,他們認為Android 4.0的幾項改進不夠徹底,仍然沒有實力抗衡iPad。業界擔心高科技巨頭之間的競爭差距可能會進一步拉大,特別是預期在明年3月推出的iPad 3會讓已經完全失守的Android平板市場雪上加霜。平板廠商目前正將目光轉向Windows
Time of Update: 2018-12-05
1.Demo說明與示範Redirection這個Demo會涉及到三個Acitivity: RedirectEnter, RedirectMain,RedirectGetter。其Main Activity是RedirectEnter,它啟動RedirectMain,然後在RedirectMain中根據條件來決定是否再啟動RedirectGetter。主要知識點是SharedPreference的使用.Demo如下: 2.視頻講解http://www.eyeandroid.com/thread-1
Time of Update: 2018-12-05
Timer是一個執行任務的類,他接受TimerTask的參數;Timer執行任務有兩種方式,一種是在某個指定的時候執行某個任務timer.schedule(Timertask task,Data data),另一種是在多長時間之後執行某個任務timer.schedule(TimerTask task,long delay);TimerTask中執行指定的任務,但由於Android是安全執行緒的,所有的介面的更新都必須放到主線程中,所以要使用到Handler對象。主體代碼如下: 代碼Code
Time of Update: 2018-12-05
Android應用開發——TextView控制項屬性列表android:autoLink設定是否當文本為URL連結/email/電話號碼/map時,文本顯示為可點擊的連結。可選值(none/web/email/phone/map/all)android:autoText如果設定,將自動執行輸入值的拼字糾正。此處無效果,在顯示IME並輸入的時候起作用。android:bufferType指定getText()方式取得的文本類別。選項editable
Time of Update: 2018-12-05
Android有四種方式:SharePreference輕量級鍵-值方式儲存,以XML檔案方式儲存。檔案採用java.io.*庫所提供有I/O介面,讀寫檔案。SQLit資料庫SQLite是輕量級嵌入式內建資料庫。ContentProviderContentProvider可為資料封裝,為多個應用共用 建立 SharePreference SharedPreferences settings = this.getSharedPreferences("TestXML", 0);
Time of Update: 2018-12-05
from:http://blog.csdn.net/column/details/androidcore.html?page=2分析方法論探討之設計意圖為什麼要研究Android,是因為它夠龐大,它夠複雜,他激起了我作為一個程式員的內心的渴望,渴望理解這種複雜性。我研究的對象是作為手機開發平台的Android軟體系統部分,而不是Dalvik虛擬機器本身。作為一個從其他平台裝接過來的程式員,要從事Andoid平台系統開發,我的關於手機平台上積累的知識已經不能滿足需要了,Android為我們帶來了大
Time of Update: 2018-12-05
換了新的系統,新的電腦,以前的開發環境一切都要重來。 a。首先是安裝apt的時候出現了一些問題:由於我的eclipse的版本較新,所以在裝apt的時候出現一些錯誤。具體的我現在忘記了,好像記得什麼“core。*。*”之類的。網上教程感覺都很複雜,試了很多次都沒有成功解決我的問題。我最後的解決辦法是: help->check updates 更新它應該有的外掛程式庫就可以了。 b。接著在建立模擬器的時候出現如下問題: Error : Failed to create
Time of Update: 2018-12-05
public class JokeBean {private String id;private String title;private StringBuilder text=new StringBuilder();public JokeBean(){ }public String getId() {return id; }public void setId(String id) {this.id = id; }public String getTitle()
Time of Update: 2018-12-05
Android 中SharedPreferences使用一、SharedPreferences使用1protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);SharedPreferences mPerferences =
Time of Update: 2018-12-05
Android 中的Theme和Style使用,還是比較簡單的。1、 首先在res/values/styles.xml的resource中定義三個樣式,分別為: <style name="TextView"> <item name="android:textSize">38sp</item> <item name="android:textColor">#128</item> <item
Time of Update: 2018-12-05
Android的Handler使用如何每隔一段時間進行一些操作呢,Handler就可以做到。 下面的Demo的功能為每隔3秒顯示MyItems數組中的不同資料。public class MainActivity extends Activity {private int count = 0;private static final String[] MyItems = { "Here is a Item1", "Here is a Item2", "Here is a Item3",
Time of Update: 2018-12-05
Android 中PopupWindow使用。PopupWindow會阻塞對話方塊,要在外部線程 或者 PopupWindow本身做退出才行。mypopWindow.xml的Layout設計如下。<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"