Skip to content Skip to sidebar Skip to footer

Timer Vs Thread Sleep In Services

I need to check every 15 minutes a feed RSS file in order to update my application's results; I know I have to implement a service, but I was wondering which approach I should use

Solution 1:

You should use a PendingIntent and register it with the AlarmManager to be started 15 minutes in the future. This way your app won't use any ressources until the alarm fires.

You need to use the Intent that starts your Service to create the PendingIntent. After your service finished you need to reregister the PendingIntent for the next execution of your service.

Post a Comment for "Timer Vs Thread Sleep In Services"