6

I looked everywhere for this, all I am getting is getting the battery related data via BatteryManager which I already know. But the thing is it always return battery health as "BATTERY_HEALTH_GOOD" . To cross check the same I checked various battery health apps available at Google play, many comments on those apps clearly says no matter how bad battery condition is(even the bulged up battery), it always says Health Good.

So, Is there any particular formula kind of thing which can be used to determine exactly how battery is doing and whether we should change it or not via android code?

Also, what does BatteryManager.BATTERY_HEALTH_COLD exactly mean?

Ankit Purwar
  • 522
  • 5
  • 18
  • There are phones where you can't change the battery. And battery health AFAIk isn't determined by it's physical damage, it is how it works. – Zoe Sep 05 '17 at 07:03
  • rightly said @LunarWatcher , but we are working for the enterprise level devices which have the changeable batteries. Now if not physical damage, what kind of factor does it depends on?? Also, how can we determine then we should consider changing the batteries. – Ankit Purwar Sep 05 '17 at 07:09
  • Did you check this: https://www.android-examples.com/check-get-battery-health-in-android-programmatically/? – R.R.M Sep 05 '17 at 07:10
  • The actual battery - battery life, charging speed and other things. – Zoe Sep 05 '17 at 07:10
  • @R.R.M yes I did, and it used BatteryManager to get battery health, which always shows GOOD. I don't know should I rely on this totally – Ankit Purwar Sep 05 '17 at 07:13
  • Try to over heat the phone by playing game etc so that you will come to know to results. – R.R.M Sep 05 '17 at 07:17
  • @LunarWatcher and how are we supposed to find out battery life? – Ankit Purwar Sep 05 '17 at 10:10
  • The statuses are handled by the ANdroid os. I have no clue what it means that it has good battery life, but the BATTERY_HEALTH_GOOD means the Android OS thinks the battery is good. If it isn't that isn't because of an app issue, that is because the Android OS misinterprets the status – Zoe Sep 05 '17 at 11:48
  • @LunarWatcher Ok, Thanks for the clarification mate – Ankit Purwar Sep 08 '17 at 06:18

1 Answers1

5

After a lot of reading, finally found out the answer of my own question. Batteries used in mobile phones these days are of Li-ion technology and these batteries calculate life of battery on the basis of number of charge cycles.

Number charge cycles = number of times battery is charged from 0 to 100

This can also be calculated by dividing total amount of charge placed on battery by it's rated capacity(mAh capacity of battery)

Number charge cycles = cumulative charge / it's rated capacity

Battery number is inversely proportional to battery-health, the higher the battery number, lesser the battery-health. (If number is >= 400, battery is no longer usable and should be replaced).

NOTE: It is not possible to say with any certainty what the relative impact on battery health will be as a result of partial charge cycles vs. full charge cycles. Two batteries will have similar Battery Numbers if they have similar amounts of Aggregated Charge. But if those batteries had very different charging and discharging patterns, then comparing their Battery Numbers may not tell us anything useful about their relative health.

One thing we can say with certainty is that the health of a given battery will reduce as its computed Battery Number battery increases. Nonetheless, it is likely reasonable to assume that batteries with very high Battery Numbers are "less healthy" than batteries with very low Battery Numbers.*

Lastly, although our normal devices does not gives these numbers directly hence we need to depend on the Health-Status given by android OS for battery health but, some enterprise level devices (with smart and gifted batteries) provides these number for exact and better calculations.

Ankit Purwar
  • 522
  • 5
  • 18
  • 1
    Can you please tell how you've retrieved the cumulative charge count ? Or have you found something to get charge cycle count? – Shree Krishna May 20 '18 at 06:21
  • @ShreeKrishna I was working on the enterprise level device TC75 which have smart batteries they do provide these number as extras in battery intent. For normal android devices I didn't find anything though. – Ankit Purwar May 21 '18 at 13:15