Hello.
I am not claiming that it is a bug yet, because I only checked it on one device (AT&T-Samsung Infuse)
When retrieving the Speed from GPS_LocationChanged event it is reporting integer value instead of Float.
Documentation says it is reported as Float and UOM is m/s so to get km/h you need to multiply it by 3.6 and to get mph you need to multiply it by 2.2369.
I have noticed that speed was reported with big increments so I passed the speed variable directly to a label without any math and took it for a ride.
The label reported no decimal places just integer values in m/s
Without the fractions of m/s in the speed parameter, the resulting precision will be poor, (like 3.6km/h resolution) and not acceptable. Could someone check this to see if there is a library error or is it just my device I am testing on.
Here is an experimental version of my code:
Sub GPS_LocationChanged (Location1 As Location)
Dim spd As Float
Log("Location event")
If Location1.SpeedValid = True Then
If MPH = True Then
'1mph = 1.609344kph
spd = Location1.Speed * 2.2369
Label1.Text = Location1.Speed & "m/s"
Label2.Text = spd & "mph"
Else
spd = Location1.Speed * 3.6
Label1.Text = Location1.Speed & "m/s"
Label2.Text = spd & "km/h"
End If
Else
Label1.Text = "---"
End If
End Sub
Thank you.