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.
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.
Toggle Mobile Data (non-root)
Moderator: Martin
-
- Posts: 62
- Joined: 15 Jan 2014 08:25
Re: Toggle Mobile Data (non-root)
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.
Re: Toggle Mobile Data (non-root)
Sorry, mein Englisch ist nicht so gute. Heist das, dass ich damit meine Mobile Daten an bzw Ausschalten kann ohne Root.