Android 14 may add help for a brand new function that might give customers insights into their machine’s battery well being. New utility programming interfaces (APIs) discovered on the newest Android 14 beta may present particulars such because the well being of the telephone’s battery, the manufacturing date, when it was first used, what number of charging cycles have been accomplished, and the charging coverage. As these are supplied utilizing APIs, third occasion apps also can entry among the statistics, forward of the anticipated arrival of battery well being monitoring options when Android 14 is launched later this 12 months.
The new BatterySupervisor APIs have been noticed by Esper’s Mishaal Rahman on the newest Android 14 beta. Two of those APIs that observe battery cost cycles and the battery’s charging standing are public, which signifies that third-party apps can entry them. On the opposite hand, particulars equivalent to charging coverage, well being state, and charging coverage can solely be accessed by system apps.
Just a few days again, I commented on some new BatterySupervisor APIs Google added in Android 14. Two of the APIs (cycle depend & charging standing) are public whereas the remaining (manufacturing date, date of first use, charging coverage, state of well being) are system APIs. https://t.co/3ujezWsLg2
— Mishaal Rahman (@MishaalRahman) June 1, 2023
Battery well being monitoring apps have existed on the Play Store for a number of years, with apps like AccuBattery and BatteryGuru providing estimates of battery well being, with none APIs to depend on. Meanwhile, iPhone house owners have had entry to a battery well being monitoring function constructed into the settings app since iOS 11.3.
In order for a third-party app to achieve entry to those system APIs, you’ll need to grant it the BATTERY_STATS Android permission, in accordance with Rahman. This is a permission which you can grant by way of a command line interface and a USB cable.
While Android 14 continues to be just a few months away, developer Narek (Twitter: @narektor) has already revealed an open-source app that’s able to studying these statistics from the general public and system APIs. If you’re operating Android 14 Beta 2 in your Pixel smartphone, you may obtain the open-source Batt app from GitLab.
It is value noting that the app is merely a proof-of-concept and you shouldn’t depend on these particulars till Android 14 is launched later this 12 months. Rahman additionally factors out that apps like Tasker may also add help for automation based mostly on battery statistics supplied by the system on Android 14. Similarly, if Google provides an inbuilt system like iOS to supply battery well being statistics, it is going to curtail the necessity for third occasion apps to supply comparable performance.