Home:ALL Converter>Service can do ,but Asynctask can not?

Service can do ,but Asynctask can not?

Ask Time:2014-01-02T17:07:08         Author:Vibhor Bhardwaj

Json Formatter

I have read about difference between Service,Intent Service & Asynctask ,but I have not figured out any situation where only service works but Asynctask fails.

I have noticed some points:

  1. Asynctask can be used as bound or started service.

  2. Asynctask can run in background,if user switch to different application then too Asynctack will work.

  3. Asynctask can send message to our activity.

  4. If a component which starts asynctask is destroyed then too asynctask executes in background and we can use its onPostexecute() method to start another application component.

So Please tell me some functionalities for which we have to use Service, we cann't implement those with Asynctask.

Author:Vibhor Bhardwaj,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/20879539/service-can-do-but-asynctask-can-not
Adhikari Bishwash :

When your app is destroyed automatically due to low memory or users throws from task manager your async task is also destroyed, but in this same case service will not be destroyed.",