Introduction
You have now learned the basics of Android app development and implemented features such as RecyclerViews, notifications, fetching data from web services, and services. You've also gained skills in the best practices for testing and persisting data. In the previous chapter, you learned about dependency injection. Now, you will be learning about background operations and data manipulation.
Some Android applications work on their own. However, most apps would need a backend server to retrieve or process data. These operations may take a while, depending on the internet connection, device settings, and server specifications. If long-running operations are run in the main UI thread, the application will be blocked until the tasks are completed. The application might become unresponsive and might prompt the user to close it and stop using it.
To avoid this, tasks that can take an indefinite amount of time must be run asynchronously. An asynchronous task means it...