To download a large file, which is a better approach to use either AsyncTask or Thread?

Disclaimer: i am not Android developer, answer comes from general experience.

Thread class is most suitable for long-running activities, not for asynchronous tasks. Except if you manage pool of workers, but still lifetime of thread is same or nearly same as application. Consider that creation of thread is expensive operation.

AsyncTasks and other helpers are usually for some single activities that you want to do in background so not to block the app. They are usually well managed by the platform and are cheap.

My opinion: use AsyncTask if you want to load pages occasionally. If your app will load pages all the time in the background consider thread.

Tags:

Android