Battery-friendly apps

Performance Mid-level Kotlin 2.0+ API 24+ Reviewed By Best Latest Apps

Pick the fix

A weather app requests high-accuracy GPS updates every 10 seconds in the background. Best change?

Options
Hint 1 of 1

How precise does weather need to be?

Choose an answer, then open Show answer below to check it.

Show answer

Answer: A Use approximate, balanced-power location with infrequent updates, or get it when the app opens

Correct. Weather needs city-level accuracy, rarely.

Why not the others?
  • B Use a foreground service so it isn't stopped. Makes the drain permanent.
  • C Move the request to a WorkManager job every 15 minutes with high accuracy. Still high accuracy for no reason.
  • D Request the background location permission. Permission doesn't reduce the drain.

30-second answer

The biggest costs are keeping the radio, GPS or CPU awake: frequent network polling, wake locks held too long, high-accuracy location in the background, and work that ignores Doze. Batch work with WorkManager and constraints, use push instead of polling, request the lowest location accuracy and update rate that works, and release wake locks promptly.

Practise saying it · 30 s. No recording, just a timer

Explain how to keep battery use low.

Say your answer out loud, then check which of these points you covered:

  • Radio, GPS and CPU are the costs
  • Batch with WorkManager
  • Push instead of polling
  • Lowest location accuracy that works
  • Release wake locks

Deep dive

Android vitals reports excessive wake locks and background Wi-Fi scans.

Battery Historian and Perfetto power traces show what kept the device awake.

Foreground services must be justified and visible; users notice the notification.

Prefer Priority.PRIORITY_BALANCED_POWER_ACCURACY unless turn-by-turn precision is needed.

Common mistakes

  • Polling the server every minute.
  • Holding a wake lock with no timeout.
  • Requesting high-accuracy location for weather.

Senior take & follow-ups

Name the hardware costs (radio, GPS, CPU) and one fix for each.

Follow-up questions

Think of your answer first, then open the hint.

  1. What replaces polling?

    Show hint

    Push messages from the server.

  2. Which location accuracy suits a weather app?

    Show hint

    Approximate or balanced, updated rarely.

Compare on iOS: Fixing a location feature that drains the battery The same trade-off with Core Location accuracy levels.

Suggest a fix if something here is wrong or out of date.