How would you evaluate an Android battery optimization against a freshness budget?

Instruction: For a sync workload, model each network wake as 0.4 J plus 0.02 J per request. Compare 60 separate requests per hour with six batches of ten. Calculate the request-related energy change, explain its limits and propose a battery-aware architecture that preserves the required freshness and user experience.

Context: A controlled arithmetic case with explicit energy assumptions. No device measurement is supplied. Distinguish modeled network savings, total device energy, scheduling limits and freshness tradeoffs.

Updated

Official answer

Define the user-visible freshness/latency target and measure the present workload. In this controlled example, request-related energy is modeled as a fixed wake cost plus an incremental cost per request. That is a planning model, not an Android device benchmark.

Sixty separate requests cost 60 × (0.4 + 0.02) = 25.2 J. Six batches of ten cost 6 × 0.4 + 60 × 0.02 = 3.6 J, an 85.7% reduction in this modeled component. The saving is 21.6 J over an hour, equivalent to 6 mW of average power. It is not an 85.7% reduction in total app/device energy; screen, CPU and other radio work remain. Conversion to battery charge also needs voltage and other assumptions.

Batch only work whose freshness budget permits the delay. Keep immediate user actions responsive, reuse connections and cache only with defined invalidation/access rules. Do not introduce a long wait simply to maximize the modeled saving. Measure actual radio/network behavior because wake costs are not necessarily independent or constant.

Use WorkManager for eligible persistent deferrable work and respect its constraints and Android power limits. Do not use exact alarms or persistent background services as a generic optimization. Stop unnecessary location/sensor sampling, bound caches and image sizes, and cancel screen-only work when no longer needed. Lazy initialization shifts cost to first use and requires testing that path too.

Compare representative devices and network conditions with the same workload, duration and functional output. Record energy/power, missed freshness deadlines, frame performance and failures, including Doze and battery-saver cases. Choose the measured tradeoff rather than promise zero performance cost.

Power management, Persistent work constraints, Exact alarm tradeoffs

Related Questions