#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim x=0 As Int
Dim n As Notification
End Sub
Sub Service_Create
n.Initialize
n.Icon = "icon"
n.Light = True
n.AutoCancel = True
End Sub
Sub Service_Start (StartingIntent As Intent)
x=x+1
n.SetInfo("X = " & x , "Click here to close notification", "BTAsyncStream")
n.Notify(1)
If x = 10 Then
StopService("")
End If
StartServiceAt("",DateTime.Now + 10 * 1000, True)
End Sub
Sub Service_Destroy
n.SetInfo("Service has ended.", "Click here to cancel", "BTAsyncStream")
n.Notify(1)
End Sub