AsyncTask is one of the easiest ways to implement parallelism in Android without having to deal with more complex methods like Threads. Though it offers a basic level of parallelism with the UI thread, it should not be used for longer operations (of, say, not more than 2 seconds).
AsyncTask has four methods
- onPreExecute()
- doInBackground()
- onProgressUpdate()
- onPostExecute()
where doInBackground() is the most important as it is where background computations are performed.