get System Property - Android android.os

Android examples for android.os:SystemProperties

Description

get System Property

Demo Code

import java.lang.reflect.Method;

public class Main {

  public static String getSystemProperty(String key) {
    String pValue = null;// w  ww  .java  2 s  . c o m
    try {
      Class<?> c = Class.forName("android.os.SystemProperties");
      Method m = c.getMethod("get", String.class);
      pValue = m.invoke(null, key).toString();
    } catch (Exception e) {
    }
    return pValue;
  }

}

Related Tutorials