AsyncTask helps us to do some heavy stuff on the thread other than UI. It allows us to do background operations and then publish to UI.
It must be subclassed and goes like this(for example):
AsyncTask<Parameters, Progress, Result>
And it has 4 steps: onPreExecute, doInBackground, onProgressUpdate, onPostExecute.
doinBackground implementation:
public resultType doInBackground(ParamType... params) { .. }
onPostExecute:
public void onPostExecute(ResultType result) { .. }
onProgressUpdate:
public void onProgressUpdate(Progress... progress)
And to execute our AsyncTask class, we should do it like this:
new SomeAsyncTask().execute(parameters);