Theme v / s Async Task

Possible duplicate:
Difference Between Service, Async Task and Thread?

I upload about 600 images. I want this task to run in the background, which method is the best way for her. Asynchronous or thread? Can someone tell me?

+6
source share
3 answers

Do you plan post-processing after uploading images? If you create a background thread and your main thread ends before the background threads are completed, the threads will be interrupted in the Bridge of Programming Languages. It doesn’t matter which method you choose if you create a barrier preventing your programming from exiting until all of your images have been loaded. I would run background threads from a thread.

0
source

AsyncTask. Just use it and you will understand why it is better than threads ... Threading just introduces another level of complexity. The goal is to reduce complexity.

ETA: if possible, enable as much as possible with the APK ... 600 images is a ton for poor 3G and his / her funny calls such as speeds.

0
source

Here's an article comparing various task execution mechanisms in Android.

0
source

Source: https://habr.com/ru/post/885784/


All Articles