I am working on application in which I want to start service at the particular time. I have stored the time in database table. Now, I have the list of the time when service would be started. So, how can I start service at all of these time?
Asked
Active
Viewed 717 times
2 Answers
1
You want the Android Alarm Manager:
This class provides access to the system alarm services. These allow you to schedule your application to be run at some point in the future.
Hope this link helps you.

user755278
- 1,634
- 3
- 16
- 32
-
1You should remember to reset the alarm when phone closes. Here is a stack link for an implementation: http://stackoverflow.com/a/7846622/969325 – Warpzit May 01 '12 at 07:54
-
@Warpzit Why should the OP reset the alarm? And what do you mean with "phone closes"? – THelper May 01 '12 at 08:35
-
1@THelper everytime you shut down phone/the phone crashes/restarts ALL alarms will be lost, you need to set them again. To do this you store the alarms persistent and make a broadcastreceiver on phone startup. – Warpzit May 01 '12 at 08:36
-
@Warpzit In that case you are right.... I got confused by the word "reset". Indeed the OP should write the alarms to file and restore them on startup. – THelper May 01 '12 at 08:42