Turning on Mobile Data

11 views
Skip to first unread message

Mustafa Taşkın

unread,
Mar 19, 2015, 6:03:03 PM3/19/15
to app-reactor...@googlegroups.com
Hello,

I'm not a coder, just trying things on Reactor.
I modified the sample: Turn WiFi at home script and added a second coordinate in it. I also tried turning mobile data on or off in according to WiFi status. But I get error messages about mobile data command. Where could be the problem?


// Turn wifi on when home and off when out

loc = location();
log("Current location lat: " ~ loc["lat"] ~ " lon: " ~ loc["lon"]);

while(true) {

// put your work location here
iAmWork = near(10, 20, 700);
// put your home location here
iAmHome = near(10, 30, 100);
if (iAmWork) {
log("At work");
enableWifi(true);
enableDate(false);
} else if (iAmHome) {
log("At home");
enableWifi(true);
enableDate(false);
} else {
log("Out");
enableWifi(false);
enableDate(true);

}
// wait 20 minutes till next check
sleep(1200000);

}

Thanks in advance.

joel leaman

unread,
Oct 29, 2015, 4:35:42 AM10/29/15
to App Reactor for Android
This seems to be a problem lately. I also get the error message:

ERROR: Cannot run script sandbox , InvalidParameterException setMobileDataEnabled [boolean]
ERROR: null, NoSuchMethodException setMobileDataEnabled [boolean]
DEBUG: PARAM enable = false
DEBUG: FUNCTION enableDate()
INFO: Starting DEBUG service
INFO: Start in foreground

I think this is only a problem for more recent versions of android.

Reply all
Reply to author
Forward
0 new messages