Background work
Performing background work is a critical part of building modern Android apps that are responsive, efficient, and good citizens on the user's device. Background work encompasses any task your app needs to perform when it is not visible in the foreground, such as fetching data from a server or processing images.
Navigating the complexities of background execution is key to building resilient applications that work well on all devices.
Get started with Background Work
Choose the right option
Process and app lifecycle
Key concepts
WorkManager
Foreground Services
Alarms
Broadcasts
Background Guidance by Use Case
The right solution varies by your use case. Android provides many task-specific APIs, which are optimized for particular scenarios, and will often lead to greater power savings and fewer restrictions than when using WorkManager and Foreground Services.
This section lists some of the more common use cases, and the recommended solution.
Location
Widgets
Bluetooth and Connected Devices
Step Tracking
User-Initiated Data Transfer
Media Playback
Understand power optimizations
Understand Power Management Resource Limits
The system prioritizes apps' requests for resources based on the device state, app state and the app's standby bucket.
Learn more about how your app can work within the device's power management resource limits to reliably execute work in the background.