Sub Activity_Resume
StartGPS
End Sub
Sub Activity_Pause (UserClosed As Boolean)
GPS1.Stop
End Sub
Sub GPS_GpsStatus (Satellites As List)
Dim st As Int
Dim Status As String
st=0
For i = 0 To Satellites.Size - 1
Dim Satellite As GPSSatellite
Satellite = Satellites.Get(i)
If Satellite.UsedInFix=True Then st=st+1
If st>0 Then
Status=st
Else
Status="Lost GPS!"
End If
Next
If st>2 Then Return
ToastMessageShow(Status,True)
Sub StartGPS
Try
If GPS1.GPSEnabled = False Then
ToastMessageShow("Please enable the GPS device.", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
Else
GPS1.Start(0, 0) 'Listen to GPS with no filters.
End If
Catch
End Try
'sTART ANYWAY FOR TESTING
GPS1.Start(0, 0) 'Listen to GPS with no filters.
End Sub
Sub GPS_LocationChanged (Location1 As Location)
MyLatitude = NumberFormat(Location1.Latitude,3,4)
MyLongitude = NumberFormat(Location1.Longitude,3,4)
lblLocation.Text=MyLatitude
lblLocation2.Text=MyLongitude
Counter=Counter+1
lblCounter.Text =Counter
End Sub