Time of Update: 2018-12-05
預設情況下軟鍵盤右下角的按鈕為“下一個”,點擊會到下一個輸入框,保持軟鍵盤設定 android:imeOptions="actionDone" ,軟鍵盤下方變成“完成”,點擊後游標保持在原來的輸入框上,並且軟鍵盤關閉android:imeOptions="actionSend" 軟鍵盤下方變成“發送”,點擊後游標移動下一個 在這裡設定的imeOptions如何使用呢?如下面的代碼,讓EditText實現setOnEditorActionListener,在onEditAction方法中actio
Time of Update: 2018-12-05
第一部分:TextView控制項1.顯示TextView控制項的兩種方法 2.TextView屬性①字型大小:推薦使用sp作單位②高度和寬度:推薦使用dp作單位 3.改變文本的顏色 4.設定超連結 5.跑馬燈效果 第二部分:EditText控制項1.去除焦點的方法 2.屬性限制輸入的方法限制輸入的字元數限制輸入的資訊:數字多行文字框:預設情況下是多行的設定圖片設定提示資訊設定圓角 第三部分:Button控制項1.設定點擊事件
Time of Update: 2018-12-05
如果你只需要修改某一個模組的內容,但是卻每次都要執行make, 最後等待很長時間。使用模組編譯,那隻需要在你所在的模組的目錄或者其子目錄,執行mm,便可以編譯出一個單獨的apk,這樣豈不快哉!具體步驟: 1)開啟~/.baserc檔案,加入source ~/I850/build/envsetup.sh. 加入你自己該檔案所在的路徑,這樣就免去了每次啟動新的終端執行mm命令之前,需要引用此檔案。
Time of Update: 2018-12-06
轉載請註明出處為KlayGE遊戲引擎 From http://android-developers.blogspot.com/2011/11/updated-ndk-for-android-40.htmlToday we are releasing an updated version of the Android NDK, now in revision 7. The updated NDK lets developers who are using native code get
Time of Update: 2018-12-06
-----------------------------------------------package com.eboy.filereadwrite;import android.app.Activity;import android.os.Bundle;import android.os.Environment;import android.view.View;import android.widget.Button;import android.widget.EditText;impo
Time of Update: 2018-12-06
<?xml version="1.0" encoding="UTF-8"?><persons> <person id="23"> <name>eboy</name> <age>22</age> </person> <person id="24"> <name>Frr</name> <ag
Time of Update: 2018-12-06
Android應用中,由一些基本元素構成,但如何互動呢?Activity->Activity: Activity之間通過Intent進行互動,可以通過直接類名直接跳轉,也可以通過Intent Filter進行匹配分析,然後找到對應的Activity進行切換,這是一種鬆散的藕合。Internal Activity: 在Activity 內部,View,Button 等UI組件通過設定Listener對UI事件進行監聽處理。Progress->Progress:
Time of Update: 2018-12-06
對於一個Android應用,先看看官方網站的一個簡介。對於一個Android應用程式來說,是由四種構造塊組織而成的,這四種構造塊如下:ActivityIntent ReceiverServiceContent Provider 但是,並不是每一個Android應用程式都需要這四種構造塊,這不是必須的,某些時候,我們只需要這四種中的幾種組合成我們的應用。
Time of Update: 2018-12-06
//能夠取得螢幕的資訊 DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm);dm.widthPixels; //取得寬像素 dm.heightPixels; //取得高像素 //擷取當地的日曆 Calendar c=Calendar.getInstance();
Time of Update: 2018-12-06
public void startActivity(Intent intent, int animationEnterId, int animationLeaveId) { Activity activity = this; activity = TinyUtils.getRootActivity(this); if (activity == this) { super.startActivity(intent); } else {
Time of Update: 2018-12-06
布局XML: <android.gesture.GestureOverlayView android:id="@+id/gesture1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gestureStrokeType="multiple">
Time of Update: 2018-12-06
//獲得相應的系統服務 TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); //使用TelephonyManager對象的listen(PhoneStateListener listener, int
Time of Update: 2018-12-06
以Nesus s為例,由usb到耳機是Y軸;調節音量到開關螢幕為X軸;螢幕上方向為Z軸。 public class AccessSensorManagerActivity extends Activity {
Time of Update: 2018-12-06
在實際開發中,開發android軟體的過程需要不斷地進行測試。使用Junint測試架構,是正規Android開發的必用技術,在Junint中可以得到組件,可以類比發送事件和檢測程式處理的正確性。單元測試是嵌入到項目中;也可以作為一個單獨的項目爭對某個具體項目進行測試。 第一步:首先在AndroidManifest.xml中加入下面紅色代碼: <manifest
Time of Update: 2018-12-06
Select按鈕是把資料庫的內容搜尋出來並顯示在下面的列表中;Insert按鈕是把輸入框的資料插入到資料庫;Modify是當在列表中選擇到資料,然後通過輸入框進行修改後更新到資料庫;Delete按鈕是當在列表中選擇到資料後,對選擇的那條資料進行刪除。注意:Age輸入框必須輸入數字。
Time of Update: 2018-12-06
WebView 設定實現兩個手指縮放網頁:mWebView.getSettings().setSupportZoom(true);mWebView.getSettings().setBuiltInZoomControls(true); WebView cookies清理: CookieSyncManager.createInstance(this);CookieSyncManager.getInstance().startSync();CookieManager.getInstance().
Time of Update: 2018-12-06
http://blog.csdn.net/hitlion2008/article/details/7983449AsyncTask的介紹及基本使用方法關於AsyncTask的介紹和基本使用方法可以參考官方文檔和Android實戰技巧:多線程AsyncTask這裡就不重複。AsyncTask引發的一個問題上周遇到了一個極其詭異的問題,一個小功能從網路上下載一個圖片,然後放到ImageView中,是用AsyncTask來實現的,本身邏輯也很簡單,僅是在doInBackground中用HTTP請求把圖
Time of Update: 2018-12-06
轉自:http://blog.csdn.net/xxxsz/article/details/8199031判斷網路類型是wifi,還是3G,還是2G網路,對不同的網路進行不同的處理,現將判斷方法整理給大家,以供參考 說明:下面用到的資料移動2G,聯通2G,聯通3G,wifi我都已經測試過,暫時手上沒有電信的卡,所以沒有驗證,有電信手機的同事,可以驗證一下,驗證後將結果發送給大家。 ConnectivityManager connectMgr = (ConnectivityManager) th
Time of Update: 2018-12-06
Android的系統架構和其作業系統一樣,採用了分層的架構。從架構圖看,android分為四個層,從高層到低層分別是應用程式層、應用程式架構層、系統運行庫層和linux核心層。 1.應用程式 Android會同一系列核心應用程式套件組合一起發布,該應用程式套件組合包括email用戶端,SMS短訊息程式,日曆,地圖,瀏覽器,連絡人管理程式等。所有的應用程式都是使用JAVA語言編寫的。 2.應用程式架構 開發人員也可以完全訪問核心應用程式所使用的API架構。該應用程式的架構設計簡化了
Time of Update: 2018-12-06
1. Boot系統初始化, 具體過程參見(system\core\init\Init.c)中的main函數,這時候,手機或者模擬器出現的畫面是一個console,顯示“ANDROID”msg。 2. 初始化成功後,就開始mounting系統,具體參見(system\core\mountd\Mountd.c) 中的main函數。 3.接下來運行ndroidRuntime,並開始啟動java虛擬機器dalvikvm。 4.