Please test code
Hi again. I have tested the code below (GPS example)
on my Galaxy Tab v2.2.1 and my xoom v3.0.1 outside
and inside my office with the same results.
GPS1.Start(5000,100) --- only one location update (BAD)
GPS1.Start(0,0) --- updates about every second
Please test code! Maybe I am missing something ?!
Help, Jerry
Sub Process_Globals
Dim GPS1 As GPS
End Sub
Sub Globals
Dim lblLon As Label
Dim lblLat As Label
Dim lblSpeed As Label
Dim lblSatellites As Label
Dim num As Int ' *** Added
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
GPS1.Initialize("GPS")
num = 0 ' *** Added
End If
Activity.LoadLayout("1")
End Sub
Sub Activity_Resume
If GPS1.GPSEnabled = False Then
ToastMessageShow("Please enable the GPS device.", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
Else
GPS1.Start(5000, 100) ' *** Changed - produces only one update over several mins
'GPS1.Start(0, 0) ' *** Changed - produces an update about every 1sec
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
GPS1.Stop
End Sub
Sub GPS_LocationChanged (Location1 As Location)
lblLat.Text = "Lat = " & Location1.ConvertToMinutes(Location1.Latitude)
lblLon.Text = "Lon = " & Location1.ConvertToMinutes(Location1.Longitude)
num = num + 1 ' *** Added
lblSpeed.Text = "Changes = " & num ' *** Changed
Log("GPS_LocationChanged")
End Sub
Sub GPS_UserEnabled (Enabled As Boolean)
ToastMessageShow("GPS device enabled = " & Enabled, True)
End Sub
Sub GPS_GpsStatus (Satellites As List)
lblSatellites.Text = "Satellites:" & CRLF
For i = 0 To Satellites.Size - 1
Dim Satellite As GPSSatellite
Satellite = Satellites.Get(i)
lblSatellites.Text = lblSatellites.Text & CRLF & Satellite.Prn & _
" " & Satellite.Snr & " " & Satellite.UsedInFix & " " & Satellite.Azimuth _
& " " & Satellite.Elevation
Next
End Sub