http://blog.csdn.net/njhao/archive/2010/10/11/5932635.aspx

原理说明:http://www.williamhua.com/2010/03/05/android-property-system/

注意点

  1. System.getProperty只能访问process自有的property
  2. 如需访问System Property,需要利用反射机制调用SystemProperty.get
view plain copy to clipboard print ?
  1. publicstaticintgetInt(Stringkey,intdef){
  2. try
  3. {
  4. //thisfieldisnotavailableinAndroidSDK
  5. if(getIntMethod==null)
  6. {
  7. getIntMethod=Class.forName("android.os.SystemProperties").getMethod("getInt",newClass[]{String.class,int.class});
  8. }
  9. return(Integer)getIntMethod.invoke(null,newObject[]{key,def});
  10. }catch(Exceptione)
  11. {
  12. thrownewRuntimeException("Platformerror",e);
  13. }
  14. //returndef;
  15. }

更多相关文章

  1. android中的 Handler机制
  2. [Android]判断是否是华为EMUI系统
  3. Android(安卓)wifi设计原理(源码分析)
  4. Android面试题总结(七)原理篇
  5. Android(安卓)列表按照时间排序
  6. Android(安卓)binder 原理及实现机制
  7. android消息机制(handler运行机制)解析
  8. android进行异步更新UI的四种方式
  9. Gallery的使用

随机推荐

  1. Java(Android)数据结构汇总(四)-- Map(上)
  2. android studio aar 添加依赖
  3. Android(安卓)第一个OpenGL ES程序
  4. android 学习资源整理(二)
  5. Android培训班(68)dex文件打开流程
  6. Android两种相机的调用方式
  7. Android(安卓)Studio更新 Gradle错误解决
  8. android关于微信分享和登录的一些注意点
  9. 关于android:configChanges="keyboardHid
  10. 界面背景渐变色