Android 14 could add support for a new feature that could give users insights into their device’s battery health. New application programming interfaces (APIs) found on the latest Android 14 beta could show details such as the health of the phone’s battery, the manufacturing date, when it was first used, how many charging cycles have been completed, and the charging policy. As these are provided using APIs, third party apps can also access some of the statistics, ahead of the expected arrival of battery health monitoring features when Android 14 is released later this year.
The new BatteryManager APIs were spotted by Esper’s Mishaal Rahman on the latest Android 14 beta. Two of these APIs that track battery charge cycles and the battery’s charging status are public, which means that third-party apps can access them. On the other hand, details such as charging policy, health state, and charging policy can only be accessed by system apps.
A few days back, I commented on some new BatteryManager APIs Google added in Android 14. Two of the APIs (cycle count & charging status) are public while the rest (manufacturing date, date of first use, charging policy, state of health) are system APIs. https://t.co/3ujezWsLg2
— Mishaal Rahman (@MishaalRahman) June 1, 2023
Battery health monitoring apps have existed on the Play Store for several years, with apps like AccuBattery and BatteryGuru offering estimates of battery health, without any APIs to rely on. Meanwhile, iPhone owners have had access to a battery health monitoring feature built into the settings app since iOS 11.3.
In order for a third-party app to gain access to these system APIs, you will need to grant it the BATTERY_STATS Android permission, according to Rahman. This is a permission that you can grant via a command line interface and a USB cable.
While Android 14 is still a few months away, developer Narek (Twitter: @narektor) has already published an open-source app that is capable of reading these statistics from the public and system APIs. If you are running Android 14 Beta 2 on your Pixel smartphone, you can download the open-source Batt app from GitLab.
It is worth noting that the app is merely a proof-of-concept and you should not rely on these details until Android 14 is released later this year. Rahman also points out that apps like Tasker will also add support for automation based on battery statistics provided by the system on Android 14. Similarly, if Google offers an inbuilt system like iOS to provide battery health statistics, it will curtail the need for third party apps to offer similar functionality.