Page 1 of 1

Airplane mode

Posted: 29 Dec 2015 23:42
by Linuxmel
My device is not rooted, what else can I use to replace airplane mode?
I mainly want to turn data and cell off. Thanks

Re: Airplane mode

Posted: 04 Jan 2016 19:59
by Martin
Hi,

Turning mobile data and telephony radio on/off requires root on most newer versions of Android. You could try to use action Control UI to show the quick settings and simulate a click on the setting. Something like this could work:

Code: Select all

quickSettings();
sleep(1000);
click("Airplane*");
The names of the buttons are highly device and language specific so you probably have to change "Airplane*" to something appropriate for your device.

Regards,
Martin

Re: Airplane mode

Posted: 05 Jan 2016 00:28
by Linuxmel
That code worked perfectly. I'm running 4.4.4 android. I'm surprised automagic doesn't have a way to turn data on/off like other programs like yours does. Wifi and BT has options. Thanks for your help. Is there a reference I can access to write other code?

Re: Airplane mode

Posted: 05 Jan 2016 19:41
by Martin
There's an action called Set Mobile Datanetwork State to turn data on/off (requires root on newer versions of Android).

The help page of action Control UI has some examples. The documentation of the scripting language itself can be found in the help page of action Script.

Re: Airplane mode

Posted: 05 Jan 2016 21:07
by Linuxmel
Great, thanks for responding!