yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] zpower:
The last version working for me it's 0.11.0

After that no version can discharge after reach 80%. Hold 80% forever.

With 0.11.0 since reach 80% stop charge and start again to value i define (60%).
[Android Apps and Games] Diljinder:
Which device are you using?
[Android Apps and Games] hgmichna:
Holding the charge, rather than discharging

Holding the charge is actually an improvement. Most smartphones cannot do it, so the app switches between charging and discharging.
[Android Apps and Games] zpower:
Bq X5 Plus

---------- Post added at 06:00 PM ---------- Previous post was at 05:59 PM ----------

I don't see any advantage holding the same % for "eternity"
[Android Apps and Games] hgmichna:
Holding the charge, rather than discharging

If you are content with a lower % charge, why not set the app for that lower % charge in the first place? Your battery would live longer.
[Android Apps and Games] Gregbol:
Hello.

What is the best version of the application for a note 3 that does not work in store_mode but in batt_slate_mode.

What I want is that it discharges as slowly as possible after reaching 90% and that it recharges by reaching 80%.

Thank you.

Envoyé de mon SM-N930F en utilisant Tapatalk
[Android Apps and Games] zohar_ml:
I keep getting the same problem that the program will allow charge to the high limit, then keep the battery at that level for ~1hr and then it will continue the charge up to 100% at the same rate (see the images).

This is an over night charge. When I wake up I still see Battery Charge Limit in the notification tray. I think that the fact that it is running stops the OS from resetting the battery stats when it reaches 100%

I tried some version of Battery Charge Limit (last run was with V0.3)

I have a oneplus 5T, this happened on 3 Oreo roms: beta 4, Resurrection Remix & Codename Phoenix.

I use a none dash charger.

Any idea what could be the problem and how to solve it?
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

The problem that I keep seeing is the 6-second charge-discharge cycle, which also leads to a 100% charge after some time. Check whether charging is going on and off after 6 seconds.

I cannot determine what causes this. When I use a charger that delivers around 1 A to my OnePlus One with LineageOS 14.1 and the latest Franco Kernel, it usually (though not always) works fine, charges to 60% in my case, then discharges to 58% as set, recharges to 60%, etc.

However, with the original fast charger that delivers, I think, 2.5 A, it usually goes into the 6-second cycle.

Most peculiarly, I have now used a very thin charging cable that limits the charging current to less than 500 mA, and I also get the 6-second charge-discharge cycle, which seems like a strange behavior to me.

Since it is easy to detect the 6-second cycle, and since the 6 seconds are determined by the app, I keep wondering why this cannot be fixed. If you cannot fix it fundamentally, the easiest method would be to change the 6-second discharge time to, say, 5 minutes when the target percentage is reached. Problem solved, or circumvented. Who cares when the phone is charged for 6 seconds once every 5 minutes?
[Android Apps and Games] shrimetal:
You are missing the whole point of this app.

This app is designed to prolong the life of the battery by keeping the charge limit to 80%.

Even if you don't use this app & keep the phone plugged on overnight, there is no problem at all.
[Android Apps and Games] zohar_ml:
I don't think that I'm missing the point.

I wish to plug the phone in, go to sleep and find my phone with 75% at the morning.

This app works great with my wife's moto G5 plus every night (plugged to quick charge 2), but it will does not work good with my OnePlus 5T.
[Android Apps and Games] davekra:
I'm getting the same charge/discharge cycling. It reaches the set limit, stops charging, waits a few seconds and starts charging again. The other app, battery warner, does pretty much the same thing.

I've got a OnePlus 5, LineageOS 15.1, Kernel 4.4.100-lineage
[Android Apps and Games] JaraCimrman:
Hello,

1st of all: Thank you for this awesome app, finally someone thought of this!

But i have problem with my Samsung S4 mini (i9195) - Nougat 7.1.2 (LineageOS 14.1)

The charging stops at set limit - that is working, but it starts charging again as soon as the percentage drops even by 1%

If i set the start charging below 70% and stop at 80%, it stops charging at 80% but starts immediately again at 79%.

Hope you understand ;)

Thank you for any advice!

EDIT: Downgrading to 0.8.2 solved my problem :)

EDIT2: Solved the problem by restarting the phone everytime i change the charge limit. This made it work even with the newest version of the app.
[Android Apps and Games] post-mortem:
I also wonder why the 6 seconds is hard-coded in the app. I've previously requested for it to be user-adjustable in the settings. At the very least, those of us with issues can try out different settings and report back if longer cycles work.

If other users back me up on this, maybe the devs would agree to turn the 6 seconds into a setting we can choose.

Android should automatically reset battery stats when the battery level is at 90% or higher and you unplug from the charger. Since your picture shows that the battery is at 100% but the stats have not been cleared, that indicates that the phone is still attempting to charge, even though the battery is at 100%. My guess is that either there's an issue with your battery, or perhaps the control file(s) you're using are not appropriate (or maybe even the permissions are wrong).
[Android Apps and Games] ReedN:
I am seeing a behavior where sometimes it will actually stop charging when I arrive at my specified charging limit. However, sometimes it says it is not charging, but I'll see the battery charge percentage continue to increase until it reaches 100%, all the while it is reporting that charging is not enabled.

I'm baffled, but it sounds like this might be the same type of behavior you are talking about.
[Android Apps and Games] davekra:
I've had it say charging has stopped but AcuBattery shows that it is still charging. The battery percentage doesn't go up and when unplugged it doesn't go down till the voltage matches the percentage shown.

Disappointing that the app no longer works. I firmly believe keeping the voltage under the max is good for the battery.
[Android Apps and Games] xxexusxx:
Didnt work on Android 7.1.1 with miui 8.5 (Xiaomi mi mix 2 rooten)
[Android Apps and Games] ReedN:
I tried the option "Always Write Ctrl. File" and it looks like that may have fixed things for me (Nexus 5) and for my wife's phone (Nexus 6). From what I understand of this option it writes the battery control file, even if the app thinks it contains the correct value already.

Is optimizing out a few writes to the control file worth all the bugs people are experiencing? Given my experience, I believe that the default option should be to always write the ctrl file.

I think one other potential problem is when the battery optimizer built-in to the Android OS kills the App. It is necessary to remove 'Battery Charge Limit' from the list of Apps it can 'optimize'.
[Android Apps and Games] SGH-i200:
Moto G2 LTE (thea)

The app is working great on my Moto G2 LTE (thea) on Lineage 15.1! :good:
[Android Apps and Games] hck:
Confirm.

It would be great to have appropriate changes in app.
[Android Apps and Games] syafeeq05:
Thanks for the awesome app, but the app crashed when I connect the charger. Tested on Xperia E, stock ROM.
[Android Apps and Games] Galaxea:
Same for me on OP3 and OP5T suddenly.
[Android Apps and Games] Bobbaloo:
[MENTION=6898873]sriharshaarangi[/MENTION] , I see some people having problems. I just wanted to let you know that on my Nexus 6p, no matter what rom I'm running this app has been working just fine for a long time. I don't use it all the time but, when I do, it works. Beautifully! Thanks for it!!

?:good:
[Android Apps and Games] ReedN:
I tested code changes about a month ago and created a pull request. The developer made a variant of these changes and incorporated them into the code:

https://github.com/sriharshaarangi/BatteryChargeLimit/pull/92

It should come out in the next version, whenever that is.
[Android Apps and Games] zohar_ml:
I decided to test the problem I have with my OnePlus 5T (it will stop at the high limit but then after some time it will continue to charge up to 100%)

I disabled Battery Charge Limit, took a USB power meter and changed the control file using Solid Explorer. I found that the problem is coming from the OnePlus rom and not from this app!

I changed \sys\class\power_supply\battery\charging_enabled from 1 to 0, the charging icon changed to not charging and the power meter displayed that the current dropped to 0.

After some time (twice it was almost immediately) the power meter displayed thet there is a high current, but the battery icon did not change to charging.

I left it in this state, the battery % did not changed, but I did saw \sys\class\power_supply\ battery\voltage_now is getting bigger (meaning the battery was charging).

I also saw that \sys\class\power_supply\battery\current_now is negative (meaning the battery is charging).

I then changed \sys\class\power_supply\battery\charging_enabled from 0 to 1 and back to 0 and this made the charge current drop back to 0.

I've waited for more than an hour in this state and the charge did not started.

I only managed to get twice (in an evening) to this hidden charge state while charging_enabled=0

Next I will try to write a Tasker code to try and catch this stat and reset charging_enabled.

I intend to use:

\sys\class\power_supply\usb\present to know if the USB is plugged in.

\sys\class\power_supply\battery\current_now to see if there is a charge when there should not be.

\sys\class\power_supply\battery\charging_enabled to stop the charge.
[Android Apps and Games] davekra:
Interesting...I've got to read this a few more times...

I'm currently using Lineage OS 15.1. Would some of OxygenOS be left that would be messing it up?
[Android Apps and Games] cloves:
Curious as to whether someone could explain how the github control files work. For example someone was working on a control file and it seems they made changes and the final comments show merge into master. So does that mean the developer has rolled in the changes into the current version? I don't see a way of downloading the control file on that github thread.
[Android Apps and Games] syafeeq05:
Sorry, here is the correct log. App crashed when connect charger.
[Android Apps and Games] zohar_ml:
I wrote the Tasker code and it is working great!

I leave my OnePlus 5T connected over night and it will not go over the high limit I set.

I did found out that the way to stop the hidden charge state is to change the value of

/sys/class/power_supply/battery/input_suspend from 1 to 0 and then back to 1

From the log file that my code create I saw once that this hidden charge started more then 30sec and less then 2min after charging_enabled was set to 0.

I've logged this in the GitHub, issue #104

=====

4.4.18:

Had a bug in the code (I did a small wrong edit before exporting it) I changed the xml to the correct one.
[Android Apps and Games] kulguy:
It doens't work on my device.

I found there isn't charging_enabled file in \sys\class\power_supply\battery..Instead it has a file named status, which alternate between Charging and Discharging accordinly with charging status.

But, when I connect a charger, the file isn't affected by this app, still showing Charging, and battery is actually charging.

Does it mean I cannot use Battery Charge Limit on my device?
[Android Apps and Games] zohar_ml:
This is now the second night in a raw that the tasker code only detect the hidden charge but cannot stop it!

up to now changing the value of/sys/class/power_supply/battery/input_suspend did stop the charge but now it did not.

I even tried to manually change the value of both charging_enabled and input_suspend but it did not help. I had to manually disconnect the USB cable.

At least I get beeps from tasker so I know to disconnect the cable :p
[Android Apps and Games] Spaceoid:
I have a Samsung Galaxy S4 Mini, and for me the app does not work. I am new to the topic and have not much knowledge about the different usable files and settings.

If I plug in my phone, the service starts automatically. If the limit is reached, the screen switches on, the phone still continues charging though.

Am I doing something wrong? What can I do/try to make it work? Thanks in advance!
[Android Apps and Games] guest4711:
Did you read the instructions in OP [APP][ROOT][4.0+]Battery Charge Limit v1.1.0 - https://xdaforums.com/android/apps-games/root-battery-charge-limit-t3557002/post71040651 ?
[Android Apps and Games] hansxl:
My daughter also has a S4 mini, which has custom rom installed and is rooted. I just installed this app and made it active and left configuration all default. Works as a charm :)
[Android Apps and Games] Spaceoid:
I have read the instructions. My phone is rooted, running on LOS 15.1 I installed the app, only changed the limits, activated it, and thats it. I updated my ROM the same day (no new Android Version Number, only dirty flash of newest nightly), might that be a problem?

Edit: Right now it works! My phone is plugged to the computer and stopped charging at the limit. But if I charge it normally, it never stays at 80%...
[Android Apps and Games] Galaxea:
Sadly it has never worked on my S3 mini. I would happily pay for it to work...

I have tried multiple ROMS. All rooted.
[Android Apps and Games] post-mortem:
Myself (and a few others who have reported the app not working right) have found that the app does work as intended when being charged at only 500mA (such as from a computer USB port. Somehow, charging at 1 or 2A makes the phone charge to 100%.

In other words, try that, at see if that works, at least.
[Android Apps and Games] ash001:
These are the files in that directory ...And I don't have that file...
[Android Apps and Games] Mohammad_pd:
Unfortunately,Nothing There!
[Android Apps and Games] tcchuin:
Hi, I've found the file to edit for Huawei Mate 9. Tried editing it manually and it works well!

It'd be good if you can add support for it
[Android Apps and Games] gohamstergo:
[MENTION=6898873]harsha1397[/MENTION] of note, I've mentioned charging getting stuck, just wanted to point out that once it reaches the limit, it stops charging even if left on the charger.
[Android Apps and Games] ssechaud1982:
HTC One M8 on LineageOS app seems to work but continues to charge beyond the limit. /sys/class/power_supply/battery/charging_enabled exists.

Nexus 9 WiFi on LineageOS app seems to freeze with the please wait notification. /sys/class/power_supply/battery/charging_enabled does not exist. See screenshot attached.
[Android Apps and Games] ashutoshmn:
Please add the functionality that when you reach the set battery value, it just reminds with a sound notification but does not turns off charging so that user can manually turn off the charger, that will be really helpful to those also for which this app is not working as expected.
[Android Apps and Games] real_milux:
Hello everybody,

in case anyone is interested, I created a flow for the automation tool "Automate" of LlamaLabs.

It charges until 80 % when charging starts between 0:00 and 9:00, until 65 % the rest of the day.

It requires one of battery_charging_enabled, charging_enabled or store_mode to be present.

The flow will maintain the precise level in %, so for charging_enabled it might fluctuate quickly, although I don't think that's a problem.

Any suggestions for further improvement, additional control commands etc. welcome!

https://mega.nz/#F!Eg8xXBSB!LOxAaBirHEdoQkR8PCLA8A

Regarding Samsung (in my case, Note 10.1 2014 Edition): For me, switching "store_mode" to 1 freezes the percentage at the current level, I didn't see any other behavior (yet?). And while it's true that only unplugging can start the charging again, I don't see how this is relevant when the device maintains the capacity until power supply is removed, anyway. Can somebody explain how that can be a problem?
[Android Apps and Games] frequentc:
lol.. You're right. store_mode should work fine for what we're wanting to do.

I've been sick with the flu and bronchitis for the past few weeks, so clearly it has affected my thinking ability.
[Android Apps and Games] blueberry.sky:
There are already many apps in the play store with that functionality. Search battery alert or alarm.

It looks like automatically disabling charging simply might not work on a few devices. For others it might just require users to manually test files, find a combo that works & report it.
[Android Apps and Games] HikingMoose:
Awesome sounding app man! I've been trying this whole 40-80% thing, and it's really a huge pain in the neck so far. But this might help.

OK, so I was just directed to this app about 10 minutes ago, I've read a few pages, but not a lot of the thread, so I have 2 questions that I hope no one minds me asking:

1. Where is the download link, I must be overlooking it somewhere!

Nevermind, I found the initial build, it was just hidden a little bit by Tapatalk (they added it to the gray box that the first screenshot was in). I was looking for a Download header and the link below it.

Found the newest app too! Phew, it took a lot of digging. Just to help people out, I'd suggest adding the new versions right in the OP as that's kinda customary. And maybe separate it from the screenshot by a blank line for people using TT.

2. My phone typically doesn't even drop 1% overnight, so would it only charge to 80, and not charge again for the next however many hours?
[Android Apps and Games] billubakra:
Thanks. Will check and get back to you. Is there any software like this for laptops?
[Android Apps and Games] HikingMoose:
I've been looking for a way to clear my build in battery monitor stats for a week a two, because that's the biggest drawback to be with the whole charging to 80% thing.

Well, that and the fact that I have to carry chargers around so day.

Does this wipe the actual battery stats in the phone, making it recalibrate itself every 6 hours even you charge to 80%? I just need to reset my battery usage stats, not the battery calibration stats.

If it's at all possible, a button within the app that could do what Android does when you charge to 90% or over, and it resets is battery usage stats, that would be amazing and donation worthy (it already is worthy, but it would be worth MORE).

Same question, does this reset the battery usage only, or does it wipe all of your battery calibration stats?
[Android Apps and Games] blueberry.sky:
v0.2 is just a test version. He did say he would move into the OP if works well / has no problems. Only differences from v0.1 appear to be 1) the option to use 2 different files found on some Samsung or Pixel/Nexus devices. 2) Max limit is 99% instead of 95% (not very useful but someone asked for it).

It will charge again when it drops 3%. However some devices will never drop while plugged in (runs on AC instead of battery).

I have used

su
dumpsys batterystats --reset

and it does not appear to wipe calibration for me. But your device could potentially be different.
[Android Apps and Games] Zycat:
Ok, so the app won't start when the charger is already plugged in before starting/rebooting. Also, sometimes it randomly closes on MIUI 8 (already disabled the MIUI battery management for this app). If you can make it auto-start. Also, configurable battery range instead of the default 3% drop then charge would be good.
[Android Apps and Games] HikingMoose:
It appears opening batterystats-daily.xml and deleting everything but the beginning and end and then restarting wires battery usage too! I don't think it would touch calibration, where is labeled daily battery usage.

Edit: maybe I spoke too soon. It's not clearing it now. I don't understand why it worked once, but not the next night.
[Android Apps and Games] triad88:
Does anybody use slimrom 5.1.1?i can only find a file thats called batt_lp_charging and i cant change the file. It gives a:

Operation failed. Message:echo:write error: invalid argument.

Using it on mine old note 3.program hangs on the note 3 on slimrom 5.1.1

On the 3t it works perfect!
[Android Apps and Games] xzeus01:
Works ok on Redmi Note 3 Pro Int. (kate) with Lineage OS. The only issue is that the app did not disappear after unplugging the USB cable. Thanks.
[Android Apps and Games] maik005:
I have the Galaxy S7 (G930F) with Nougat firmware.

I found the best solution - for me.

the file /sys/class/power_supply/battery/store_mode

If I set this to "1" without the "" the phone will charge the battery up to 70% and then keep it at exactly 70%.

The is only needed to set to 1 once after reboot - as it can´t be changed anymore after this. When rebooting the phone the file is back to 0 and the phone charges fine till 100%.

If the phone is above 70% and the file is set to 1 the phone does not charge the battery till it is at 70%

If the charger has not enough power the phone uses power from the battery - but keeps the battery charged at exactly 70%.

It dows not matter how I charge (wireless, fast wireless, USB from PC, Fast USB Charge...) the battery is max charge to 70% with the store_mode set to 1.

It looks like it is not possible to configure other percentages.. it does not matter at which percentage I enable the store_mode.

I think it is the perfect setting for me (with the Galaxy S7) works with every charging source and 70% max without the 3% discharge/charge should improve the batterylife, I hope.

It is the same as the phone normal works beside that it did charge only till 70% insted of 100%
[Android Apps and Games] Mayex:
How do you limit charge on laptop? Can you share please?
[Android Apps and Games] Ace42:
There's nothing for me to share, sadly. It's a stock feature that's present in some Lenovo models—such as my Y50-70. It's not a common feature, and I think some Sony and Toshiba laptops offer it too.

You'd have to buy a laptop/tablet with this specific feature. Mine has an unchangeable limit (60%).
[Android Apps and Games] fidgetymo:
That's what I've discovered as well. Would love to use it.

Using bacon los 14 sultan rom
[Android Apps and Games] Spaceoid:
Yeah, same for me!
[Android Apps and Games] ReedN:
Any thoughts on when the next version is going to be released? I'd love to see the permission settings fix updated into an official version instead of using my own compiled version.
[Android Apps and Games] :
Feature request

Hi,

thank you for this awesome app!

I have a feature request: let's say my phone needs 1h for 30-80% battery. Wouldn't it be better to charge it 1 hour before I get up? So a setting to say "charge to x% at Target time" (would require that the app to learn how long device needs to be charged) or "start charging at xx:xx" would be pretty cool

Greets :)
[Android Apps and Games] xclub_101:
It work as intended 99% of the time on my Pixel 2 XL but from time to time it gets as if the app is waiting for something in a critical loop without handling anything else (including painting) and as such it looks like blocked for 10-20 seconds. Usually after that it recovers, but sometimes it can take longer and the high CPU usage gets triggered by it.

Anyone else seeing similar stuff?
[Android Apps and Games] jonahmt21:
App gets killed on my OP5T running Oreo. App is set to don't optimize on the battery setting. Any suggestions?
[Android Apps and Games] post-mortem:
If you use Greenify (or other, similar apps), make sure you whitelist this app.
[Android Apps and Games] XDAMaxe:
anyone using this fantastic app with OxygenOS Open Beta 7 (Oreo 8.1) on One Plus 5 ?

With Nougat (OxygenOS 5) V 1.1.0 runs fine (file /sys/class/power_supply/battery/charging-enabled exists) but with Oreo 8.1 it works once (/sys/class/power_supply/battery/charging-enabled exists too) but after cut off charging by the app (80%) phone won't be recharge at the set level (75%). In other words: phone will discharge with plugged charger until zero ...

Any idea ?
[Android Apps and Games] jonahmt21:
Uninstalled greenify and it still gets killed.