Android提供了一套系统参数设置和获取的方法,这些参数可以在android系统中静态或动态的设定和获取。
getprop “key”
setprop "key" "value"
system/core/libcutils/properties.c
#define PROPERTY_KEY_MAX 32
#define PROPERTY_VALUE_MAX 92
int property_get(const char *key, char *value, const char *default_value);
int property_set(const char *key, const char *value);
int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie);
frameworks/base/core/java/android/os/SystemProperties.java
public static final int PROP_NAME_MAX = 31;
public static final int PROP_VALUE_MAX = 91;
public static String get(String key) ;
public static String get(String key, String def) ;
public static int getInt(String key, int def) ;
public static long getLong(String key, long def) ;
public static boolean getBoolean(String key, boolean def) ;
public static void set(String key, String val) ;
public static void addChangeCallback(Runnable callback) ;
函数接口命令很明确,就不介绍了