#Region Service Attributes
#StartAtBoot: False
#StartCommandReturnValue: android.app.Service.START_STICKY
#End Region
Sub Process_Globals
Dim TimerService As Timer
Dim Noti1 As Notification
Dim ts As Long ' TimeStarted
Dim te As Long ' TimeElapsed
Dim tp As Period' TimePeriod
End Sub
Sub Service_Create
ts = DateTime.Now
TimerService.Initialize("TimerService",200)
TimerService.Enabled=True
Noti1.Initialize
Noti1.Icon = "icon" 'use the application icon file for the notification
Noti1.Vibrate = False
Noti1.Sound = False
Noti1.Light=False
Noti1.SetInfo("Service Example", "Counter", Main)
Service.StartForeground(1, Noti1)
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_Destroy
Service.StopForeground(1)
ToastMessageShow("Service Stopped!", False)
End Sub
Sub TimerService_Tick
te = DateTime.Now
tp = PeriodBetweenWithMilliseconds(ts, te)
End Sub
Sub PeriodBetweenWithMilliseconds(time1 As Long, time2 As Long) As Period
Dim p As Period = DateUtils.PeriodBetween(time1, time2)
Return p
End Sub