Waypoint
Waypoint

Reputation: 17753

Android - timer in service

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

Answers (1)

EboMike
EboMike

Reputation: 77732

  1. Doing something every 30 minutes would be done using the AlarmManager.

  2. Waking the device up every 30 minutes is bad for battery life. Don't do it.

  3. On Android 2.2+, you could consider using a network tickle if you really need to know about updates right away.

  4. 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

Related Questions