android-workmanager-notifications
Schedule reliable background work, reminders, and notification delivery with WorkManager and Android execution limits.
What this skill does
# Android WorkManager Notifications ## When To Use - Use this skill when the request is about: android workmanager job, background reminder notification android, reliable retry workmanager. - Primary outcome: Schedule reliable background work, reminders, and notification delivery with WorkManager and Android execution limits. - Read `references/patterns.md` when you need the API-choice matrix for WorkManager vs foreground service vs alarms. - Read `references/scenarios.md` for unique-work, notification-permission, and reminder-delivery review paths. - Handoff skills when the scope expands: - `android-permissions-activity-results` - `android-performance-observability` ## Workflow 1. Choose the right execution API first: WorkManager for deferrable guaranteed work, foreground services for ongoing user-visible work, and exact alarms only when clock-time precision and policy requirements truly demand them. 2. Make work idempotent and uniquely addressable with explicit names, input data contracts, backoff policy, and cancellation behavior. 3. Apply constraints, expedited work, and retry semantics only where they match user value and platform limits. 4. Build notification delivery as part of the contract: channels, importance, tap action, runtime permission handling, and graceful behavior when notifications are denied. 5. Validate duplicate scheduling, reboot/process death, and degraded states before handing off performance or permission-specific follow-up work. ## Guardrails - Keep background work idempotent and cancellation-aware. - Use unique work or unique periodic work when the feature represents one logical reminder or sync pipeline. - Treat expedited work as scarce and user-valuable; do not use it as a generic queue-jumping flag. - If a worker uses network constraints, ensure the app declares the permissions required for those constraints on modern Android versions. - Keep notification value intact even when the user declines `POST_NOTIFICATIONS`; the app still needs a visible recovery path. ## Anti-Patterns - Blocking the main thread with disk or network calls. - Expecting WorkManager to deliver exact wall-clock timing like an alarm API. - Re-enqueueing duplicate reminder work instead of using unique work policies. - Failing to create channels or handle notification permission decline paths. - Hiding critical foreground or exact-alarm policy assumptions in comments instead of code and docs. ## Review Focus - Is WorkManager the right API for this workload? - Are unique work policies, constraints, retry, and cancellation explicit? - Do reminder and notification paths still make sense if notifications are denied? - Are expedited, foreground, or exact-alarm behaviors justified and policy-safe? ## Examples ### Happy path - Scenario: Find background-work and notification hooks before proposing a scheduling change. - Command: `rg -n "WorkManager|Worker|enqueueUnique|PeriodicWorkRequest|NotificationChannel|POST_NOTIFICATIONS" examples` ### Edge case - Scenario: Review exact-alarm, expedited, or network-constrained work for platform-sensitive behavior. - Command: `rg -n "setExpedited|setRequiredNetworkType|AlarmManager|ForegroundInfo" examples` ### Failure recovery - Scenario: Disambiguate WorkManager requests from permission prompts and performance work. - Command: `python3 scripts/eval_triggers.py --skill android-workmanager-notifications` ## Done Checklist - The chosen execution API matches the workload's timing and visibility requirements. - Unique work, retry, cancellation, and constraint behavior are explicit. - Notification channel and permission behavior are handled as part of the feature contract. - Process-death, reboot, and duplicate-scheduling behavior have been considered. ## Official References - [https://developer.android.com/topic/libraries/architecture/workmanager](https://developer.android.com/topic/libraries/architecture/workmanager) - [https://developer.android.com/develop/background-work/background-tasks/persistent/getting-started](https://developer.android.com/develop/background-work/background-tasks/persistent/getting-started) - [https://developer.android.com/develop/background-work/background-tasks/persistent/how-to/manage-work](https://developer.android.com/develop/background-work/background-tasks/persistent/how-to/manage-work) - [https://developer.android.com/develop/ui/views/notifications/build-notification](https://developer.android.com/develop/ui/views/notifications/build-notification) - [https://developer.android.com/develop/ui/views/notifications/notification-permission](https://developer.android.com/develop/ui/views/notifications/notification-permission) - [https://developer.android.com/develop/background-work/background-tasks/optimize-battery](https://developer.android.com/develop/background-work/background-tasks/optimize-battery) - [https://developer.android.com/develop/background-work/services/alarms](https://developer.android.com/develop/background-work/services/alarms)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.