FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
From Foreground Services to WorkManager: How We Cut Battery Drain by 70%
How-ToTools

From Foreground Services to WorkManager: How We Cut Battery Drain by 70%

via Dev.toSuriDevs2w ago

40% of my users on Android 14 were crashing. Every. Single. Day. The crash logs all said the same thing: ForegroundServiceStartNotAllowedException . My auto backup service that had worked fine for four years just... stopped working. Google had finally won the war against background services, and I was collateral damage. The Old Way Worked Great (Until It Didn't) Our All Backup & Restore app (2M+ downloads) had a simple approach since 2020: start a foreground service on boot, listen for app installs, backup immediately. Users loved the "real-time" feel. class BootCompleteReceiver : BroadcastReceiver () { override fun onReceive ( context : Context ?, intent : Intent ?) { if ( intent ?. action == "android.intent.action.BOOT_COMPLETED" ) { context ?. startForegroundService ( serviceIntent ) } } } The service would show a persistent notification, register broadcast receivers for PACKAGE_ADDED and PACKAGE_REPLACED, and backup any new app within seconds. Then the complaints started rolling in

Continue reading on Dev.to

Opens in a new tab

Read Full Article
14 views

Related Articles

How-To

Why New Bug Bounty Hunters Get Stuck — And How to Fix It

Medium Programming • 5h ago

Beyond the Code: Why the 7-Step Development Lifecycle is Your Competitive Advantage.‍
How-To

Beyond the Code: Why the 7-Step Development Lifecycle is Your Competitive Advantage.‍

Medium Programming • 7h ago

HadisKu Is Now Ad-Free: Why I Removed Ads From My Islamic App
How-To

HadisKu Is Now Ad-Free: Why I Removed Ads From My Islamic App

Dev.to • 9h ago

How-To

How To Be Productive — its not all about programming :)

Medium Programming • 9h ago

Welcome Thread - v371
How-To

Welcome Thread - v371

Dev.to • 9h ago

Discover More Articles