JobScheduler
Also known as: job scheduler android, scheduled jobs, android jobscheduler, android.app.job.JobScheduler
JobScheduler is the Android system service for scheduling deferrable background jobs that run under conditions like charging, idle, or unmetered network, batching work across apps to save battery instead of running immediately.
- Added in Android 5.0 (API 21) via android.app.job.JobScheduler.
- Runs jobs under constraints like charging, idle, or unmetered network and batches them to save battery.
- WorkManager is the recommended wrapper and uses JobScheduler internally on modern Android.
How it works
Introduced in Android 5.0 (API 21), android.app.job.JobScheduler lets an app describe work as a JobInfo with constraints — for example require charging, device idle, or an unmetered network — and a JobService that does the work. The system then decides *when* to run it, coalescing jobs from many apps into shared wake windows so the device sleeps more and wastes less battery.
Jobs can be one-shot or periodic, can require minimum/maximum latency, and survive reboots if marked persistent. The system enforces backoff on failure and applies its own throttling, so a job's exact start time is never guaranteed — it is deferred until the constraints are met and the scheduler picks a good moment.
Relationship to WorkManager
Most apps no longer call JobScheduler directly. WorkManager, the recommended Jetpack library, uses JobScheduler under the hood on modern devices and falls back to other mechanisms on older ones, while adding chaining, observable status, and easier testing.
Background execution is further constrained by App Standby Buckets and Doze mode: a job for a rarely used app may be delayed for hours. This is why deferrable maintenance — indexing, sync, or a heavy storage scan — should be scheduled rather than forced to run in the foreground.