Android SystemProperties

Android SystemProperties


简单用例:

import android.os.SystemProperties;


boolean xxx = SystemProperties.getBoolean("persist.debug.xxx", false);
boolean xxx = "1".equals(SystemProperties.get("ro.debuggable"));

String xxx = SystemProperties.get("ro.xxx");
String xxx = SystemProperties.get("ro.xxx", "default");

if ("xx".equals(android.os.SystemProperties.get("ro.target.product","unknown"))) { }
if (SystemProperties.get("ro.xx.xxx","true").equals("true")) { }
if (SystemProperties.getInt("persist.sys.xxx", 0) == 1) { }

参考:

Android SystemProperties设置/取得系统属性的用法总结

http://www.cnblogs.com/senior-engineer/p/4972848.html

猜你喜欢

转载自blog.csdn.net/dc3120/article/details/88288603
今日推荐