Agent Skills: Android Background Work Standards

Implement WorkManager and Background Processing correctly on Android. Use when creating Worker classes, scheduling tasks with WorkManager, choosing between WorkManager and Foreground Services, or setting up Hilt in workers. (triggers: **/*Worker.kt, CoroutineWorker, WorkManager, doWork, PeriodicWorkRequest, OneTimeWorkRequest, @HiltWorker)

UncategorizedID: hoangnguyen0403/agent-skills-standard/android-background-work

Install this agent skill to your local

pnpm dlx add-skill https://github.com/HoangNguyen0403/agent-skills-standard/tree/HEAD/skills/android/android-background-work

Skill Files

Browse the full folder contents for android-background-work.

Download Skill

Loading file tree…

skills/android/android-background-work/SKILL.md

Skill Metadata

Name
android-background-work
Description
"Implement WorkManager and Background Processing correctly on Android. Use when creating Worker classes, scheduling tasks with WorkManager, choosing between WorkManager and Foreground Services, or setting up Hilt in workers. (triggers: **/*Worker.kt, CoroutineWorker, WorkManager, doWork, PeriodicWorkRequest, OneTimeWorkRequest, @HiltWorker)"

Android Background Work Standards

Priority: P1

Implementation Guidelines

WorkManager

  • CoroutineWorker: Use for all background tasks.
  • Constraints: Be 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 the user is 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