Expedited Work: High-Priority Background Tasks in Android

Expedited work is for important, short tasks that must run quickly. It gets higher priority than regular background work without requiring a persistent notification. Use it for sending messages or saving notes.
Why it exists
Android aggressively manages background processing to save battery. Standard background work can be heavily delayed. Foreground services get priority but require a persistent, user-visible notification, which is intrusive for short tasks. Expedited work was created for tasks that need to run immediately but finish too quickly to justify a foreground service.
The mental model
Think of expedited work as a priority pass for a background task. Normally, your task waits in a long, slow-moving queue (regular background jobs). A foreground service lets you cut to the front of the line, but you have to wear a big, flashing sign (the notification). Expedited work lets you use a special, faster queue without the sign, but there's a limited number of passes available.
How it works
Within Android's WorkManager library, you create a WorkRequest and designate it as expedited by calling .setExpedited(). The system then attempts to run the job as soon as its constraints are met, without the delays typical of standard background work. To achieve this, WorkManager may manage a short-lived foreground service on your behalf, but this is an implementation detail you don't manage. The system grants each app a limited time quota to run these jobs.
When to use it
Use expedited work for user-initiated tasks that are short (a few minutes at most), cannot be deferred, and should complete even if the user leaves the app. Good examples include: sending a chat message the user just typed, processing a quick payment, or saving a newly created note to a remote database.
When not to use it
Do not use it for tasks that can be deferred, like syncing data periodically or pre-fetching content. It is also unsuitable for long-running processes like downloading large files or transcoding media; use a full foreground service for those. If a task must run at an exact time, use AlarmManager instead.
One canonical example
A user in a messaging app hits "send" on a message. The app schedules an expedited OneTimeWorkRequest to upload the content. The user can navigate away, and the work will still execute promptly in the background. If the system's expedited work quota is exhausted, the upload will still happen, but it will be demoted and run as a regular, lower-priority background job.
Interview question
Which scenario best justifies using Android's expedited work over other background processing options?
- a.Performing a large file download that might take 30 minutes to complete.
- b.Ensuring a user's recently typed chat message is sent promptly after they hit send.Correct
- c.Triggering a notification at a specific time next week to remind the user of an appointment.
- d.Regularly updating an app's content cache in the background every few hours.
Why? this is the answer
Expedited work is ideal for short, urgent, user-initiated tasks that must complete quickly without requiring a persistent notification. Sending a chat message fits these criteria, unlike deferrable cache updates, long-running downloads, or precise time-based alarms.
Just read this? Test yourself on what you have been reading.
Read the original → developer.android.com
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on android — each one lists the topics its interview covers.
See open roles