Guide to Foreground Services
summary
Android 14 requires a mandatory foreground service type declared in the manifest and passed to startForeground or setForeground, or the app gets security or invalid type exceptions; startForeground must run within 10 seconds or the system throws a did not start in time error. Short service type limits runs to about 3 minutes, Android 15 adds media processing with a 6 hour per 24h limit, and Play Store updates must include a Play Console declaration with justification and a demo video.
AI-written summary · about
chapters (25)
- 0:00Introduction
- 0:46What is a foreground service
- 2:08When to choose it
- 4:17Evolution of restrictions
- 5:41Foreground service types
- 7:07Declare types in manifest
- 8:10Play Console requirements
- 9:34Location foreground service
- 10:14Connected device service
- 11:19Data sync alternatives
- 12:23Media processing service
- 13:06Special service types
- 14:56Notification rules
- 16:21Create manually
- 19:07Starting a foreground service with startForeground
- 21:11Common errors
- 23:16Runtime permissions
- 24:39Stopping the service
- 25:43WorkManager for long tasks
- 26:49Long-running worker setup
- 29:23WorkManager considerations
- 31:29Background restrictions
- 34:24Android 14 changes
- 35:49Recommendations
- 36:12Demo and sample
related talks
38mGuide to Foreground Services on Android
37mA guide to using foreground services and background work in Android 14
36mBackground Work in Android: Strategies and Best Practices
11mEffective background tasks on Android
37mOperating Notes with a Foreground Service: How a Hiking App Faced Constraints
32mBuilding for Android Oreo
28mBest practices for running background work on Android
42mBuilding for Android O
