Sub Service_Create
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER 'we are handling it ourselves
tmrTrip.Initialize("tmrTrip", 500) 'every 500 milliseconds
tmrTripSaveData.Initialize("tmrTripSaveData", 60000) '1 minutes
GPS1.Initialize("GPS")
PhoneEvent.Initialize("PhoneEvents")
StateManager.LoadStateTrip 'load these
StateManager.LoadStateMaintenance 'load these at first startup
StateManager.LoadStateSpeedLimiter 'load speed limiter value
CheckPreferenceState
Starter.pws.PartialLock 'Important so it will not CPU Sleep
TripIcon1 = LoadBitmapResize(File.DirAssets, "tripicon.png", 24dip, 24dip, True)
TripIcon2 = LoadBitmapResize(File.DirAssets, "mainicon.png", 24dip, 24dip, True)
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt(Me, DateTime.Now + 30 * DateTime.TicksPerMinute, True) '30 minutes
If StateManager.blnUseGPS = True Then
Log("Timer and Notification turned on in START..")
Service.StartForeground(1, CreateNotification("..."))
CallCreateNotification("...", "")
TurnOnTmrTrip
End If
'not used. used for tracking buttons in notification
' If StartingIntent.IsInitialized Then
' Log(StartingIntent.Action)
' End If
End Sub