#Region Service Attributes
#StartAtBoot: True
#End Region
Sub Process_Globals
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
Log(StartingIntent.Action)
Dim p As Period
p.Days = 1
StartServiceAt(Me, Min(NextTimeInstance(15, 31), NextTimeInstance(15, 34)) ,True)
Dim tomorrow As Long = DateUtils.AddPeriod(DateTime.Now, p)
Dim wed As Int = 4
Dim fri As Int = 6
Dim today As Int = DateTime.GetDayOfWeek(DateTime.Now)
If today <> wed AND today <> fri Then
Else
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.SetInfo("Title", "Message", Main)
n.Notify(1)
End If
End Sub
Sub NextTimeInstance (hours2 As Int, minutes2 As Int) As Long
Dim today As Long = DateTime.Now
today = DateUtils.SetDateAndTime(DateTime.GetYear(today), DateTime.GetMonth(today), _
DateTime.GetDayOfMonth(today), hours2, minutes2, 0)
If today < DateTime.Now Then
Dim p As Period
p.Days = 1
Dim tomorrow As Long = DateUtils.AddPeriod(today, p)
Return tomorrow
Else
Return today
End If
End Sub