Reputation: 2002
I wish to do data polling(notifications) from service after a particular time interval(might be around 2-5mins). So I have written a service which will fetch data from the server. So what is the best way from performance point of view from below options.
Thanks all..
Upvotes: 0
Views: 606
Reputation: 2020
I think the first option is better. Start IntentService with alarm manager. IntentService will receive the Intents, launch a worker thread, and stop the service as appropriate.
See: http://developer.android.com/reference/android/app/IntentService.html
Upvotes: 1