mobileSensorAvailable accuracy on Android

andrew at andrew at
Wed May 2 02:01:47 EDT 2018

I'm getting false positives when using  
mobileSensorAvailable("location") with Location Services disabled on  
my device. iOS is able to determine Location Services is disabled and  
notify user (via a short script), but the same code in my Android  
build is telling me the sensor is available. I thought maybe this was  
a LC9 thing, but compiling with LC8 demonstrated the same behavior.

I'm using this to calculate distance to various locations from the  
device, but since I didn't have a fail check written to make sure the  
coordinates returned are not empty (since I'm already checking for the  
sensor to be available) the values returned are bogus and seem to be  
based off a starting lat/log of 0,0 which is in the Atlantic Ocean.

Even using the provided lesson and demo stack, LiveCode would tell me  
the location sensor was available with WiFi & Location turned off in  
Android settings but never be able to give me coordinates (the Get  
Current Reading button of the demo just logs "Current Reading" rather  
than actual details).

--Andrew Bell

More information about the use-livecode mailing list