[Q] An App, that control charging process for enlarge battery lifespan? - Android Software/Hacking General [Developers Only]

Hey
First, please read this article:
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
TL DR
A Li-Io or Li-Po battery charging cycle like charged to 100%, discharge to 15% and repeat, will have only 300-500 charge/discharge cycles battery lifespan, while a battery charging cycle like charged to 75%, then discharge to 25% and repeat, will get 1,500-2,500 charge/discharge cycles battery lifespan.
I have Samsung laptop, that have application (Samsung Easy Settings), that control charging process. When "BATTERY LIFE EXTENDER" is checked, then charging stops at 80% and will not get higher, and when laptop is constantly connected to wall, then app will let drop battery level 75%, then recharge to 80% again.
I'm using this laptop over 3 years and battery last over 5 hours (time on battery is shorter about 10-15min from "brand-new" state)
So, I'm looking for an android app (for rooted devices), that will stop charging at user predefined level (for example 80%), and cause alert/notification (on discharge), when battery level dropped below user predefined level (for example 25%) - to save battery lifespan.
PS: There is a trend, the newer, high-end devices have built-in batteries, without possibility to replacable (solid smarphone body, hard to open without damage), so that app could make device live longer
PS2: I read about charge control by "/sys/class/power_supply/battery/charging_enabled", but this doesn't exist in my ROM (crDroid, CM13 based on i9505)
PS3: The tasker helped me to "detect" charging over 80% (profile AC is ON and Battery level is over 79% -> task "say bla bla bla disconnect Your phone from wall"), but this is only "workaround" and doesn't work at night (You have to wake up and disconnect phone from wall)

Unfortunately this is a Question. This forum is only used to post actual apps.
You have already posted in right place so closing this.

Related

[Q] App that logs battery charge

Hi,
I would like to know if an app exists that logs battery charging.
The idea is to have an history of how often you charge your phone battery, so that you can see the trend or if you have a new app that is draining your battery.
The info I want to have each time I put my power cable to my phone can be the following :
- battery % before charge
- battery % after charge
- sleep time between last charge and current charge
- uptime (not sleep) between last charge and current charge
Then we can make statistics with those data like %battery used per uptime minutes ...
Am I clear ?
Battery Snap, Battery Diviner, probably many others.... Did you bother to search?
+1 on the Battery Snap - even has fancy graphs for your pleasure
thanks for the answer.
@khaytus : Yes I did search : certainly with wrong keywords (log battery usage)

[Q] Measuring state of charge/discharge to 1% accuracy via charge counter

Is there a way to measure the state of battery to 1% accuracy, i understand that the battery manager only does in intervals of 10%. I was wondering if i could use the charge counter. I found it to be 85 and 95 when battery state changed from 80% to 90% and 90% to 100% respectively. I am not sure how to measure the % in between intervals. Also i cannot found any batt_current in my sys folder(its motorola atrix 4G). Please any suggestions would do. Thanks.
Hello, give a try to the Battery Monitor Widget application on the Store.
It is a real great application to log the battery life.

(Step by step) How to work out battery efficiency

Do u know how battery efficient ur smartphone is?
How is the battery efficiency of kernel X compared to that of kernel Y?
Is there an objective way to work out battery efficiency (ie. other than appealing to ur subjective impression)?
Below is my tentative solution to the above questions
Requirement:
1. You need to be able to bootup into recovery mode where u can wipe the battery stat (e.g. CWM Recovery can do that. In most cases, u need a rooted phone to obtain CWM Recovery);
2. You need to be able to take screen shots;
3. CPU Spy (by storm717, free from Google Play. Disclaimer: this author doesn't have any affiliation with the app or its creator )
4. Know the total capacity (in mAH) of ur battery (can be read from the face or the back of ur battery)
Procedure
Step 1. Calibrate the battery level indicator of ur phone
Concerning the battery level, theoretically only two points can be certain: 100% (when the battery is fully charged) and 0% (when it is totally depleted). All in the middle are extrapolations based on either the 100% or the 0% point.
Practically, the 100% point is the only point against which the battery indicator can be accurately calibrated. Below is the how:
1a. Fully charge ur phone. Switch it off when the fully charge indicator is on BUT leave the charger connected to it at this point;
1b. Half an hour later, with the charger still attached, boot up into recovery mode;
1c. Choose "Wipe battery stat" from the recovery menu: (for CWM Recovery) scroll to "advanced", then "Wipe battery stat", then scroll down to highlight "yes, wipe battery stat". When it is highlighted, WAIT FOR 1 MORE MINUTE before u press the Home button to activate it (the wait will make extra sure ur battery level is truly, totally, and absolutely 100% )
1d. When that extra 1 minute is over, press the Home button to activate "yes, wipe the battery stat" --- now, the battery level indicator is accurately calibrated to 100%. (U now can see why u can never totally accurately calibrate against the 0% point: as soon as u reach the true 0%, ur phone is out and u can't reset the battery level indicator to zero when ur phone is out. That's why )
Step 2. Monitor ur battery consumption
2a. With Step 1 completed, reboot ur phone;
2b. From this time on, DO NOT ATTACH UR PHONE TO UR PC VIA USB OR SWITCH OFF OR REBOOT UR PHONE until the whole monitoring process is over;
2c. U may then use the phone any way u wish (with exception 2b above applied), but from time to time (say for every 4 or 6 hours), run CPU Spy and take a screen shot of the results it obtains each time (see for e.g. the pictures attached);
2d. The monitoring should continue until the battery level is around 10%
Step 3. Calculate the rate of battery consumption
After Step 2, u will have multiple screen shots showing ur battery consumption at various levels of battery discharge. U may use the data obtained to calculate the rate of consumption of ur device. Below is how:
3a. Take my own consumption (battery: 2,500 mAH stock battery, phone: Samsung Galaxy Note) as an example --- see Fig 1 attached.
When the battery level is 74%, the CPU stats are as followed:
Deep Sleep: 15h 22m 55s, 90%
200Mhz: 1h 13m 21s, 7%
etc.
Understandably, the rate of battery consumption is different at different CPU frequencies. So, we will calculate the respective rates one by one (when the data obtained permit so).
3b. To calculate the rate of consumption (in mA/sec), when the phone is in Deep Sleep, C(Deep Sleep):
Amount of battery used = 2,500 mA * (100 - 74)% * 90% = 585 mA
= C(DS)*(15*60 *60 + 22*60 +55)sec
Thus, C(DS) = 0.0106 mA/sec ---------------------------------------(1a)
Similarly for C(200Mhz) (rate of battery consumption when CPU is at 200Mhz)
C(200Mhz) = 0.0103 mA/sec ----------------------------------------(2a)
In theory, we can similarly calculate the rates C(500Mhz), C(800Mhz), etc. However, becoz the consumption % for those frequencies are below 1 and CPU Spy rounds all decimals to the nearest digit, so in practice the figures obtained cannot be used.
3C. Now, let's look at Fig 2, when the battery level is at 47%. The data obtained are:
Deep Sleep: 19h 29m 27s, 81%
200Mhz : 3h 15m 1s, 13%
etc.
Thus, C(DS) = 0.0153 mA/sec ----------------------------------------(1b)
C(200Mhz) = 0.0147 mA/sec -----------------------------------(2b)
Hence in my case (Samsung Galaxy Note, GB 2.3.6, Kingdroid v5.4 ROM, Speedmod K1-5 kernel, 2,500 mAH stock battery) the rate of battery consumption is around 0.011 to 0.015 mA/sec.
Limitations
1. The results obtained from the above method to calculate rates of battery consumption is system-dependent, meaning that meaningfully comparison between results can only be made for the same combination of phone + battery (system). Say u obtain C(Deep Sleep) for certain phone, OS, ROM, kernel is, for instance, Z mA/sec, this doesn't mean that for the phone model having the same OS, ROM, kernel, C(Deep Sleep) must be Z, becoz even for the same models the hardwares may be different and the battery may also be a bit different (different batches may behave slightly differently; and more importantly, the AGE of a battery can have significant effect on its performance, so batteries of the same model and the same batch may perform different owing to their different age). Nonetheless, u may make meaningful comparison when u compare results obtained for different OS's, ROM's, or kernels u install to ur system (phone + battery).
2. The rate of battery consumption with CPU at higher frequencies may not be derivable owing to the rounding of figures by CPU Spy.
******************************
Pls click "Thanks" if u find this makes good sense
reserved for possible future use.
Interesting post!
What do you say if I only charge my phone to full, use Battery Calibration, reboot the phone. Will the phone still be 100% charged? Also, I think randomly using your phone between a certain range of battery levels, say 100-10%, doesn't really guarantee exact data for calculations. Maybe a stress-testing app will do a better job. Have you tested My Battery Drain Analyser and compared your results to its reading?
Please correct any technical fact if needed!
Your info is interesting but you may post it on the battery thread already is placed in general

Fast Battery Charging Application

Fast battery charging app gives you an easy way to charge your dead battery into working battery. There is often situation comes in your life when you need a quick battery charger and this app solves your battery charger problem. Best Application to test your charger is the genuine or fake charger.
Download Fast Battery Charging on Android
Plug and play the charger into the phone and this application will automatically start charging your dead cell battery into the super fast full battery.Tap on the optimize battery and it will automatically extend your battery life while removing unnecessary apps running in the background. The optimizing battery functionality will boost your battery life by stopping unwanted an application running the background.
The ultra-fast battery charging app lets you charge your battery in a just a couple of minutes.
This application is best android battery charging application to charge your dead battery into the full battery.You can increase the battery extended life while closing all unwanted application likes wifi Bluetooth, mobile data, Brightness, Rotation mode, profile setting and timeout setting. Fix you low battery issue with this ultimate super battery charging application.
Now you can check your charger is working at the high voltage or not. Just plug the battery into the phone and check in the application the total voltage your phone is receiving.
Best application to test your charger is genuine or not.
Note: Some of the images are taken from pixabay and they give rights to use for commercial use of these images.
Wrong place for fake apps. We're not your demographic. My grandpa's Facebook may go for it, though.

[Guide]Using the Advanced Charging Controller (ACC) Magisk Module with Pixel 3a XL

While I've had many Android phones, this is the first phone that I decided to use a battery charging controller to regulate how my battery is charged. I just wanted to share my journey with others and encourage others to try this out if you are not already.
Although there are several different battery charging controllers out there (and more than one named "ACC" which makes it even more confusing) I decided to use the Advanced Charging Controller module developed by VR25. I choose this module because I felt it provided the most customization.
Step 1 - Installation
Installing the module is easy. It is listed in the Magisk repository. Simply browse the available modules and find the one titled, "Advanced Charging Controller (acc) created by VR25 @ XDA-developers". There are several ACC modules, so make sure you install the one by VR25 to follow this thread.
Magisk will flash the module and start it automatically. You don't even need to reboot, although it is the only way to clear the Magisk notification that the module will be started at the next reboot.
Step 2 - Changing the Charging Switch Setting
I found that the default charging switch setting (auto) does not work reliably with our phones. Therefore I would suggest changing it using the commands below. Personally I have choose option 2 (battery/charge_disable 0 1) but I listed all the options with the quirks that I have found with each one.
Step 2.1 - open your preferred command line app - I use Terminal Emulator.
Step 2.2 - type "su" and hit enter to gain root
Step 2.3 - type "acc -s s" and hit enter - this is the command that allows us to select another charging switch
Step 2.4 - type what number of the charging switch you want to use.
Here are the available charging switches and the issues I have found with them:
1) Automatic - this switch tries to cycle through the available switches until if find one that "works".
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: No - I found that the phone would charge anytime it was plugged in and below the Pause threshold. It did not seem to wait until the battery level was below the Resume threshold.
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
- Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
- Other issues:​
2) battery/charge_disable 0 1 :
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: Yes
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
- Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
- Other issues:​3) battery/input_suspend 0 1:
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: Yes
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): No - phone begins discharging from battery when Pause threshold is reached but the phone is still plugged in
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: No - may show charging icon when phone is really discharging, especially during cooldownratio times and the chime doesn't always ring when charging resumes.
- Suffers from wakelock issues when phone is plugged in but not charging: No
- Other issues: The phone seems to follow the cooldown charge/discharge times even before reaching the cooldown threshold. I find the phone pausing for 10 seconds (my cool down ratio) when the batter level might be a 50% - long before the 60% cooldown threshold I have set in the config file.​4) dc/input_suspend 0 1:
- Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
- Charges and discharges according to the cooldownratio:
- Starts discharging when the phone reaches the Pause threshold:
- Begins charging when phone reaches Resume threshold:
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
- Suffers from wakelock issues when phone is plugged in but not charging:
- Other issues:​5) battery/charge_control_limit 0 1:
- Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
- Charges and discharges according to the cooldownratio:
- Starts discharging when the phone reaches the Pause threshold:
- Begins charging when phone reaches Resume threshold:
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
- Suffers from wakelock issues when phone is plugged in but not charging:
- Other issues:​
Step 3 - Configuration
You can configure the ACC controller using a couple of different methods. You can do everything using command lines, you can use the beta ACC app (see note below), or you can edit a config file that ACC creates when it is installed. Personally I found that editing the config file was the quickest and easiest method to make general changes.
The ACC config file is found at /storage/emulated/0/acc The file is named "config.txt" You can open the file with a text editor. I personally use the app Root Explorer. I long click on the file name, and then press the three dot button in the upper right hand corner. Choose "Open in Text Editor" and the config file will open and allow changes to be made. Saving the file will automatically push the changes to ACC, you do not need to reboot or restart the ACC daemon for changes to take effect.
I won't go into a lot of detail about all of the different configuration options here as the developer's xda thread is the best place to get that type of information. But I will talk about the most basic setting - the "capacity" setting. It is the second setting listed in the config file and it should look something like "capacity=0, 60, 70-80". Here is a break down of what those numbers mean:
- The First Number (0): is battery level were the phone will shut off. The default setting of 0 means the phone will turn off when the battery level hits 0. Personally I don't want my battery completely draining, so I have it set at 5.
- The Second Number (60): is the battery level where the module starts it's "cool down" functionality. Cool down (listed as coolDownRatio in the config file) is where the phone will stop charging briefly and then restart charging. The default "cool down" setting is coolDownRatio=50/10 which means the phone will charge for 50 seconds, and then stop charging for 10 seconds before charging again for 50 seconds, etc, etc, etc. This is designed to keep the battery temps low. A battery with a charge level less than this number (60 in this example) will charge without pausing, but when the battery level gets to this number or above, the phone will charge and pause based on the coolDownRatio.
- The Third Number (70): is the "resume" value. If the phone's battery level is below this resume value, the phone will charge. If the battery level is at or above this resume value, the phone will not charge even while plugged in.
- The Fourth Number (80): is the "pause" value. This is the battery level where the phone will stop charging and should not charge above this value.​
The default settings are set this way because research has shown that a phone's battery will last the longest with the least amount of battery capacity loss if it is charged to a max of 80% of the battery's capacity, and allowed to discharge just a small amount (10%) before being charged again. I realize this goes against the old "wives tale" that our phone's batteries have a very limited number of charges and it is best to limit the number of charges by only charging the phone when it gets to a low level. This is not true in actual battery performance however and if you charge like this, you are actually decreasing your battery's life expectancy and performance.
Obviously the default settings may not be the best setting for you. The default settings are probably only practical for a device that is plugged in 100% of the time. Personally I have changed my capacity setting to capacity=5, 60, 70-90. This means my phone will turn off when the battery level reaches 5% (something it has never dropped to yet), it is charged to a max of 90% and will discharge to 70% before charging again, and the cooldown charging cycling starts when the battery is 60% or higher. Obviously I'm not on my charger all the time, so it is very common for my battery to drop below 70%. However, if the battery is below 70% and I have a charger at my disposal, I am going to charge the phone back to 90% rather than let it the battery levels continue to fall.
Final Notes and Misc Thoughts
There are lots of other options and commands you can use in ACC. Feel free to share any changes you like to make, or post if you are having problems getting the module to work as expected on the 3a. I hope this helps some people feel give the module a try.
There is an ACC app that is available now that allows you to control some of the settings from a nice GUI. I personally did not like using it as I found it would overwrite settings in the config file that I was not intending to be changed.
There is an ACC telegram group if you want to join and have direct communication with the developer and others.
Thanks to @jellopuddingstick for educating me on what the battery idle mode does and why it is beneficial to have it working!
sic0048 said:
I just wanted to share my journey with others and encourage others to try this out if you are not already.
Click to expand...
Click to collapse
Was doing the same research when this popped up -- great job!
Can you discuss more on what unintended settings were overwritten by the app....
Also, thoughts have seem to have standardized now to lop off 40% of usuable capacity by having the battery charge btw 20-80% to extend life, such as... "capacity=20, 60, 70-80".
How were the defaults for ACC set and why have you chosen otherwise?
duh1 said:
Was doing the same research when this popped up -- great job!
Can you discuss more on what unintended settings were overwritten by the app....
Also, thoughts have seem to have standardized now to lop off 40% of usuable capacity by having the battery charge btw 20-80% to extend life, such as... "capacity=20, 60, 70-80".
How were the defaults for ACC set and why have you chosen otherwise?
Click to expand...
Click to collapse
The app works by writing to the normal config file. But it also has three profiles loaded into memory automatically when you install it. This makes it very easy to press on one of the other profiles by accident and totally change your settings. I eventually deleted all the "extra" profiles, but the charging switch isn't changeable via the app either (it seems like it defaults to auto) so the app will overwrite that setting back to auto if you aren't paying attention.
In the long run I found that using the config file was extremely easy and I found myself having the check the config file anytime I used the app to make sure it wasn't changing unintended settings, so I decided to remove the app and just use the config file.
As far as capacity, I decided to run 5, 60, 70-90. I think it is a good compromise between having a decent amount of capacity available and also not charging the phone to 100% all the time. I could probably get away with a limit of 80 or 85, but ultimately decided on 90. I do try to charge my phone when it hits 70 or below if I have a charger available vs waiting to do a larger/longer single charge.
sic0048 said:
I do try to charge my phone when it hits 70 or below if I have a charger available vs waiting to do a larger/longer single charge.
Click to expand...
Click to collapse
Don't you think 70 is too high to begin charging just to bring it back to 90. Doesn't number of charge cycles kill battery life as much as heat and fast rate charging?
Any good apps you like that intuitively monitor battery health, besides just stats and charts, that does it like apple, as a percent of remaining chargeable capacity?
Btw OT question, looking to move over my wifi connections from the previous phone and can't find the wpa_supplicant.conf file in /data/misc/wifi in the 3a. No reference online mentions that it's been moved. Any idea where they're hiding it now? Thx...
duh1 said:
Don't you think 70 is too high to begin charging just to bring it back to 90. Doesn't number of charge cycles kill battery life as much as heat and fast rate charging?
Click to expand...
Click to collapse
According to this research (https://batteryuniversity.com/index.php/learn/article/how_to_prolong_lithium_based_batteries/), the more your battery discharges, the fewer discharge cycles it will survive before really negatively effecting battery performance. So discharging your phone just 10% might give you 6000 discharge cycles, while discharging your phone 60% might reduce these discharge cycles by 90%.
Obviously I have to rely on other people's research as there is no way I can adequately test this myself. But I do trust this research as accurate. I know with other phones I've had where I did not try to control the charging system I have had to replace the batteries with pretty regular occurrence. But I would leave the phone on the charger overnight (not a good thing for battery life) and try to discharge the battery a lot before charging it back again (also not a good thing for battery life). That's why I decided to finally look into using a charging controller like ACC with this new phone.
duh1 said:
Any good apps you like that intuitively monitor battery health, besides just stats and charts, that does it like apple, as a percent of remaining chargeable capacity?
Click to expand...
Click to collapse
I've been using the ExperimentalX helper app to track battery usage. (You don't need to use their kernel to use the helper app). I like it because it breaks the battery usage stats into two parts: when the screen is on, and when the screen is off, but it doesn't attempt to give a percent of remaining chargeable capacity. I'm not aware of an app that does that (although I too would be interested to know if such and app exists).
duh1 said:
Btw OT question, looking to move over my wifi connections from the previous phone and can't find the wpa_supplicant.conf file in /data/misc/wifi in the 3a. No reference online mentions that it's been moved. Any idea where they're hiding it now? Thx...
Click to expand...
Click to collapse
I think the info you are looking for is now stored at /data/misc/wifi/WifiConfigStore.xml.
As I use my phone more, I realize that none of the charging switches seem to work 100% of the time as expected. I'll continue to do trial and error tests, but please share if you find a switch that works consistently.
I've continued to edit my original post to provide as much information about the different charging switches and the issues I see with each one. Hopefully it is easy to understand.
I still find myself defaulting to the 3rd charging switch option and while it can act a little erratic sometimes, it does work normally most of the time.
Is it possible to disable/bypass the cool down period?
creeve4 said:
Is it possible to disable/bypass the cool down period?
Click to expand...
Click to collapse
The default setting is for it to be turned off I believe. Look in the config file for "coolDownRatio=" and see if it is blank. If it is not, you can remove everything after the equal sign.
Another way to do it is set the cooldown threshold number to be equal or higher than your "pause" threshold. So you might set this as "capacity=5, 100, 70-90". The 100 represents the value at which the cooldown process would start, which is higher than the pause threshold (at 90 in this example) and therefore would never kick in.
All this being said, I find that the #3 switch option seems to allow the cooldown pause/charge process to start below the set cooldown threshold. I have my cooldown threshold set at 60, yet find the phone pausing and charging at battery levels below this threshold. This should not be happening, but is something I can live with, so I haven't bothered to follow up with it.
After several more weeks of use, I've updated the initial post again. I found some quirks with the "automatic" charging switch, so I have gone back to selecting charging switch option 2 (battery/charge_disable 0 1).
Great job!
May I ask you whick kernel you are using for "battery idle mode" support? It should not be supported on stock kernel.
Thanks

Categories

Resources