Time of Update: 2013-12-11
作者:孫東風
Time of Update: 2013-12-11
要想Android運行起來,不但要編譯核心正確,還需要有正確地安裝根檔案系統,才可以運行起來。第一步,就是從模擬器裡提取data目錄的資料。也許你會問,為什麼要從模擬器裡提取呢?因為這樣做是最方便的,不必要每個目錄和檔案,都要自己去建立。在一個終端裡運行模擬器,並且運行android系統正常,然後再開啟一個終端,在這個終端裡運行adb來擷取模擬器的檔案,如下命令:adb pull /data
Time of Update: 2013-12-11
<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } --> 在init.rc檔案裡,可以看到下面的服務載入並運行:# adbd is controlled by the persist.service.adb.enable system property service adbd /sbin/adbd
Time of Update: 2013-12-11
<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } --> 在init.rc檔案裡,可以看到載入下面的服務: service media /system/bin/mediaserver user media group system audio camera graphics inet net_bt
Time of Update: 2013-12-11
<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } --> 在init.rc檔案裡,可以看到載入下面的服務: service bootanim /system/bin/bootanimation user graphics group graphics disabled oneshotbootanimation 服務的代碼在目錄:Android-2.0/frameworks/base/cmds/bootanimation
Time of Update: 2013-12-11
<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } --> 在init.rc檔案裡第一個初始化的服務是sh服務,如下:## Daemon processes to be run by init. ## service console /system/bin/sh
Time of Update: 2013-12-11
<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } --> 在init.rc檔案裡,可以看到載入下面的服務: service dbus /system/bin/dbus-daemon --system --nofork socket dbus stream 660 bluetooth bluetooth user bluetooth group bluetooth
Time of Update: 2013-12-11
[html]<?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="launger"> <item>date1</item>
Time of Update: 2013-12-11
SetWallpaper介紹如何在Android擷取當前Wallpaper,對Wallpaper做些修改,然後用修改後的映像重新設定Wallpaper。WallpaperManager用來管理Android的Wallpaper。下面代碼通過WallpaperManager來取得當前Wallpaper然後顯示在螢幕Layout的imageView上。[java] final WallpaperManager wallpaperManager =
Time of Update: 2013-12-11
在Android簡明開發教程三:第一個應用Hello World 已經介紹了Hello world樣本,這兩個Hello world 的Layout定義稍有不同:<TextView
Time of Update: 2013-12-11
這個例子單獨運行時(從Launcher啟動),這時接受到的Intent不含ACTION_SEARCH,和一個普通的Activity沒有什麼兩樣。在例(36)時,它是作為查詢處理Activity用於顯示使用者查詢內容。 SearchQueryResults 在AndroidManifest.xml定義為Searchable Activity:<intent-filter><action
Time of Update: 2013-12-11
AlarmManager 包含的主要方法:[java] // 取消已經註冊的與參數匹配的定時器 void cancel(PendingIntent operation) //註冊一個新的延遲定時器 void set(int type, long triggerAtTime, PendingIntent
Time of Update: 2013-12-11
Running Your App運行您的應用程式Run on a Real Device 在真機上運行應用程式Run on the Emulator在虛擬機器上運行應用程式如果你跟隨上一節建立了一個Android工程,那麼它包含了一組預設的,直接就可以正確的啟動並執行“Hello
Time of Update: 2013-12-11
本例對應的例子為DrawPoints.java,介紹如何使用Canvas來繪製點。Canvas 提供3個重載函數來繪製點(單個點或是一組點)public void drawPoint(float x, float y, Paint paint)public void drawPoints(float[] pts, Paint paint)public void drawPoints(float[] pts, int offset, int count, Paint
Time of Update: 2013-12-11
BUTTON類結構圖: 由類結構圖,可以看出Button是繼承於TextView的,所以TextView的一些屬性也適用於Button控制項。ImageButton類結構圖: ImageButton就是用一個表徵圖代表了一些文字,它沒Android:text屬性。它由Android:src指定表徵圖的位置android:src="@drawable/back_48"其他屬性都和Button差不多 1、 如何設定按鈕的樣式?
Time of Update: 2013-12-11
這兩天在給同事看一個問題。她在一個ViewA中加入一個子控制項view1之後,然後通過手指滑動,來移動這個子控制項,也就是改變了這個子控制項的位置了。然後再加入另外一個子控制項view2,這時候view1的位置被重設了,也就是跑到了viewA的左上方了。同事給我講了一下問題的基本情況之後,我的第一想法是子控制項view1的位置屬性並沒有被記錄下來。仔細的看了一下她移動子控制項的代碼,發現她是使用setLeft(),setTop()這兩個方法來移動子控制項的。隨後去官網查了一下setTop這個方法
Time of Update: 2013-12-11
Android程式裡面的分享功能分為第三方程式分享,就是使用QQ空間,QQ微博,新浪微博,人人等第三方包進行分享;還有就是用本地程式進行分享,如簡訊,UC瀏覽器,藍芽等. 他們的區別是使用第三方包進行分享手機系統不用安裝該類程式,而本地程序分享就需要. 這裡主要講的是使用本地程式進行分享. 效果如所示:實現代碼如下所示;[java] Intent email = new
Time of Update: 2013-12-11
本例橫向顯示UI控制項,並使用了nextFocusRight 明確為Button 指定按右鍵時下一個擷取焦點的UI控制項為rightButton (跳過中間的Button),但是從右至左時還是按照預設順序。<LinearLayout
Time of Update: 2013-12-11
1. 除了前面給大家介紹的execSQL()和rawQuery()方法, SQLiteDatabase還專門提供了對應於添加、刪除、更新、查詢的操作方法: insert()、delete()、update()和query()
Time of Update: 2013-12-11
animationOrder: 枚舉Layout中子View的順序,可以為normal (正序),reverse(倒序),random(隨機順序)。上例為倒序顯示ListView 中例表項。本例使用隨機順序顯示GridView的表徵圖項。ayout_random_fade.xml 定義如下:<layoutAnimation xmlns:android=”http://schemas.android.com/apk/res/android”android:delay=