Android examples for App:App Information
get System Property
//package com.java2s; import android.util.Log; import java.lang.reflect.Method; public class Main { private static boolean LOGENABLE = false; private static String getSystemProperty(String key, String defaultValue) { String value = defaultValue; try {//w ww.j av a 2 s .com Class<?> clazz = Class.forName("android.os.SystemProperties"); Method get = clazz.getMethod("get", String.class, String.class); value = (String) (get.invoke(clazz, key, "")); } catch (Exception e) { if (LOGENABLE) { Log.d("getSystemProperty", "key = " + key + ", error = " + e.getMessage()); } } if (LOGENABLE) { Log.d("getSystemProperty", key + " = " + value); } return value; } }