In this guide
Sync stops overnight, reminders arrive late, or a tracker has gaps. On some phones the system limits what apps may do in the background to save battery, and your app is affected. Android's documentation describes Doze, which defers background CPU and network activity when a device sits unused, unplugged and with the screen off, and App Standby, which defers background network activity for apps the user hasn't used recently.
What to expect
- Android itself restricts background work, and these rules change between versions.
- Some phone makers add their own battery management on top. How strict it is depends on make, model and software version, and which maker does what changes, so test it instead of trusting lists.
- Users can also restrict an app themselves in settings, and some do it without knowing.
This is why "works on my phone" tells you little. Treat it as a test problem, not as folklore.
Test matrix
Build a small table and fill it in with real devices.
| Device | OS version | Battery setting for the app | Screen off for | Result |
|---|---|---|---|---|
| (your device) | default / unrestricted / restricted | 1 h, overnight | works / delayed / missed |
Test at least:
- Default settings, as a new user would have them.
- Screen off, phone idle, 15 minutes, 1 hour and overnight.
- Phone plugged in vs not plugged in.
- App swiped away from recent apps vs left open.
- Battery saver on.
- Restricted in settings, to see how the app behaves when the system limits it.
For each run, record: expected event time, actual time, and whether it arrived at all.
Tester instructions
Send testers something like this:
Install the build. Leave it at default settings. At 22:00 trigger the test reminder, lock the phone and leave it. Tell us in the morning: did it arrive, and when? Then tell us your phone model, Android version and whether battery saver was on.
Keep it to one scenario. Ask for the model and OS version every time.
Fixing it
- Use the system's recommended mechanism for work that must continue after the user leaves the app. Android's background-work guide names WorkManager as the best option in most cases, and warns that work expected to run longer than 10 minutes is highly likely to be interrupted, so split it into smaller tasks.
- Make work resumable. If the system stops it, the next run should catch up.
- Tell users when a setting blocks the app, and link to the right settings screen, instead of silently failing. Ask for exemptions only if the app really needs them: Android's Doze documentation says Google Play prohibits requesting a battery optimization exemption unless the app's core function is adversely affected.
- Log it. Record when background work last ran, so a tester's report has data.
When to stop
If a restriction exists only in a maker's modified software, you can't fix it from your side. Document the behavior and the workaround you tell users.
Real phones, real results
AppReviewX gives you private, structured feedback from other developers, each on their own phone. One feedback you write earns one credit; new accounts start with 0 credits. For Android apps, test groups cover the Google Play requirement of 12 testers for 14 days in a row.
More in App testing problems and fixes. Related: Notifications not arriving in a test build and App install failed: device incompatible. Also: Which Android devices to test on.