Airplane mode

Post your questions and help other users.

Moderator: Martin

Post Reply
Linuxmel
Posts: 21
Joined: 21 Dec 2015 00:16

Airplane mode

Post by Linuxmel » 29 Dec 2015 23:42

My device is not rooted, what else can I use to replace airplane mode?
I mainly want to turn data and cell off. Thanks

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Airplane mode

Post by Martin » 04 Jan 2016 19:59

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

Linuxmel
Posts: 21
Joined: 21 Dec 2015 00:16

Re: Airplane mode

Post by Linuxmel » 05 Jan 2016 00:28

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?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Airplane mode

Post by Martin » 05 Jan 2016 19:41

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.

Linuxmel
Posts: 21
Joined: 21 Dec 2015 00:16

Re: Airplane mode

Post by Linuxmel » 05 Jan 2016 21:07

Great, thanks for responding!

Post Reply