I want to load data from server, from my android application, I want to know that which will be best to load data from server, Thread or AsyncTask. Thanks
Asked
Active
Viewed 83 times
-1
-
1AsyncTaskLoader is made for this purpose but I strongly suggest you to use Retrofit2 library – dgngulcan Mar 22 '17 at 07:26
1 Answers
0
AsyncTask is better.
For better understanding You should have to know the use of both:
AsyncTask:
- Simple network operations which do not require downloading a lot of data
- Disk-bound tasks that might take more than a few milliseconds
Threads
- 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
And here is the ref. of my answer and some other useful links:

Community
- 1
- 1