workmanager-android

Implements WorkManager conventions for Android background tasks with Hilt dependency injection.

Updated May 9, 2026
One-click install
npx skills add https://github.com/Bumh3rr/solvyx-app --skill workmanager-android-bumh3rr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: workmanager-android
Source: https://github.com/Bumh3rr/solvyx-app/tree/main/.opencode/skill/workmanager-android
Command: npx skills add https://github.com/Bumh3rr/solvyx-app --skill workmanager-android-bumh3rr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scheduling reliable background work on Android (reminders, syncs, periodic checks) is error-prone: tasks must survive app restarts, respect system limits like the 15-minute periodic minimum, and integrate cleanly with dependency injection. This Skill provides ready-made conventions and templates so Workers are idempotent, correctly injected via Hilt, and scheduled with proper constraints. ## Core Features & Use Cases - Hilt-integrated Worker templates: @HiltWorker + HiltWorkerFactory setup in the Application class, with CoroutineWorker templates for reminders, routines, and insight checks. - Scheduling patterns: PeriodicWorkRequest with flex intervals, OneTimeWorkRequest with initial delays, unique work policies (KEEP/UPDATE), backoff criteria, and worker chaining via beginUniqueWork. - Observability, testing, and debugging: WorkInfo Flow observation, WorkManagerTestInitHelper test setup, and adb commands for inspecting and forcing scheduled jobs. - Use Case: You need a daily reminder that fires only when the battery is not low and quiet hours are off. Apply the Skill to generate the Worker, the WorkScheduler wrapper, and the constraints in one pass. ## Quick Start Use the WorkManager skill to create a Hilt-injected periodic reminder worker that runs once a day with battery constraints.

Frequently Asked Questions about workmanager-android

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule a periodic background task with WorkManager on Android?▼

Use PeriodicWorkRequestBuilder with a repeat interval of at least 15 minutes, add Constraints such as setRequiresBatteryNotLow, and enqueue it with enqueueUniquePeriodicWork using an ExistingPeriodicWorkPolicy like KEEP or UPDATE.

How to use Hilt dependency injection with WorkManager workers?▼

Annotate the worker with @HiltWorker, inject dependencies via @AssistedInject constructor, and configure a HiltWorkerFactory in your Application class by implementing Configuration.Provider and returning the factory in workManagerConfiguration.

What is the minimum interval for PeriodicWorkRequest in WorkManager?▼

The minimum periodic interval is 15 minutes, enforced by the Android system. Requests with shorter intervals are not supported, so use flexTimeInterval to add scheduling flexibility within longer periods.

Why is my Hilt Worker not getting injected dependencies?▼

Injection fails when HiltWorkerFactory is not configured in the Application class. Implement Configuration.Provider, inject HiltWorkerFactory, and return it from workManagerConfiguration so WorkManager uses it to construct workers.

How do I test a CoroutineWorker with WorkManager?▼

Use WorkManagerTestInitHelper as a JUnit rule to initialize a test WorkManager configuration, then build the worker with TestListenableWorkerBuilder and call startWork().get() to assert the returned Result.