Android Battery & Power Usage
The Battery & Power Usage metric measures the battery consumed by the app during the session. It also shows the percentage of total battery consumed by the app during the session. The percentage of total battery consumed by the app in a session is calculated using the following formula:
(Total battery consumed by the app in a session * 100) / Total battery capacity of the device
In the app performance report, go to the Battery & Power Usage section to view the battery consumed by the app in a session. In the graph, the axes represent the following:
- X-axis: Depicts the time (in seconds) elapsed since the start of the session. 0 on the X-axis represents the start of the profiling session.
- Y-axis: Depicts the total energy value (battery consumed) in mAh by the app till a particular time since the start of the session. The Y-axis starts with 0 mAh.
Example
In the following example, the total battery consumed is 0.051% of the total battery capacity of the Google Pixel 6 Pro (5003 mAh). The points on the graph show the cumulative battery consumption by the app till a particular time since the start of the session. For example, in the following graph, the app consumed 1.03 mAh battery till 34.49 seconds of the session since the session started.
Impact on user experience
Users abandon apps that use excessive battery. Android could also kill apps that use excessive battery. As per a Techbeacon survey, over a third of the app users (36%) stopped using a mobile app because of heavy battery usage.
Threshold guidelines
The recommended threshold is 0.5% or less percentage of battery consumed per minute.
If your app exceeds the threshold, App Performance Testing flags an issue in the performance report. To know more about the issue, see App performance issues - Battery Usage.
Recommendations
The following are the recommendations to improve the Battery Usage:
- Optimize app wake locks: Use wake locks judiciously and make sure to release them when they’re no longer needed.
-
Use JobScheduler: Use the
JobScheduler
API to schedule non-urgent work to happen when the device is already awake and connected to a power source. -
Use AlarmManager judiciously: Use the
AlarmManager
API only when it’s necessary, and be mindful of the time intervals at which you set the alarms. - Monitor network connectivity: Monitor network connectivity and adapt app behavior to avoid battery drain when the network is flaky.
- Use Battery Historian: Use Battery Historian to identify power-hungry code paths and optimize the app’s resource usage accordingly.
Related topics
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!