How to poll a webservice at finite interval from android?

soumitra chatterjee picture soumitra chatterjee · Feb 10, 2012 · Viewed 12.6k times · Source

i am developing an android app to show notifications.How can i poll a webservice at finite interval (say 10 min interval) to check for any update and show as notification in android notification panel.

Answer

Graham Smith picture Graham Smith · Feb 10, 2012

You do not need a service. I feel like a broken record. In this use case a service will sit there for 95% of the time doing nothing but still using system resources and more importantly drain the battery.

Please see my answer on a similar question that uses an Alarm from the AlarmManager:

Running task periodicaly(once a day/once a week)

Edit:

Look at this tutorial from the Android Development site for how to implement notifications: http://developer.android.com/guide/topics/ui/notifiers/notifications.html