My first APP that you can see here:
https://play.google.com/store/apps/details?id=com.bgsoft.easyschedule
and that is now obsolete, it functions as an alarm, and I have no need to call a timer or a service every minute.Like I said, I calculate the alarm time next, divide the time in half, and call
StartServiceAt, Android sometimes I kill the service but reruns, and it is as simple as reading the file alarms and recalculating the next call to
StartServiceAt
Read my tutorial service modules, there extensively explain the problems I had with Android kill the service, but with what I said my program works and this four years ago.
This is not a CODE Question.. this is a STRATEGIC Question..
The answers to this questions, may help to a lot of users.
You know the Spanish Forum am among those who most help, but one thing is to help and make other analysis work someone, that has to do the programmer / analyst (ie, you
)
However I will give sequence to follow, or rather, I would, but without going into much detail.
The sequence is easy:
1) I enter the APP and add one or n alarms
2) Save to file alarms
3) When I go check if there are alarms
4) If no alarms, I do nothing
5) If there are alarms, launch the "Alarms" service
6) Enters Service Alarm
7) Read the file alarms
8) If there are no alarms (if reboot) kills service
9) If there is alarm, which is calculated by the nearest
10) If the alarm time, call activity that alarm
11) If you are not in alarm time, divided by two then and call
StartServiceAt
By dividing by two you make sure that if you kill Service, to re-enter you can make the alarm. When you leave a few minutes you do not need to divide. If there is an alarm, the
StartServiceAt will re-enter the service, and you will go to point 6)
Regards