#Region Service Attributes
#StartAtBoot: true
#End Region
Sub Service_Create
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER 'we are handling it ourselves
lock.PartialLock
End Sub
Sub Service_Start (StartingIntent As Intent)
Service.StartForeground(nid, CreateNotification("Tapping this notification will open the app."))
StartServiceAt(Me, DateTime.Now + 30 * DateTime.TicksPerMinute, True)
If B4XPages.IsInitialized = False Then
'Code to start B4XPages goes here'
End If
InitializeWhatsNeeded
End Sub