From the course: Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines
Unlock this course with a free trial
Join today to access over 22,700 courses taught by industry experts.
Manage deferrable tasks with WorkManager
From the course: Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines
Manage deferrable tasks with WorkManager
- [Narrator] Android's WorkManager architecture is designed to handle deferrable, long-running tasks. When you set up a task, it's guaranteed to run whenever the constraints you defined are satisfied. So for example you could say, "Only do this work "when the network is available." Or, "Only do this when the device isn't dozing." If a task is interrupted for any reason, the WorkMangager process can try the task again. WorkManager can be used back to API 14, or Android 4. On recent versions of Android, a WorkManager task is executed through the JobScheduler API, and on older versions it runs with a combination of BroadcastReceiver and AlarmManager. But you don't need to learn those other APIs to use WorkManager. You define what you want WorkManager to do and then it will decide how to get it done. To use WorkManager, you'll need to add some new information to your Gradle build file. First you'll need a new dependency. I'll…
Contents
-
-
-
-
-
-
(Locked)
Run background tasks with IntentService5m 22s
-
(Locked)
Upgrade IntentService to JobIntentService4m 37s
-
(Locked)
Send results from JobIntentService to the UI7m 25s
-
(Locked)
Manage deferrable tasks with WorkManager5m 35s
-
(Locked)
Set work request constraints3m 9s
-
(Locked)
Get results from a background worker4m 56s
-
(Locked)
Send progress updates from a background worker5m 2s
-
(Locked)
-
-