← All studio notes

Engineering & performance / DIJION

A mobile battery budget: what work should run, and when?

An energy-planning guide separating visible tasks from deferrable background work, with network, retry and device-measurement checks.

A quickly rendered screen does not establish efficient background behavior. Unnecessary requests, repeated attempts and unfinished work can contribute to battery use. In an illustrative reading app, checking for new articles and fetching the article someone just opened do not share the same urgency. First specify which work is needed and when.

Make the work inventory visible

For each job, record trigger, frequency, user outcome and stop condition. Distinguish work that must continue after a screen closes from work meaningful only while visible. Review prioritization and suitable batching before launching all pending jobs when connectivity returns. Removing unnecessary work can sometimes be more useful than optimizing its implementation.

Tie scheduling constraints to the task

Scroll the table horizontally to see all columns.

Example work budget
WorkTiming needCondition to review
Fetch requested contentUser is waiting nowVisible task and cancellation
Synchronize a large archiveMay be deferrableNetwork and charging conditions
Retry a failed checkDepends on failure typeLimits and waiting

Adapt platform constraints to the task

Android background-work guidance recommends appropriate constraints and examining why jobs stop. A condition such as waiting for charging is not suitable for every task; it could unnecessarily delay a current user action. Evaluate task class together with the promise made to the user. This article does not report battery results for a particular Dijion application.

Avoid equating one run with overall battery life

Device, network, display brightness, temperature and dataset size can affect measurements. Compare equivalent tasks under comparable conditions and record the method. Distinguish emulator observations from physical-device measurements. Foreground and background behavior may differ; a brief home-screen test cannot establish that the entire background policy is appropriate.

Verify that work also stops

  1. Disconnect and inspect retry frequency and limits.
  2. Leave the screen and check that unnecessary work ends.
  3. Compare pending work under low battery and charging conditions.
  4. Repeat the task on a physical device and record conditions.

The output is a justified work budget rather than an isolated battery percentage. Measurements should examine whether that budget preserves the required user outcome.

Sources