Android - Where are Android settings stored?

As it turns out, there is no magic file or directory that contains all settings. They are stored in various places, and depends greatly on how the manufacturer decides to set things up. I primarily work with Samsung phones, so the information here will mostly be Samsung oriented. Also, note that all of the below requires root access. If anyone has anything to add / rectify, feel free to comment.

First off, I have found that "copying settings" is not always the best way to go. You can do nandroid backups and restores, which pretty much clones one phone to another. If you're technical enough, and you're using Samsung, then creating your own odin image might be an even better option as it doesn't rely on you or someone else having created nandroid / recovery support.

The Settings

General settings:
Settings are mostly stored in the /data subdirectory. If you're looking for something specific, start there.

Built-in apps:
Built-in apps tend to keep their settings in /data/data/com.android.* and /data/data/com.google.android.*
For example:
Contacts: /data/data/com.android.contacts
Email accounts: /data/data/com.android.email
MMS: /data/data/com.android.mms

WiFi:
WiFi settings location depends on the manufacturer, but is generally predictable.
Samsung Galaxy Pocket, S2, S3: /data/misc/wifi/wpa_supplicant.conf
Samsung Tab: /data/wifi/bcm_supp.conf
HTC Desire: /data/misc/wifi/wpa_supplicant.conf
Dell Streak: /data/misc/wifi/wpa.conf
Oneplus 2, 3: /data/misc/wifi/networkHistory.txt

Keyboard configs:
I have had to disable hardware keys, reconfigure layouts, or alter general keyboard behaviour before. The exact file name tends to be different on every phone, but I've found the config files to always be in /system/usr/keylayout/. Be careful, as breaking those could render your phone unusable.

Misc:
Most miscellaneous settings like product information, boot sounds, and enabling / disabling the on-screen nav bar are stored in /system/build.prop. Breaking this config file could bootloop your device.

If I find more information, I'll add later.


I'm not an expert in android technologies. So I'm not totally sure whether my answer is true or not. But, using Root Explorer, I discovered that some of the settings are stored in the following files:

  • /data/system/users/0/settings_system.xml
  • /data/system/users/0/settings_secure.xml

For example the screen brightness is stored in the file settings_system.xml. If you open this file using a text editor, you may come across the following line of code:

<setting id="2220" name="screen_brightness" value="66" package="com.android.settings" />

In the code above, the number "66" indicates the screen brightness. The higher the number, the brighter the screen. I also discovered that the background image of your cell phone is stored in the following file path:

  • /data/system/users/0/wallpaper

My cell phone is Samsung SM-J7. Maybe my discovery may vary for other smart phones.


another possible way to do that is through the ``content'' command, e.g.:

adb shell content query --uri content://settings/global 
adb shell content insert --uri content://settings/global --bind name:s:preferred_network_mode1 --bind value:i:0

Tags:

Settings