WinDev Mobile 18 - Android - GPS Behavior On Two Different Devices

Startbeitrag von Paul Murray am 03.06.2013 20:19

Greetings All,

I am hoping that someone can help me with a few questions.

I created an Android App that calls a web service every 2 minutes with GPS data pulled using the following code in the initialization of the 'First Project Window'.

gnTimer_number = TimerSys(COL_GlobalProcedures.GeoProcedure,12000,2)

The rest of the code is at the bottom of this post...

On MY device which is running Android version 4.1.2 everything works fine. And I always get GPS data.

When the client starts the App using Android version 4.04, we get 0,0 for lat/long.

Received Values: PASSWORD: xxxxxxxxxx LATITUDE: 0 LONGITUDE: 0 QUALITY: * SPEED: -2 BATTERY PERCENT: -1 EMEI_EMED: 99000024402968 DEVICE DATE TIME: 12/31/1969 19:00:00

When the client walks outside his building we get correct lat/long as follows:

Received Values: PASSWORD: xxxxxxxxxx LATITUDE: 40.73980841 LONGITUDE: -74.67820842 QUALITY: * SPEED: 0 BATTERY PERCENT: -1 EMEI_EMED: 99000207797885 DEVICE DATE TIME: 06/02/2013 15:48:21

The client is in his office and cannot 'see' any satelites. He has the following three options checked:

Use wireless networks - checked
Use GPS Satelites - check
Location and Google search - checked

When the client starts Google Maps it immediately shows him exactly where he is, even though my app is return 0,0.

I noticed that when I compile my App, my choices for...

'SDK used to compile this application (must be installed)' can be either Android 2.3.3 or Android 4.2. So I am compiling using 2.3.3.

So here are my questions:

1) Should I try to install an intermediate version of Android?
2) Why would the MeasurementDate return a datetime value that is sometimes 10 minutes behind the datatime that the data is delivered to my server?
3) If MeasurementDate is not to be trusted, what is the best function to obtain the current local date time of the device when the data is sent.
4) What control do I have over getting only Satelite GPS data? I ask that because sometimes my own device will give me a location that is 3 miles away from where I actually am. I want to be able to ignore lat/longs from locations from 'Use wireless networks' and 'Location and Google search'.
5) I realize that a device cannot always find its position. Is there a 'best practice' communicating uncertain data or not sending it at all so that our maps don't show devices simply dropping off the screen?

Any advice regarding GPS collection will be greatly appreciated.

Thank you,


PROCEDURE GeoProcedure()
MyPosition = GPSGetPosition()
grLatitude = MyPosition..Latitude
grLongitude = MyPosition..Longitude
// Speed
IF MyPosition..SpeedValid = True THEN
grSpeed = MyPosition..Speed
grSpeed = -1

grBatteryPercent = -1

//Get the datetime the measurement was taken
gdtGPSLocalDateTime = MyPosition..MeasurementDate

//Get the precision or quality
IF MyPosition..PrecisionValid = True THEN
grPrecision = MyPosition..Precision

sl is add_gps_data
sl.password = "xxxxxxxxxx"
sl.latitude = grLatitude
sl.longitude = grLongitude
sl.battery_percent = grBatteryPercent
sl.quality = "*"
sl.imei = gsIMEI
sl.speed = grSpeed
sl.device_date_time = gdtGPSLocalDateTime
sl.gps_app_transmitter_version = "A1.0"
rp1 is add_gps_dataResponse
rp1 = add_gps_data(sl)

//IF rp1.add_gps_dataResult "" THEN
// Info("Sorry. There was a problem Sending GPS Data in the Global Procedure GeoProcedure.")

gsStatus_type = ""


Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.