AI agent skill · by @HoangNguyen0403
Android Background Work
Implement WorkManager and background processing correctly on Android. Use when creating Worker classes, scheduling tasks, choosing between WorkManager and Foreground Services, or setting up Hilt in workers; defer FCM and notification delivery to android-notifications.
Archived 2026-10-23 · Source updated 2026-09-15 · License: MIT. Check the original repository for the latest version.
SKILL.md instructions
# Android Background Work Standards ## **Priority: P1 (HIGH)** ## Implementation Guidelines ### WorkManager - **CoroutineWorker**: Use for all background tasks. - **Constraints**: explicit (Require Network, Charging). - **Hilt**: Use `@HiltWorker` for DI integration. Inject dependencies via `@AssistedInject` constructor; bind with `HiltWorkerFactory` in `WorkManager` configuration. ### Foreground Services - **Only When Necessary**: Use generating visible notifications only for tasks user actively aware of (Playback, Calls, Active Navigation). Otherwise use WorkManager. ## Anti-Patterns - **No IntentService**: Deprecated. Use WorkManager for all background tasks. - **No Short Background Jobs**: Use Coroutines in ViewModel scope instead. ## References - [Worker Template](references/implementation.md)