'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim N As Notification
Dim MP As MediaPlayer
Dim DT As Int
End Sub
Sub Service_Create
n.Initialize
n.Icon = "icon"
n.Sound = False
n.Vibrate= False
n.Light=False
n.OnGoingEvent=True
n.SetInfo("Mindfulness Bell", "Bell will ring every " & Main.TextV , Main)
n.Notify(1)
MP.Initialize()
MP.Load(File.DirAssets,"bell10s.ogg")
DT = Main.DulationV
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt("",DateTime.Now+DT*DateTime.TicksPerSecond,True)
If MP.IsPlaying = True Then
MP.Stop
MP.Load(File.DirAssets,"s3.mp3")
End If
MP.Play
End Sub
Sub Service_Destroy
n.Cancel(1)
End Sub