I use this code - based in this snippet from Erel - to start a service 3 times on day.
Now my doubts:
1 - There is no StartReceiverAtExact. The new code - based in the StartReceiverAt - would it look like this?
2 - There is no similar code to this lines? I can remove it?
3 - Do I still need this permission in the manifest?
Thanks in advance.
B4X:
Sub Service_Start (StartingIntent As Intent)
Dim t As Long
t = FindNextTime(Array As Double(8, 12+20/60, 18+40/60))
StartServiceAtExact(Me,t,True)
StopService(Me)
Service.StopAutomaticForeground
End Sub
1 - There is no StartReceiverAtExact. The new code - based in the StartReceiverAt - would it look like this?
B4X:
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
Dim t As Long
t = FindNextTime(Array As Double(8, 12+20/60, 18+40/60))
StartReceiverAt(Me,t,True)
End Sub
2 - There is no similar code to this lines? I can remove it?
B4X:
StopService(Me)
Service.StopAutomaticForeground
3 - Do I still need this permission in the manifest?
B4X:
AddPermission(android.permission.SCHEDULE_EXACT_ALARM)
Thanks in advance.