GPS Status Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
LeonardoPlacanica
Posts: 2
Joined: Fri Oct 28, 2016 2:46 pm

GPS Status Android

Post by LeonardoPlacanica » Fri Oct 28, 2016 3:48 pm

Guys can you tell me the better way to check the status of GPS for an android application? I want to make a control to check if it is turned off or on.
Im debugging from an Galaxy S4 mini with Android 4.4.2, thank you.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: GPS Status Android

Post by MaxV » Mon Oct 31, 2016 6:04 pm

Maybe this:

Code: Select all

if mobileSensorAvailable("location") is "true" then 
  answer "GPS is ON!!!"
end if
See http://livecode.wikia.com/wiki/MobileSensorAvailable
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

LeonardoPlacanica
Posts: 2
Joined: Fri Oct 28, 2016 2:46 pm

Re: GPS Status Android

Post by LeonardoPlacanica » Tue Nov 01, 2016 2:06 pm

This function return me true every time (GPS on and even with GPS off), I think that this function return true if the GPS is physically available in the device not if it's on or off.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: GPS Status Android

Post by MaxV » Wed Nov 02, 2016 9:52 am

Try with: mobileCanTrackLocation(), see http://livecode.wikia.com/wiki/MobileCanTrackLocation
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Android Deployment”