Make the following access to the same internal set of properties, or is there a difference in their semantics?
java.lang.System.setProperty(String key, String value)
android.os.SystemProperties.set(String key, String value)
adb shell setprop 'key' 'value'
For example, after a call:
System.setProperty("myprop", "1");
adb shell getprop myprop returns an empty string.
adb shell getprop myprop
Note. SystemPropertiesis an inner class that does not appear in the SDK but is used by other system classes.
SystemProperties
SystemProperties.set()and adb shell setpropare interchangeable: both of them change the same value of a system property.
SystemProperties.set()
adb shell setprop
However, it System.setProperty()is specific to Java and VM and uses various naming conventions.
System.setProperty()