Background Work in Android: Strategies and Best Practices
summary
Covers concrete rules and APIs: Services, Bound services, foreground service must call startForeground within 5s, short services must finish in 3 minutes, broadcast receivers must return within 10s. Recommends WorkManager for deferred work but notes its limits — minimum 15 minutes for periodic tasks, quota types (daily execution time, rate limits, and 5 concurrent per app), and standby buckets; shows patterns (music player: foreground+bound, location sharing: foreground with fused API), testing via ADB standby bucket and using expedited or foreground integration when needed.
AI-written summary · about
chapters (10)
- 0:00Background work in Android
- 1:07Background work APIs
- 3:21Android Service component
- 6:20Bound Service IPC
- 10:40Foreground Service types
- 17:27Alternatives to Foreground Service
- 19:35WorkManager for battery tasks
- 23:08WorkManager quotas and buckets
- 26:42Choosing the right API
- 31:23Q&A
related talks
38mGuide to Foreground Services on Android
37mA guide to using foreground services and background work in Android 14
11mEffective background tasks on Android
38mGuide to Foreground Services
28mBest practices for running background work on Android
50mWTF with Android Background Restrictions
45mWorking background with WorkManager API
39mModern best practices for background task execution
