Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim GPS1 As GPS
Dim TimerService As Timer
Dim Counter As Int
Counter=0
Dim Notification1 As Notification
End Sub
Sub Service_Create
TimerService.Initialize("TimerService",600000)
TimerService.Enabled=True
End Sub
Sub Service_Start (StartingIntent As Intent)
If GPS1.IsInitialized = False Then
GPS1.Initialize("GPS")
End If
If GPS1.GPSEnabled = False Then
ToastMessageShow("Please enable the GPS device.", True)
StartActivity(GPS1.LocationSettingsIntent)
Else
GPS1.Start(0,0)
End If
End Sub
Sub TimerService_Tick
If GPS1.IsInitialized = False Then
GPS1.Initialize("GPS")
End If
If GPS1.GPSEnabled = False Then
ToastMessageShow("Please enable the GPS device.", True)
StartActivity(GPS1.LocationSettingsIntent)
Else
GPS1.Start(0,0)
End If
End Sub
Sub Service_Destroy
GPS1.Stop
End Sub
Sub GPS_LocationChanged (Location1 As Location)
Main.SQL1.ExecNonQuery2("UPDATE settings SET latitude=?,longitude=?",Array As Object(Location1.Latitude,Location1.Longitude))
End Sub