Reputation: 29877
Does Android store all of its system settings in a single file? Is it possible to access this file and possibly copy it to an SD card. Would be great if an API existed that you could call that copies all the system settings to an SD card and lets you restore those settings from an SD card. This could be useful where you want to setup a new phone (or one reset) with the same system settings.
Not sure if the getConfiguration method does this. The documentation on it doesn't provide any details:
http://developer.android.com/reference/android/provider/Settings.System.html#getConfiguration(android.content.ContentResolver, android.content.res.Configuration)
By encapsulating this functionality in an API, an app doesn't have to concern itself with updating itself every time a new version of Android is released that contains new system settings.
Upvotes: 1
Views: 2116
Reputation: 52956
Internally settings are stored in a database and you can access them via the Settings content provider. The content provider enforces permissions: you need a permission to use it, some settings are read-only, for some you need another permission to change them, and yet others are modifiable only by the system (i.e., using the Settings app UI). This is by design. Directly changing and/or overwriting settings is bound to break a lot things. Additionally, upgrading to a new OS version adds and removes or deprecates settings, so it takes care of the proper migration. Again, blind overwriting would probably be a disaster if you upgraded the OS.
Hopefully, you now see why the API you propose is a bad idea.
Android does save some settings, such as often uses WiFi access point and a list of installed apps (from Google Play) to the 'cloud' by associating them with your Google account. If you reset your phone, those settings are restored automatically. The same thing can be achieved for user apps by using the standard backup system.
Upvotes: 2