what is the best for working with java web service and Android client between thread and asynctask ?
Asked
Active
Viewed 65 times
-3
-
Also it's depend on your requirement . – M D Apr 15 '15 at 12:53
-
Original post you can get here http://stackoverflow.com/questions/18480206/asynctask-vs-thread-in-android – Shekhar Mangrule Apr 15 '15 at 14:01
1 Answers
1
Use AsyncTask for:
Simple network operations which do not require downloading a lot of data
Disk-bound tasks that might take more than a few milliseconds
Use Java threads for:
Network operations which involve moderate to large amounts of data (either uploading or downloading)
High-CPU tasks which need to be run in the background
Any task where you want to control the CPU usage relative to the GUI thread
For Thread
synchronization with the main thread if you post back results to the user interface No default for canceling the thread No default thread pooling No default for handling configuration changes in Android

Ameer
- 2,709
- 1
- 28
- 44