Time of Update: 2018-12-05
通知使用者Notifying the User某些情況下需要通知使用者你的應用程式中發生了一個事件。一些事件請求使用者應答而另外一些則不需要。比如:· 當一個事件比如儲存檔案結束時,應該出現一條訊息確認儲存成功。· 如果一個後台啟動並執行應用程式需要使用者關注,這個應用程式應該建立一個通知來允許使用者在方便時進行應答。·
Time of Update: 2018-12-05
*)if you run the android app, and it displays an exception, then you find the resource returned by findviewbyid is null,most likely you are using the old style "id" in you xml layout file, change it to "android.id" will fix your problem. *)if there
Time of Update: 2018-12-05
在手機上提交使用者資料資訊(如需要頭像、暱稱),或者提交一個商品資訊(商品圖片和標籤),或者共用一個圖片到伺服器上。我們都需要同時處理檔案上傳和一般類型資料的提交。這個在web應用中很常見也很簡單。行動裝置 App可以類比web頁面提交一個HTTP POST請求,其中Content-type為multipart/form-data。具體程式碼範例如下: HttpClient httpClient = new DefaultHttpClient(); HttpPost
Time of Update: 2018-12-05
可以使用WifiManager和WifiInfo來擷取當前Wifi串連資訊 WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); Log.d("wifiInfo", wifiInfo.toString());
Time of Update: 2018-12-05
有時候需要從一個APP中啟動另外一個APP,比如Twitter/等。如果你不知道那個APP的Activity,但是知道包名(package name),那麼可以使用如下的方法:Intent LaunchIntent =
Time of Update: 2018-12-05
翻譯問題待修正。 你可以讓你的網頁內容提供給使用者兩種方式:在傳統的Web瀏覽器,在一個Android應用程式,在布局,包括一個WebView。 這裡有兩種方式開發一個Android應用程式:作為一個用戶端應用程式(使用Android SDK的開發,並作為硬軟體的使用者裝置安裝。)或Web應用程式(Web標準和開發利用通過Web瀏覽器訪問,無須安裝在使用者裝置)。
Time of Update: 2018-12-05
本文描述 Android SDK 安裝過程,包括:Android SDK 2.2, Eclipse 3.5.2(galileo), 和 Andoid Development Tools (ADT) plugin。 一個前提是使用者已經安裝了 JDK5.0 或 JDK 6.0。並且在系統內容變數設定了 Path 包含 JDK 的 bin 目錄。 [安裝 Android 2.2] 1. 下載Android 2.2
Time of Update: 2018-12-05
近期正在往Android平台移植演算法。確切地說,是針對ARM A8 A9
Time of Update: 2018-12-05
Android NDK 基本就是 Linux的開發,不過主要是產生.so形式供SDK調用。涉及的工具,就是Linux開發工具+SDK介面組件 建立 NDK 編譯環境1. 下載android NDK r4 Windows 安裝包,解壓縮到你想放的位置,如d:/android2. 安裝較新版本的cygwin,安裝中需要選擇安裝的Linux相關組件,主要是make、gcc、g++工具3. 運行cygwin, 設定檔.bash_profile中添加環境變數
Time of Update: 2018-12-05
一、Canvas類android.graphics.Canvas Canvas類好比手機中的畫紙,我們可以在Canvas上畫圖形或者映像。一般我們用android來繪畫的時候,需要四個組成部分: 1、位元影像:包含像素 2、Canvas畫板:包含繪畫內容,寫入位元影像 3、初始圖形:如Rect、Bitmap、text等 4、Paint:用來描述上面初始圖形的顏色和類型等 Canvas類提供了三個構造方法: Public Canvas();構造一個預設無參的Canvas對象 Public
Time of Update: 2018-12-05
http://www.cnblogs.com/salam/archive/2010/11/30/1892143.html 我們在開發程式是經常會需要軟體全螢幕顯示、自訂標題(使用按鈕等控制項)和其他的需求,今天這一講就是如何控制Android應用程式的表單顯示. 首先介紹一個重要方法那就是requestWindowFeature(featrueId),它的功能是啟用表單的擴充特性。參數是Window類中定義的常量。一、枚舉常量1.DEFAULT_FEATURES:系統預設狀態,一般不需要指定
Time of Update: 2018-12-05
原文 : http://www.cnblogs.com/growing/archive/2010/11/19/1881372.html
Time of Update: 2018-12-05
Android 風格和主題Android xml風格和主題檔案的編寫,是涉及到整個程式介面美觀的因素之一。
Time of Update: 2018-12-05
http://www.cnmsdn.com/html/201004/1270791463ID3383.html通過程式擷取android系統手機的鈴聲和音量。同樣,設定鈴聲和音量的方法也很簡單! AudioManager mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); //通話音量 int max = mAudioManager.getStreamMaxVolume( AudioManager.
Time of Update: 2018-12-05
Android程式使用代碼的安裝和卸載!!! http://www.cnblogs.com/Greenwood/archive/2011/03/09/1979268.html安裝:String str = "/CanavaCancel.apk";String fileName = Environment.getExternalStorageDirectory() + str;Intent intent = new
Time of Update: 2018-12-05
http://www.cnblogs.com/TerryBlog/archive/2010/07/29/1788319.html 本來打算晚上繼續 Api Demos 系列的,不過今天下午的時候無聊去玩了一下案頭組件 App Widget 覺得挺不錯的一個東西,對它很是感興趣,玩了一下碰到很多問題,一直在解決問題到了晚上10點。只能怪自己理解不深刻,不過最後還是解決了,把一些領悟寫出來也算給自己一個交代。下面是本篇的大綱:1、AppWidget 架構類2、在 Android 如何使用
Time of Update: 2018-12-05
1. 準備工具: android-sdk-windows-1.5_r2.zip,解壓後,在tools目錄下有:android.bat, emulator.exe, adb.exe, mksdcard.exe 2. 開始/運行/cmd,啟動一個命令列終端,建立avd(android virtual device);android create avd -target 1 -name myavdandroid list avd (顯示可用的avd) 3. 建立SD卡鏡像:mksdcard
Time of Update: 2018-12-05
gravity 這個英文單詞是重心的意思,在這裡就表示固定位置的意思。android:layout_gravity 和 android:gravity 的區別從名字上可以看到,android:gravity是對元素本身說的,元素本身的文本顯示在什麼地方靠著換個屬性設定,不過不設定預設是在左側的。android:layout_gravity是相對與它的父元素說的,說明元素顯示在父元素的什麼位置。比如說button: android:layout_gravity 表示按鈕在介面上的位置。
Time of Update: 2018-12-05
1. Android的一些有用的官方網站:http://android.git.kernel.org android源碼網站http://source.android.com http://code.google.com/android http://developer.android.com2. 安裝git源碼管理工具 # cd ~ # mkdir bin # echo $PATH # curl http://android.git.kernel.org/repo >
Time of Update: 2018-12-05
因為bionic的限制,gcc開啟-pg參數後會提示找不到__gnu_mcount_nc。搜尋之後發現richard.quirk已經做好了gprof的支援庫:http://code.google.com/p/android-ndk-profiler/簡單翻譯下使用方法:將壓縮包解壓,然後在Android.mk中添加LOCAL_SRC_FILES :=