Since the sdk version 4.2 it seems like it\'s no longer possible to modify airplane-mode on devices since google has moved this setting to Settings.Global which is read-only
Just want to double check that my assessment is correct and that my app is dead starting from android 4.2 and above.
Yes. Or, to put it another way, if there is a back-door way to modify this setting, it represents a security hole, which will eventually get closed, much like the enable/disable GPS restriction that has existed for 3+ years.
I know you explicitly ask for a solution without rooting, but if you have a rooted device there is at least the (kind of) official solution to move your app into folder /system/app
. Then it is possible to write into Settings.Global
:
Settings.Global.putInt(context.getContentResolver(), Global.AIRPLANE_MODE_ON, mode ? 1 : 0);
Have a look of how to toggle airplane mode for 4.2
and how to move your app into /system/app
here. I use this for my toggle widget Mini Status (source code link).