0Pricing
Android Academy · Lesson

Periodic and Chained Work

Repeat and sequence background tasks.

Periodic and Chained Work

Beyond one-shot tasks, WorkManager can repeat work on a schedule and chain multiple workers so they run in sequence. This lesson covers both.

PeriodicWorkRequest

For recurring work, use PeriodicWorkRequestBuilder, specifying a repeat interval. WorkManager re-runs the worker once per interval.

val periodic = PeriodicWorkRequestBuilder<SyncWorker>(
    repeatInterval = 1,
    repeatIntervalTimeUnit = TimeUnit.HOURS
).build()

All lessons in this course

  1. When to Use WorkManager
  2. Creating a Worker
  3. Constraints and Scheduling
  4. Periodic and Chained Work
← Back to Android Academy