Implementing migration from Firebase JobDispatcher to the new recommended WorkManager
In the Understanding the Jetpack WorkManager library recipe, we talked about other libraries that are used for scheduling and executing deferrable background work. Firebase JobDispatcher
is one of the popular ones. If you have used Firebase JobDispatcher
, you might know it uses the JobService()
subclass as its entry point. In this recipe, we will look at how you can migrate to the newly recommended WorkManager
.
Getting ready
We will be looking at how we can migrate from JobService
to WorkerManager
. This might apply to your project or not. It is essential to cover it, though, due to the fact that WorkManager
is highly recommended, and we all have some legacy code. However, if your project is new, you can skip this recipe.
How to do it…
To migrate your Firebase JobDispatcher
to WorkManager
, follow these steps:
- First, you will need to add the required dependency; for this,...