Sub Service_Create
If GPS1.IsInitialized = False Then GPS1.Initialize("GPS")
If Timer2.IsInitialized = False Then Timer2.Initialize ("Timer2", 120000) '2 perc (mp-ben)
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt ("", DateTime.Now + 300 * 1000, True)
GPS1.Start(0,0)
Timer2.Enabled = True
End Sub
Sub GPS_LocationChanged (Location1 As Location)
GPS1.stop
latitude = Location1.latitude
longitude = Location1.longitude
ToastMessageShow(latitude & " " & longitude,True)
Timer2.Enabled = False
End Sub
Sub Timer2_Tick
Timer2.Enabled = False
GPS1.Stop
ToastMessageShow("No GPS",True)
End Sub