Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim beep As Beeper
Dim nSer As Notification
Dim Counter As Int
End Sub
Sub Service_Create
Counter=0
nSer.Initialize
beep.Initialize(100, 1000) '100 milliseconds, 1Khz
End Sub
Sub Service_Start (StartingIntent As Intent)
'Start service evry x seconds
'StartServiceAt("", DateTime.Now + 10 * DateTime.TicksPerSecond, True)
'Service.StartForeground(1,nSer)
StartServiceAt("", DateTime.Now + 3 * DateTime.TicksPerSecond, True)
'Service notification
nSer.Icon = "icon"
nSer.Vibrate = False
nSer.Sound = False
nSer.SetInfo("MyApp","Service Running",Main)
nSer.OnGoingEvent = False
nSer.Light = True
nSer.Notify(1)
Counter=Counter+1 ' This counting will not work for long. If it is important it should be saved in a file instead of a variable.
beep.beep
End Sub
Sub Service_Destroy
nSer.Cancel(1)
End Sub