Reputation: 17753
I am implementing service which will check web each 30 minutes and if there is new version of a program it will prompt download and install. My question is, how to determine in method onStart that I want to check some web location each 30 minutes from now?
Thx
Upvotes: 0
Views: 660
Reputation: 77732
Doing something every 30 minutes would be done using the AlarmManager.
Waking the device up every 30 minutes is bad for battery life. Don't do it.
On Android 2.2+, you could consider using a network tickle if you really need to know about updates right away.
It will prompt and install? While the device is powered down? So at 3am in the morning, the app will wake up and tell me that there's an update ready for me? Why don't you just check for updates when the app is started?
Upvotes: 1