Android `settings.db` reference?

4.7k views Asked by At

Is there any reference about settings.db database file? I see mostly obviously variables but there is not enough for confidence.

2

There are 2 answers

4
Zaid Daghestani On BEST ANSWER

There is hardly any reference. You should be using the Settings.System class to be access the system settings in Android. Using the Settings.System class, you are able to both read and write to the system settings.

Checking Mobile Network:

 ConnectivityManager nInfo = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    nInfo.getActiveNetworkInfo().isConnectedOrConnecting();

    Log.d(tag, "Net avail:"
            + nInfo.getActiveNetworkInfo().isConnectedOrConnecting());

    ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo netInfo = cm.getActiveNetworkInfo();
    if (netInfo != null && netInfo.isConnectedOrConnecting()) {
        Log.d(tag, "Network available:true");
        return true;
    } else {
        Log.d(tag, "Network available:false");
        return false;
    }
1
Charles Milette On

On a rooted device, you can pull the file from /data/data/com.android.providers.settings/databases/settings.db (you will need to do adb root before)

Then you can open it a with a sqlite database explorer:
pic
The names are self-explanatory. If one confuses you, a simple google search should help.