Connect phone, adb shell into Android shell mode, enter Getprop to get system property value
Get the property name by using the method above, then get the property value of the system by the following method
/**
* Get a property in the Build.prop file
*
* @param propname Property name
* @return Attribute value
*/
public static string Getsystemproperty (String propname) {
LOG.I (Log_tag, "Getsystemproperty in Time:" + system.currenttimemillis ());
String Line;
BufferedReader input = null;
try {
Process p = runtime.getruntime (). EXEC ("Getprop" + propname);
input = new BufferedReader (
New InputStreamReader (P.getinputstream ()), 1024);
line = Input.readline ();
Input.close ();
} catch (Exception ex) {
LOG.E (Log_tag, "Unable to read Sysprop" + propname, ex);
return null;
} finally {
if (input! = null) {
try {
Input.close ();
} catch (Exception e) {
LOG.E (Log_tag, "Exception while closing InputStream", E);
}
}
}
LOG.I (Log_tag, "Getsystemproperty out time:" + system.currenttimemillis ());
return line;
}
Android Get System Information