Toggle Mobile Data (non-root)

Share and discuss your flows and ideas with other users.

Moderator: Martin

Post Reply
syndromtr
Posts: 31
Joined: 01 Feb 2013 13:28

Toggle Mobile Data (non-root)

Post by syndromtr » 05 Jan 2018 18:23

Here is an example of getting mobile data state - toggle if needed flow, as it's a part of full flow, i share screenshot and descriptions of it...
device spec: Lenovo K5 Note - Android 6 - no root
this part of flow needs screen on to operate!

first and essential step: you need to dump global variables to two files and compare, like this: (of course adb shell needed and connecting phone to pc with usb debugging on)

make sure mobiledata is on, from pc adb folder:
adb shell settings list global > on.txt

turn off mobiledata from phone normal way and then second command:
adb shell settings list global > off.txt

2 files created. now time to compare these txt files with file compare programs.
my phone, this variable changes only:
mobile_data1 (can be 0 or 1 --- that variable will be used to detect mobiledata state)

and setup a flow like that as shown below, and last step, with trial and error method, find the XY coordinates to be clicked (while quicksetting tiles are on screen - up and down arrow button for mobiledata) and change the coordinates with yours.

Image

description: (above part of flow sets mobile data off, if it's enabled)

Init Variable System Setting : it gets value of global variable "mobile_data1" and stores into variable varm

Expression : varm==1; (mobile data on?)

ControlUI: quickSettings();sleep(1000);click(540,513);sleep(1000);
(opens quick settings, waits for a second and clicks the position of mobiledata up down arrows - another one second)

NOTE: someone might ask, what about directly writing 0/1 into global "mobile_data1"? i tried and it didn't work.

guuzendesu
Posts: 62
Joined: 15 Jan 2014 08:25

Re: Toggle Mobile Data (non-root)

Post by guuzendesu » 30 Jan 2018 01:49

I'm on Android 7.1.1 and it's the same variable. Likely it's easier to check the system setting manually by making a flow with the trigger 'system setting changed' and select 'mobile_data' (which is in the 'Global' area on mine), and add a simple beep action to see if it's triggered when you toggle mobile data manually. If it's not 'mobile_data' then you can probably find it by scanning the names of the variables.

Broesel
Posts: 47
Joined: 03 Jan 2014 21:17

Re: Toggle Mobile Data (non-root)

Post by Broesel » 05 Feb 2018 10:42

Sorry, mein Englisch ist nicht so gute. Heist das, dass ich damit meine Mobile Daten an bzw Ausschalten kann ohne Root.

Post Reply