Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where does ansroid.os.SystemProperties store its key/values?

Tags:

android

As we all know, we can using the android.os.SystemProperties.set(String, String) and android.os.SystemProperties.get(String, String) for setting and getting values, my question is where does these <key value> pairs store? Sqlite database or a pure text file? If so, which directory can we find them?

like image 315
tonykwok Avatar asked Jul 03 '12 12:07

tonykwok


People also ask

Where are Android system properties stored?

xxx properties, it's stored under /data/property with the property name as the filename. For other non-persist properties, it's stored in shared memory.

What is android system properties file?

System properties help OS and apps to share data dependent on global variables. These variables define the system configuration with key-value data points. All the values by definition are used to explain the configuration within the Android architecture.


2 Answers

For persist.xxx properties, it's stored under /data/property with the property name as the filename. For other non-persist properties, it's stored in shared memory.

like image 93
Dagang Avatar answered Oct 21 '22 03:10

Dagang


Because Android is based on Linux, there is no way to read these settings from a file or database or something like that, because it does not exists.

While booting your device, the kernel stores the list of environment variables into the memory.

Each process, which is started by an application or by you, is cloning the variables from his parent process and can define his own variables.

In Linux you can access a virtual file stored in /proc/'pid'/environ but 1. this is realy not recommended and 2. it doesn't not look like that there is such a file in android filesystem.

If I am wrong with my assumption, please let me know :)

like image 45
Martin Seeler Avatar answered Oct 21 '22 03:10

Martin Seeler