Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to import android.os.SystemProperties

Tags:

android

I am trying to use

SystemProperties.get();

but not able to import the android.os.SystemProperties package bit of googling tells me its hidden, is there any way around this ?

like image 876
Sunny Kumar Aditya Avatar asked May 02 '12 07:05

Sunny Kumar Aditya


1 Answers

SystemProperties is a hidden class that is only available to platform-level code. You could try to access it via reflection, but this is not recommended.

It is easy to confuse Android's SystemProperties class with the old-style Java way of doing properties, namely java.lang.System.getProperty(). Note that these are two totally separate systems. An important difference is that the Java mechanism works only within a given process, whereas the Android SystemProperties works across processes.

As an app developer, although you don't normally get a Java-based API into Android's Android SystemProperties, you can inspect the SystemProperties at the command-line using

adb shell getprop
like image 102
Jo Jo Avatar answered Oct 04 '22 05:10

Jo Jo