I have a list of tasks in my service, each of them contains a time on which they need to be scheduled. Some of them will be scheduled at the same time.
I am wondering if there is a foolproof way to make sure that I do not miss running any of those tasks.
For e.g. if I have 10 tasks in a list.
and on the next schedule of StartServiceAt, I need to schedule 3 of the tasks.
1) How certain is that the Service will start at the exact time (within +/- 1 min)?
I will have to do something like:
I could miss the time since the service is a bit late (due to message queue etc).
2) Secondly, what if I need to start a task WHILE the service is already doing something? So, the service is busy in downloading something, but its time for another Task to start.
I am wondering if there is a foolproof way to make sure that I do not miss running any of those tasks.
For e.g. if I have 10 tasks in a list.
and on the next schedule of StartServiceAt, I need to schedule 3 of the tasks.
1) How certain is that the Service will start at the exact time (within +/- 1 min)?
I will have to do something like:
B4X:
For i = 0 to Tasks.Size -1
if Tasks.Time = DateTime.Now then
DoTask(Task(i))
End If
Next
2) Secondly, what if I need to start a task WHILE the service is already doing something? So, the service is busy in downloading something, but its time for another Task to start.