Hi there,
I want to improve the screen off flow. So, when screen is switched off, I want Automagic to remember the stati of WiFi and Mobile Data connection. So when screen turned on, I want to enable only those connection types which have been on when screen was switched off. So I have to store the stati when screen is switched off...
Many thanks in advance
Martin
How to store mobile connection status to global variable
Moderator: Martin
Re: How to store mobile connection status to global variable
Hi,
You can add conditions to check the state of mobile data:
-condition: "Mobile Datanetwork Enabled"
-->true: -action "Script: global_data_enabled = true"
-->false: -action "Script: global_data_enabled = false"
Restore when the screen is turned on:
-condition "Expression: global_data_enabled"
--> true: action "Set Mobile Datanetwork State: On"
--> false: action "Set Mobile Datanetwork State: Off"
Perhaps you can use the WiFi sleep policy in the Android settings to achieve the same for WiFi: Settings->Wi-Fi->menu->Advanced->Keep Wi-Fi on during sleep: Never.
Regards,
Martin
You can add conditions to check the state of mobile data:
-condition: "Mobile Datanetwork Enabled"
-->true: -action "Script: global_data_enabled = true"
-->false: -action "Script: global_data_enabled = false"
Restore when the screen is turned on:
-condition "Expression: global_data_enabled"
--> true: action "Set Mobile Datanetwork State: On"
--> false: action "Set Mobile Datanetwork State: Off"
Perhaps you can use the WiFi sleep policy in the Android settings to achieve the same for WiFi: Settings->Wi-Fi->menu->Advanced->Keep Wi-Fi on during sleep: Never.
Regards,
Martin
Re: How to store mobile connection status to global variable
Yeah, that's what I am looking for! Sound pretty simple once you got the concept
Thanks a lot
Martin
Thanks a lot
Martin