Asynchronous processing in the context of your question is a processing that takes a certain time to execute and (typically) at the end of this processing the graphical interface needs to be updated.
You could simply encapsulate this processing and updating the screen in a method, call this method (from the thread main, otherwise the screen update does not work) and wait for it to run. That would be synchronous processing. But because the processing is time consuming the method will take time to execute and the screen will lose responsiveness (will not respond to touch commands or update the graphical interface) because the thread will be busy running it. Ideally the thread should be restricted to update the screen and treat input (in the case of said touch commands).
For this reason you do the processing asynchronously: ask a thread separate (either by creating one directly, or indirectly through a AsyncTask
or other means) to perform this processing and continue its normal way by executing other commands.
When processing is completed thread secondary will place in the message queue of thread the main command that updates the graphical interface (whether via Handler
, or runOnUiThread()
, or a method callback of AsyncTask
like the onPostExecute()
, for example).