2013年8月5日 星期一

[轉] Android Property

Introduction Android Property 是系統的環境變數設定 這邊有一篇文章,寫得還不錯啦 http://blog.csdn.net/loughsky/archive/2008/11/14/3297286.aspx Android Property有點像我們windows的registery 個人是這樣的覺得 Android 裡面很多都有用到property_get/property_set的function來設定或獲得變數 你可以使用這邊的library: /device/lib/cutils int property_get(const char *key, char *value, const char *default_value); int property_set(const char *key, const char *value); 那當system起來的時候,會去Load幾個property的檔案 /default.prop /system/build.prop /system/default.prop /data/local.prop 每個裡面代表不同的設定值 很多Android的AP都會base on 這些property去做一些行為 而property又分幾種 01. "ro." : read only 02. "persist.": then when setting this property, the value will be written to /data/property, too. 03. "net." : when when setting this property, the “net.change” property will be set automatically to contain the name of the last updated property. 04. "ctl." :The property “ctrl.start” and “ctrl.stop” is used to start and stop a service. Android Tools 使用者可以使用這些指令來看系統目前的property設定 getprop setprop Good Luck!