Reputation: 143
To use WorkManager you have to subclass one of the available Worker classes:
I want to run the job every 2 hours. Some of the answers mentioned should be use Listenable Worker. I am confusing this which one suits to this scenario. Please help me on this.
Upvotes: 0
Views: 403
Reputation: 6476
WorkManager has some extensive documentation on how to use it that also includes a migration guide covering the move from Firebase JobDispatcher.
In the documentation you can find a section that explain the different threading behaviour of the different Worker classes.
In your particular case, it really depends if what you want to execute periodically is synchronous or not.
Worker
CoroutineWorker
if you're using Kotlin, otherwise you've to use a ListenableWorker
.Upvotes: 1