Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 409
Ankit Purwar Avatar asked Sep 05 '17 06:09

Ankit Purwar


People also ask

How check battery consumption in Android programmatically?

Go to the activity_main. xml file, which represents the UI of the project. Add a Button, so whenever the user will click on the Button a Toast message with battery percentage will be popped up on the screen.

How do I check my Android battery health?

Using a dial codeOpen the Phone app on your smartphone and input *#*#4636#*#* in the dial pad. In the testing menu that pops up, look for Battery Information for details like charge level, battery temperature and health.

How can battery design capacity in Android programmatically?

os. BatteryManager. BATTERY_PROPERTY_CHARGE_COUNTER which gives you the remaining battery capacity in microampere-hours. BATTERY_PROPERTY_CAPACITY which gives you the remaining battery capacity as an integer percentage.


1 Answers

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.

like image 88
Ankit Purwar Avatar answered Oct 11 '22 13:10

Ankit Purwar