Reputation: 1740
I have requirements where jobs are required to be done in background.I read about the best practices for background jobs at Android website.
Here its written
the Android framework offers several classes that help you off-load operations onto a separate thread running in the background. The most useful of these is IntentService.
I also came across something named as AsyncTask where they mentioned
This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.
I was not able to decide which one should I use.Also I may have to consider the fact that android eventually kill apps when it wants to reclaim memory.
Now I am left with the questions :-
Please help me with it..
Upvotes: 2
Views: 168
Reputation: 832
AsyncTask is best because it is run any task on background asynchronous and when task is running condition call defferent method which is doBackground when task is complete call onPostExicute so in case of memory Asynktask is better.
Upvotes: 0