1、C下
头文件在system/core/include/cutils/properties.h
property_get定义在system/core/libcutils/properties.c
#include <cutils/properties.h>
property_get(key, value, def_value);
property_set(key, value);
在Android.mk里添加libcutils库
LOCAL_STATIC_LIBRARIES :=libcutils
或者LOCAL_SHARED_LIBRARIES :=libcutils
2、java
frameworks/base/core/java/android/os/SystemProperties.java
import android.os.SystemProperties;
SystemProperties.get(key, def_value);
SystemProperties.set(key, value);