Summary
In this chapter, we learned how to execute long-running background tasks using WorkManager
and foreground services. We discussed how to communicate progress to the user, and how to get the user back into an app once a task is finished executing. All the topics covered in this chapter are quite broad, and you could explore communicating with services, building notifications, and using the WorkManager
class further.
For most common scenarios, you now have the tools you need. Common use cases include background downloads, the background cleaning up of cached assets, playing media while the app is not running in the foreground, and, combined with the knowledge we gained from Chapter 7, Android Permissions and Google Maps, tracking the user’s location over time.
In the next chapter, we will look into making our apps more robust and maintainable by writing unit and integration tests. This is particularly helpful when the code you write runs in the background, and it...