Performing background operations
We made use of RxAndroid extensively in the process of developing the Messenger application to perform asynchronous operations. In many cases, when using RxAndroid, we observed the outcome of background operations on the main thread of the Android application. In some cases, you may not want to use a third-party library, such as RxAndroid, to do this. Instead, you may want to use a solution bundled in the Android application framework. Android provides a number of options to achieve this goal. One such option is AsyncTask.
AsyncTask
The AsyncTask
class enables the performance of background operations and the publishing of operation results on the application UI thread without the burden of managing handlers and threads. AsyncTask
is best used in situations where short operations need to be run. The computations of an AsyncTask
run on a background thread and their results are published to the UI thread. You can find out more about AsyncTask
here: https://developer...