Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

WM21 - GPSStatus vs Location (no replies)

$
0
0
Hi Everyone,

I need to check if Location has been enabled on both android and ios devices before opening a window. The window will track the device's location every 5 minutes whether the device has moved or not so I want to be sure I'm getting gps coordinates. I run the following code but GPSStatus always returns 1 (GPSEnabled) no matter if Location is on or off so I have resorted to checking the longitude. Is there a way to check the status of Location? I've run this on both my android tablet and phone.

GPSInitParameter(gpsAuto,gpsPrecisionHigh+gpsEnergyLow)

Info(GPSStatus())

IF GPSStatus() = gpsEnabled OR GPSStatus() = gpsAvailable THEN
myGPS = GPSGetPosition(500,"Getting GPS Position")

IF myGPS..Longitude <> 0 THEN
OpenMobileWindow(WIN_Shift, Clients.ClientID)
ELSE
Info("Unable to get GPS position. Verify Location is enabled.")
END
ELSE
Info("Location must be enabled")
END

Thanks, Bill

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>