Page 1 of 1

How to store mobile connection status to global variable

Posted: 13 May 2013 05:16
by msiemens
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

Re: How to store mobile connection status to global variable

Posted: 13 May 2013 08:25
by Martin
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

Re: How to store mobile connection status to global variable

Posted: 13 May 2013 11:24
by msiemens
Yeah, that's what I am looking for! Sound pretty simple once you got the concept :-)

Thanks a lot
Martin