Sub Service_Create
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER 'we are handling it ourselves
Timer_RequestOBD.Initialize ("Timer_RequestOBD", 20)
Timer_Timeout.Initialize ("Timer_Timeout", 3000)
tmrKeepAliveService.Initialize("tmrKeepAliveService", 5000)
tmrKeepAliveService.Enabled = True
Starter.pws.PartialLock
End Sub
B4X:
Sub Service_Start (StartingIntent As Intent)
' Service.StopAutomaticForeground 'Call this when the background task completes (if there is one)
Service.StartForeground(1, CreateNotification("..."))
tmrKeepAliveService_Tick
End Sub