Services, WorkManager, and Notifications
This chapter will introduce you to the concepts of managing long-running tasks in the background of an app. By the end of this chapter, you will be able to trigger a background task, create a notification for the user when a background task is complete, and launch an application from a notification. This chapter will give you a solid understanding of how to manage background tasks and keep the user informed about the progress of these tasks.
In the previous chapter, we learned how to request permissions from the user and use Google’s Maps API. With that knowledge, we obtained the user’s location and allowed them to deploy an agent on a local map. In this chapter, we will learn how to track a long-running process and report its progress to the user.
We will build an example app where we will assume that Secret Cat Agents (SCAs) get deployed in a record time of 15 seconds. When a cat successfully deploys, we will notify the...