How do Android apps know the "health" of a battery?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
I've installed some battery monitoring apps and most of them have a section where they show the "health" of a battery (it comes up as "good"). Where does this info come from and how is it determined? As far as I know the app doesn't even measure the battery's capacity in mAh, so it has no way to compare the stated capacity with the actual capacity.

Out of my batteries I have one that's truly defective. I can charge it to 100% and then 10% of it will drain every 10 minutes. Once it reaches 60% (less than an hour) the phone has a chance of just spontaneously shutting off.

The battery app says the battery "Health" is "Good."
 

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
The short answer is, they really don't.. they just report what the operating system tells them about the component. Those apps generally just read sensor data provided by the operating system through an abstraction layer available to developers: https://developer.android.com/reference/android/os/BatteryManager.html
Looks like the OS actually reads data provided by the battery itself:

"Lithium ion batteries have simple onboard computers that track and report the health; the state indicators are standardized but the conditions that trigger them to be reported by the battery are determined by the battery manufacturer."

http://stackoverflow.com/questions/10098979/how-is-the-android-battery-health-determined

So the moral of the story is that it can be completely meaningless. A crappy battery manufacturer can just program their battery to constantly report "good" no matter what.
 
  • Like
Reactions: Jamie Kaler

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Looks like the OS actually reads data provided by the battery itself:

"Lithium ion batteries have simple onboard computers that track and report the health; the state indicators are standardized but the conditions that trigger them to be reported by the battery are determined by the battery manufacturer."

http://stackoverflow.com/questions/10098979/how-is-the-android-battery-health-determined

So the moral of the story is that it can be completely meaningless. A crappy battery manufacturer can just program their battery to constantly report "good" no matter what.

Yes, the moral of the story is that those applications are pointless and likely malware ;)