#Region Module Attributes
#StartAtBoot: True
#End Region
'Service module
Sub Process_Globals
Dim Notification As Notification
Dim Timer1 As Timer
Dim limitNumberOfTicks As Int
End Sub
Sub Service_Create
If Notification.IsInitialized = False Then
Notification.Initialize
Notification.Icon = "icon"
Notification.SetInfo("Kiosk app", "Kiosk app", Main)
Notification.Sound = False
Notification.Vibrate = False
End If
Timer1.Initialize("Timer1", 10)
End Sub
Sub Service_Start (StartingIntent As Intent)
Service.StartForeground(1, Notification)
If IsPaused(Main) Then Timer1.Enabled = True
End Sub
Sub Service_Destroy
Service.StopForeground(1)
Timer1.Enabled = False
End Sub
Sub Timer1_Tick
If IsPaused(Main) Then
StartActivity(Main)
limitNumberOfTicks = limitNumberOfTicks + 1
If limitNumberOfTicks >= 10 Then Timer1.Enabled = False
Else
Timer1.Enabled = False
End If
End Sub