There's this old question
at stackoverflow.com about how to change system settings stored via
using a shell command. The answer is:
I'm not sure about older Android versions, but in 4.* the above settings are stored in the SQLite database at
. The older
settings are in a table called
and the newer
settings are in a tabled called
(and then there're the
settings in the
table too). If you've root access and an SQLite binary (eg. Titanium Backup
installs an SQLite3 binary into
), you can update system settings using a simple SQL update.
sqlite3 "/data/data/com.android.providers.settings/databases/settings.db" "update global set value = 'bluetooth,wifi,nfc' where name = 'airplane_mode_toggleable_radios';"
Of course for this to work you need write access to this
file which requires root privileges ... which requires a rooted phone. In this older CyanogenMod forum post
somebody describes a read-write remount of
to gain write access to the
. Maybe in older Android versions
was initially mounted read-only?
The above database update however does not apply the new settings immediately. You probably have to reboot the phone for these changes to take effect. If you want instant changes without a reboot, then you've to revert back to coding and use the
functions of the mentioned
classes to set system settings. Your app will need the
) permission though.