Tools for building battery-efficient apps

New job scheduling APIs allow you optimize battery life by deferring jobs for the system to run at a later time or under specified conditions, such as when the device is charging or connected to Wi-Fi.

A new dumpsys batterystats command generates battery usage statistics that you can use to understand system-wide power use and understand the impact of your app on the device battery. You can look at a history of power events, approximate power use per UID and system component, and more.

Battery Historian is a new tool to convert the statistics from dumpsys batterystats into a visualization for battery-related debugging. You can find it at https://github.com/google/battery-historian.

About the author: phantomadmin