yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] post-mortem:
As reported previously, sometimes the OS kills the app, allowing charging to resume to 100%. I even posted a logcat where I captured the moment when the OS killed the app, but it doesn't seem to have made a difference. Personally, I feel that a permanent notification might prevent the app from getting killed by the OS, but this feature has yet to be implemented. I continue to use this app anyway, even though it only does its job 20% of the time.
[Android Apps and Games] blueberry.sky:
Please see this post :cowboy:

---------- Post added at 05:11 PM ---------- Previous post was at 05:09 PM ----------

You could just post your control file here & the devs can add it. Then others can benefit as well.
[Android Apps and Games] m0_onriver:
anybody using mtk device here?
[Android Apps and Games] FPSUsername:
[MENTION=6898873]sriharshaarangi[/MENTION] I have a pretty bad usb cable and when it disconnects, the battery notification doesn't always disappear. I have to disable and enable the app again. The widget isn't very responsive either, I have to wait about 1 to 2 seconds for it to switch its state.
[Android Apps and Games] luigi0824:
works on my mi 5 but does work on my xperia s
[Android Apps and Games] Pilatus47:
Working great on my Nexus 6P, with the ODP3.

Saludos

Enviado desde mi Nexus 6P mediante Tapatalk
[Android Apps and Games] Chainz11:
Help to make it work for Lenovo A5500H

First of all I want to thank the developers, great app.

I wanted to ask for some help. I located the file responsible for the charging state on my rooted Lenovo A5500H.

It is in /sys/class/power_supply/ac/online

And I edited the apk and added it to the control_files.json file

the program it self works but... the file cannot be changed:rolleyes:

My problem is when I try to change the value, even manually with ES file manager with root access I get an error message saying "An error accured while trying to save the file. It wiil not be saved"

Any ideas why I get this error and how to fix it?
[Android Apps and Games] post-mortem:
You sure the partition is writable? Try it in a terminal emulator or in adb, and see if you also get errors.
[Android Apps and Games] nelsongeorge:
nice post
[Android Apps and Games] Chainz11:
I just tried to create a new file and a folder in that directory and it gave me the same error, so I guess the partition is not writable it's a dead end, unless there is a way to make it writable :fingers-crossed:

---------- Post added at 01:18 AM ---------- Previous post was at 01:12 AM ----------

I think I just found my answer http://www.theandroidsoul.com/make-system-writable-android-7-0-nougat/
[Android Apps and Games] acejin:
This app is so useful, I just installed it and it works perfectly!
[Android Apps and Games] post-mortem:
That will work, but you should remount as read-only when you're done, and that site doesn't tell you how [change "rw" with "r"].

An easier way is to do it from within your root-capable file browser, such as Solid Explorer or Root Explorer.
[Android Apps and Games] Chainz11:
Thank you so much for the rplies.

It seams that it won't work I tried busybox with the command mount -o remount,rw /system

This doesn't seem to chage anything I still can't edit files

I also tryed Solid Explorer granted wr global permissions I was able to manualy chage the value in the file but then the tablet restarts

Any suggestions?
[Android Apps and Games] aamadorj:
My N6P powered by PureNexus and rooted with Magisk v13 beta doesn't allow to reset battery stats with "dumpsys batterystats --reset" command, same as mentioned before by another Battery Charge Limit user.

Newest PureNexus just added an option to reset battery stats and it seems that's done with this commit: https://github.com/PureNexusProject...mmit/48fe97486e4219912d65eedfccc1b1424f92e49e.

Can this method be added to Battery Charge Limit as an alternative to the dumpsys command, [MENTION=6898873]sriharshaarangi[/MENTION]? My apologize if this is a total nonsense request. I'm just an Android enthusiast. :)
[Android Apps and Games] post-mortem:
Make sure you're properly rooted. Which root method did you use, and which type of su (SuperSU, Magisk, Lineage, etc.)?
[Android Apps and Games] Chainz11:
I'm ashamed to say that I used KingRoot, but I found that it works on devices that are with a small comunity and that there aren't custom recoveries for them.
[Android Apps and Games] tassos_chry:
Just clean flashed latest PureNexus with Magisk on my 5X. Haven't yet tried if the automatically reset battery stats feature works now that the option is baked into the ROM itself. Does it still not work for you?
[Android Apps and Games] aamadorj:
New PureNexus battery reset stats feature works perfectly, but it is not applied automatically at the charge level set with Battery Charger Limit.

I would like to use the BCL automatic reset for that matter, but the dumpsys command included at this app is not working.
[Android Apps and Games] post-mortem:
Have you tried using a root checker app to see if you're properly rooted?
[Android Apps and Games] Chainz11:
Yes I verified it with root checker. And it says your device is successfuly rooted.
[Android Apps and Games] blueberry.sky:
It appears that on some devices, the file just can't be modified, regardless of root or r/w permissions. Others have run into this as well.
[Android Apps and Games] XomBolf:
Does this app also work with android O?
[Android Apps and Games] Midomad:
You could test!
[Android Apps and Games] XomBolf:
I would, but Android O isn't available for my OnePlus 2 yet
[Android Apps and Games] zaidrpm:
Hello, i have seen posts on internet saying that trickle charge(which happens over 90%) is healty for battery. Moreover i found that if we charge our device from 75% to 100% then we will get 1200-1500 charge cycles whereas if we charge from 50%-100% then we will get around 800-1000 cycles.

This is confusing me if i should put limit on charging or not.
[Android Apps and Games] hgmichna:
How to charge a Li-ion battery

That would confuse me too. It is completely wrong.

What is correct is that before getting completely charged the charging electronics change gradually to trickle-charging, because fast-charging to completely full would damage the battery even more.

The simple rule is that Li-ion batteries live very long when the voltage is kept relatively low, like below 3.92 V, which corresponds to about 60% charge. Charging them to 80% is a good compromise between lifetime and power. Time spent at lower voltages does not age the battery. These batteries suffer most at high voltages like 4.3 V.
[Android Apps and Games] Bimm3r:
Nice app, testing right now.
[Android Apps and Games] tombraga:
Lenovo Yoga Tab 3 Plus:

Charge Limiter (z.B. 80%) working excelent with Ex Kernel Battery Monitor checked by Screen Split function of the crDroid v3.4 Android Nougat

https://vimeo.com/221997623
[Android Apps and Games] Jerry060599:
This doesn't seem to play nice with my exynos S8 on the stock ROM. The store_mode file doesn't seem to work. Using the battery slate mode file, the phone charges to the charge limit, but starts recharging as soon as its bellow that, ignoring the recharge limit, which is kinda annoying because the phone dims the screen and plays an animation every time. It keeps logging "Fixing state w." in logcat, so it looks like its fighting the os over the battery. Is there any way to fix this?
[Android Apps and Games] Einheit-101:
Doesn't work on a droid turbo.

Battery stops charging on the designated limit, but it doesn't re-enable charging ever, if I want to charge my phone I need to reboot.
[Android Apps and Games] zakaria12:
very funny i get problem i was using this app i was configured it to stop at 97% after a while i flash other rom and the charging still stop at 97% without using the app , so how to fix this problem ???????
[Android Apps and Games] post-mortem:
Install the app, turn it on, turn it off, uninstall, reboot. See if that works.

Or you can try to get logs. Charge the battery to 96%, start recording logcat, charge to 97% and it stops charging, stop logcat, evaluate the logcat to see why it stopped.
[Android Apps and Games] real_milux:
Version 0.10.0 released

The recharge threshold can now be customized between 0 and the chosen charging limit.

Sending a charging limit of 100 via (broadcast) intent will disable the service.

Sending values between 40 and 99 will enable and start the service if it was previously disabled.

---------- Post added at 06:42 PM ---------- Previous post was at 06:39 PM ----------

Please provide the relevant logcat stuff with time tamps (at least seconds resolution), will see what I can do. ;)
[Android Apps and Games] zakaria12:
Yes I did it and its work but still one problem the LED on my phone its off att 97%
[Android Apps and Games] Jerry060599:
Here is the log:

https://pastebin.com/JpSvvdwp

I have my recharge limit set at 58% and charge limit at 60%. I manually charged to 60% with the charge limit service off, unplugged the phone, enabled the limiter, and plugged it back in. I filtered the logs with the keyword "CHARGE" in the logging app, since I don't have android studios set up yet on my laptop. So, if the keyword didn't catch anything you need, tell me and I'll try to relog what I can. Tks for the help :D
[Android Apps and Games] moldirty:
Thanks for this useful app. It is very effective and works well on my S8+.

I noticed that the app didn't reset statistics while using wireless charger. Reset only when USB line is used.
[Android Apps and Games] aamadorj:
Differences when using Battery Charge Limit with Magisk v13

When I started using Magisk v13 (beta) on my N6P running lastest PureNexus, I notice Battery Charge Limit behaved differently and sometimes it gave problems after reconnecting.

When rooted with Magisk v12 (stable), I was used to see the "Battery Charge Limit enabled" toast as soon as I plugged the power cord in and the "Battery Charge Limid disabled" toast right after I unplugged the power cord. Also it was possible to replug the cord immediately and the enabled toast will show again.

With Magisk v13, the first toast is usually showed but the second one never shows and very often if I plug the power cord again Battery Charge Limit will not work as intended.

The logcats I capture just before I plug the power cord and right after I unplug it with each Magisk version installed are attached, in case the expert eyes of [MENTION=6898873]sriharshaarangi[/MENTION] or [MENTION=6929614]real_milux[/MENTION] can detect the cause of the different behavior.
[Android Apps and Games] slgooding:
Similar issues here with magisk v13.
[Android Apps and Games] warface9991:
Xiaomi mi5s lineageos nougat doesn't go into deep sleep after unplugged when using this app. However when i reboot my phone it does go into deep sleep. How can I fix this?
[Android Apps and Games] Tiraelforever@gmail.com:
Excellent thanks, I really would like you to add the function of turning off the smartphone at a configurable level of minimum charge ...
[Android Apps and Games] eried1:
How long does it take? I don't think it's working on my Lenovo P2. I'm using Magisk if it's of any help.

So the dumpsys command does indeed work? Then I suppose one could try to some automation app. Tasker hasn't received Magisk root support yet.
[Android Apps and Games] GoldenPeperoni:
Awesome thing to do thanks !!
[Android Apps and Games] gerlium:
After upgrading from Android 6 to 7, the problem disappeared!
[Android Apps and Games] eried1:
Been thinking about the issue with Magisk. Has anyone tried to install it as a system app (using systemizer, for instance)?

Edit: Apparently didn't work.
[Android Apps and Games] Kenji242:
Tested on a Huawei Mate 9 with Custom Kernel. The limit was set at 83%. In really it is currently up to 87% :) Does anyone know why the difference? @ Very nice that it works at all. Good conscience that despite 5.2 amper charging current its battery a little to spare. thanks!
[Android Apps and Games] Haku98:
Works on OnePlus 5

[MENTION=6847351]harsha139[/MENTION]7, [MENTION=6929614]real_milux[/MENTION] and [MENTION=6898873]sriharshaarangi[/MENTION] etal. A big thank you to all of you for this great app! I was waiting for this for a very long time :)

A first test on OnePlus 5 with OOS 4.5.3 and SuperSU: All seems fine using 'charging_enabled' and levels set to 65/64. I'll use it for a few weeks to see how things go. I wonder if the phone could be put in deep-sleep once the upper charging limit is reached.
[Android Apps and Games] XxFireDragonxX:
Hello,

is it possible to support ELE Phone P9000 ?
[Android Apps and Games] Yoshi_523:
Hi to the Developers,

Firstly I wanted to say that i love your app! I looked high and low for a charge limiting app all over XDA and the rest of the internet with no luck last year so I gave up. I was so happy to stumble apon this app this year! GREAT!!

I have a feature request for a future update of your app (if you are willing and able to add this feature). I would really like have an option to limit the charge current to 1 Amp (1000 mA) so as to disable the fast charge feature and not ware out the battery so quickly.

My (Real not fake) Samsung S4 batteries get hot almost immediately after starting fast charge when they are quite drained. I am reading 5V and 2A output from the charger when the battery is drained. I've read many S5 and S6 users say the same about the battery getting hot on fast charge. (I won't even bother getting into the more recent phones such as the S7 Note!). So far I have only found out two solutions to this problem:

1) You use an ungrounded (cheapo) USB cable on the official Samsung charger as this will only allow it to charge at 500mA max (same as charging from any standard computer USB socket). This is really too slow a charge time for most people.

2) Use a quality phone charger of another brand that has a maximum of 1 Amp output along with your original Samsung USB cable or another quality cable that is grounded. Myself and others find that 1 Amp does not heat up the battery and still charges the phone with good speed. I use my old HTC phone charger. Others have said they have used an Apple iphone 1 Amp charger.

*You can check a USB cable is grounded by using a multimeter to test there is an electrical connection between the metal socket of one end (standard USB end) of the USB cable and the metal socket of the other end (micro USB end).
[Android Apps and Games] burattino:
using latest app ver. (0.10)

on SGN5 (920p)

Android 6.0.1

charging always stops @70% !!!

all setting are left untouched (stop charging @80% / store_mode)
[Android Apps and Games] frequentc:
I think I found what we need to disable the charging on Samsung devices:

/sys/class/power_supply/battery/store_mode

By default, this was 0, but when I changed it to 1, it stopped the battery from charging (verified by going to the battery page under settings).

I played a game for 5 minutes after changing this to make sure the phone was still running off of the power cable, and it kept the battery charged at the same level without discharging any further. I also let the phone idle for 5 to 10 minutes, and the charge also didn't increase any further.

This was on a Samsung Galaxy Note 3 running stock lollipop 5.0.

Edit:

You may still see the charging battery icon, but the battery percentage should stay the same.

And if you want to enable charging again, you'll need to change store_mode back to 0 and unplug/replug the charging cable or reboot.
[Android Apps and Games] blueberry.sky:
This is absolutely fabulous!! :laugh: You could use a donate button. I've wished for this since my first phone. I didn't think this was controllable (previously I was using a high/low battery alert app that required unplugging).

Feature request: Could you add an optional low battery alert? User set value. Then it will completely replace high/low battery alert apps. I understand that when enabled, the option would require a background service.

Btw, Moto E2 (xt1526) works. Verified by physical usb current/voltage monitor.
[Android Apps and Games] almightysiman:
it doesn't exist.
[Android Apps and Games] crasydawaki:
tried on Xiaomi Mi3 running Resurrection Remix 5.7.3 and it works well, no bugs so far, hoping for more features from these app :good:
[Android Apps and Games] almightysiman:
I maybe find the keyon my Pixel.when I set echo 0 > /sys/class/power_supply/battery/battery_charging_enabled.the charging current will become -3ma.although it still show charging,but it actually stop charging to the battery.
[Android Apps and Games] sriharshaarangi:
WoW! Thanks a lot for the information. Can anyone confirm this on other Samsung models? If it works, I will be adding it to the app!
[Android Apps and Games] sriharshaarangi:
Great! I will be adding it to the next version!
[Android Apps and Games] sriharshaarangi:
Sorry, but I couldn't understand what you meant exactly
[Android Apps and Games] sriharshaarangi:
I appreciate the feedback given by the users. Thanks a lot!

Based on the feedback, here is the current todo list:

-Add support for Samsung devices

-Add support for Pixel devices

-Allow the limit upto 99%

-Create a widget for quick toggle

-Notification alert when charge reaches specified limit

-Improve UI

Right now I am having exams, so I will not get time to work on this. After my exams, I will be working on above mentioned list.
[Android Apps and Games] kimpot04:
It exist... I'm trying it now...feedback later

Samsung Galaxy Grand Prime running Ressurection Remix Rom Android 6.0.1

Edit: Not working :(

Edit Again: Charging stops.. the charging bolt is still there.. but when you unplug the charger.. the percentage suddenly increases.
[Android Apps and Games] bryantshurley:
Thanks you much
[Android Apps and Games] Snoe II:
Nice to hear that. ? Thanks again for the great app. Best of luck for your exam ?
[Android Apps and Games] frequentc:
Yeah, the charging bolt also shows on my battery icon in the status bar, but it's not charging (verified by the battery section under Settings). When I unplug the charger, my battery percentage doesn't increase any.
[Android Apps and Games] Cookie_93:
/sys/class/power_supply/battery/store_mode works for me aswell. Checked current_now in the same folder, which usually shows the current drain(-)/charge, which is 0 with store_mode 0.

Also, for me it didn't increase/decrease in charge when pulling the cable out.

S7Edge Superman Rom 2.2 Android version 7.0

And hope you do well on your exams! (:
[Android Apps and Games] StonebridgeGr:
Go back to stock
[Android Apps and Games] MPJINFiNiTE:
Was looking for this functionality for so long. I even bought AccuBattery thinking the paid version could do this! But it doesnt, it just gives a sound notification on reaching the limit but still keeps charging. Kudos to you!

In my case ( Xiaomi Redmi 3s on Lineage OS 13) there are 2 files CHARGING_ENABLED and BATTERY_CHARGING_ENABLED. The former one disables charging as a whole ie device runs on battery power (donno if power from charger is getting wasted). However the latter one disables charging of battery and the device runs on AC power! This in a sense would be much better. Dont know if other devices have similar functionality.

Would be great if you could check that for the next update.
[Android Apps and Games] logosA:
thank you for your advice, you could see that I WAS talking about stock in Note 4

---------- Post added at 12:14 PM ---------- Previous post was at 12:10 PM ----------

Any way I was just trying to give some feedback here and not trying to open any kind of debate .

That is not my intension , never was my purpose all these years i am in xda.

but Its not the way : when the facts dont agree with us, to bad for the facts''

This is why I always use screenshots, because screens dont lie
[Android Apps and Games] logosA:
Yes it is here in samsung note 4 runing stock(rooted) MM 6.01
[Android Apps and Games] sriharshaarangi:
I have that file. Let me check it

Update: battery_charging_enabled file is always 0, even if I am setting it to 1, and phone continues to charge. Can anyone else try this?
[Android Apps and Games] chudy_85:
View attachment 4045562

I dont have this file in Huawei Mate 7 because i have bariery Li-Poly
[Android Apps and Games] mochamoo:
Battery stat reset isn't working for me. Am guessing that it is because I have Magisk 12.0 installed. I have searched the thread but am not seeing a workaround. Is there one?
[Android Apps and Games] hgmichna:
Stopped working

I had been a very happy user, but for a few weeks now the app has stopped working. I always use the latest version.

In fact, it has not entirely stopped working. When I connect the phone to my computer during the day, it works perfectly. But at night, connected to a strong charger with a good USB cable and as always running a sleep sensing app, it fails, i.e. I wake up in the morning to a 100% charge. In my tests I connected the phone in the evening with the remaining charge around 40%.

My settings have been: charging to 60%, recharging when 5% lower, i.e. from 55%. The phone is a OnePlus One with LineageOS 14.1 (Android 7.1.2), updated every few weeks. The charge control file is: charging_enabled (Generic). I have never changed it.

I have observed twice that the app switched rapidly between charging and not charging while the phone initially displayed 60%, altogether yielding a slow charge, up to 100%, I presume, if I had not stopped it.

The problem started around the time of the release of the app version 0.10.0. Would it make any sense to retry the second-last version? Were there any relevant changes between these versions? I don't have it any more though.

Is there anything I can do to help making it work again?
[Android Apps and Games] juppi:
Is there a way to set "store_mode" on Samsung phones without having root?

I think there could be a magic number or a hidden service menu that could set "store_mode" to "1"...
[Android Apps and Games] sriharshaarangi:
"I have observed twice that the app switched rapidly between...." This might be the problem:

https://xdaforums.com/showpost.php?p=72217729&postcount=579
[Android Apps and Games] hgmichna:
Rapid charge-discharge cycle

Thanks for looking into this! Too late now to look at the charge state; will have to wait until it happens again.

The times are several seconds charging, roughly 5 seconds, then a similar time, perhaps a bit longer, not charging. The charging light, which I have enabled, goes on and off during the cycle.

If you cannot prevent this altogether, you could try to cultivate it by enforcing a lengthy delay before changing, something like a few minutes. If the phone charged for a few seconds every couple of minutes, that would not hurt much. I know, I know, it's far from perfect, but it would solve the problem in a primitive way. I don't understand exactly how the app works though. It must be more complicated that one first thinks, otherwise you could simply prevent any charging when the high percentage is reached.

OnePlus One, LineageOS 14.1 (Android 7.1.2), stop charging at 60%, begin charging again set 5% lower, below 55%.
[Android Apps and Games] Roberto_Sampaio:
Hi,

First, I loved this app !!! Very usefull...

But I have a qusstion: If the life of the battery is direct affected by the voltage, why not to set the maximum voltage instead the % of charge?

Hugs !!!
[Android Apps and Games] aamadorj:
The reason is explained here: https://github.com/sriharshaarangi/BatteryChargeLimit/issues/12
[Android Apps and Games] Maaz Muzammil:
works
[Android Apps and Games] ewtoombs:
That article on Battery University is like 7 years old now. Are you sure it's still relevant? Do you have stats on newer phones made in the last few years?
[Android Apps and Games] hgmichna:
Battery University

Good question, but Li-ion batteries probably still have the same properties.

Anyway, does anybody have any good information?
[Android Apps and Games] jeremmie:
Afaik the battery technology we're still using from the day the test was done still hasn't change... Graphene batteries are still under research(probably not economical because its hard to create and the diffetence is negligible)