A deep technical guide on building reliable background execution in Android apps, covering Doze mode, App Standby Buckets, alarm batching, foreground service enforcement in Android 15+, and OEM-specific process killing behaviors. Key topics include the AlarmManager API hierarchy (setAlarmClock being the most reliable),

8m read timeFrom proandroiddev.com
Post cover image
Table of contents
1. The Evolution of Android Background RestrictionsMajor Background Changes by Version2. Doze Mode Deep DiveWhat Is Doze?Alarm Batching in DozeExample: Alarm Batching BehaviorExact Alarms & Permission ModelThe Special Case: setAlarmClock() — Highest Reliability OptionExample: Scheduling an Exact Alarm (including setAlarmClock)3. App Standby BucketsBucket Behavior Overview4. Background Execution Limits (Android 8+)Background Execution OptionsAndroid 15+ Foreground Service Enforcement5. Broadcast Delivery ChangesExample: Lightweight BroadcastReceiver6. Cold Start & Process DeathHidden Cost: Dependency Graph InitializationCold Start Timeline Example7. Background Activity Launch Restrictions (Android 10+)8. Real-World ScenariosScenario 1 — Alarm AppGet Mustafa Yiğit ’s stories in your inboxScenario 2 — Reminder AppScenario 3 — Messaging App9. OEM-Specific Background Killers10. There Is No Silver Bullet11. Permissions: The Hidden Layer12. Architecture Principles for Real Devices13. Exact Alarm Nuances (Android 13–15+)14. Foreground Service Enforcement15. Alarm Delivery Is Influenced By…16. Telemetry: Measuring Reality17. Adaptive Execution StrategyExample Strategy Matrix18. Notification as Reliability Anchor19. Idempotency & Reentrancy20. Recovery Mechanisms21. Testing Beyond the Emulator

Sort: