Is there any way to find out that android mobile's battery is not usable anymore and we need to change it, programmatically?
Asked Answered
M

1

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?

Muoimuon answered 5/9, 2017 at 6:56 Comment(9)
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.Carpio
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.Muoimuon
Did you check this: android-examples.com/…?Undying
The actual battery - battery life, charging speed and other things.Carpio
@Undying yes I did, and it used BatteryManager to get battery health, which always shows GOOD. I don't know should I rely on this totallyMuoimuon
Try to over heat the phone by playing game etc so that you will come to know to results.Undying
@LunarWatcher and how are we supposed to find out battery life?Muoimuon
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 statusCarpio
@LunarWatcher Ok, Thanks for the clarification mateMuoimuon
M
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.

Muoimuon answered 13/9, 2017 at 6:13 Comment(2)
Can you please tell how you've retrieved the cumulative charge count ? Or have you found something to get charge cycle count?Kylstra
@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.Muoimuon

© 2022 - 2024 — McMap. All rights reserved.