yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] Squabl:
I had to disable battery optimization for the Battery Charge Limit to get it work reliably. Maybe your issue is different but I haven't had to disable and enable battery charge service after disabling battery optimization for this app.
[Android Apps and Games] Redhawk2000:
I know the voltage was removed from the notification shade due to possible inaccuracies while charging and for space, but would it be possible to add the "option" in settings to show the temperature and voltage for any who want it to be shown? I often like to check the temp when charging to avoid overheating so when it was removed it seemed like it made the function worse for me because I have to open the app now to see that.

Edit - If I could be so bold, what would be amazing would be to be able to show not only the temperature in dropdown notification, but also the charging current like what Ampere would show.
[Android Apps and Games] :
I think a settings switch to enable temperature can certainly be added. As far as other battery info, that is not my strong suit so we will have to look into it.
[Android Apps and Games] Redhawk2000:
The play store version of this app is published by "Slash". The same developer apparently has one other app ("Electron") that displays charging current. Perhaps some kind of merge is possible. Cheers.

Edit - though I now notice that app hasn't been updated since 2016.
[Android Apps and Games] :
Well, if you have no idea, then I wouldn't worry about it. But it's used to test files that seem to control the charging on a device. All devices and software have a bunch of different files so if your device isn't supported and you think you found the location, that is how you can test.
[Android Apps and Games] devsk:
This app does not work on HTC phones (10 and U11+ that I have). The only thing that works on HTC phones is:

1. Detect the battery %age is below X in a tasker or automate task, and as root:
2. echo X > /sys/class/power_supply/battery/full_level_dis_batt_chg
3. echo 1 > /sys/class/power_supply/battery/charging_enabled

The charge stops at X%.
[Android Apps and Games] :
We will look into this. Those apps typically allow themselves to update every second to allow for the current changes and such. However, as a service, we do not want to consume a lot of battery with constant updates to the service and such. A switch for normal temp and volt is coming, but we'll address the others later.

Just pushed a commit to add a switch to show temperature and such to the notification.

https://github.com/sriharshaarangi/...mmit/1d85c7c79394648478c33cbe87245eb288134ed2
[Android Apps and Games] kiro222:
can someone help me with lenovo a536. Battery charge limit v.1.1.0 has no effect on it (previous versions says device is not supported). I also tried to find which file in root is responsible for stopping battery charge but with no luck. In /sys/class/power_supply/battery folder there is no charging_enabled file and the only one that seems to change is the one with the status but I can't manage to overwrite it (when i change something it refuses to save). I am using ES explorer.

Thank you!

---------- Post added at 11:19 AM ---------- Previous post was at 11:17 AM ----------

can someone help me with lenovo a536. Battery charge limit v.1.1.0 has no effect on it (previous versions says device is not supported). I also tried to find which file in root is responsible for stopping battery charge but with no luck. In /sys/class/power_supply/battery folder there is no charging_enabled file and the only one that seems to change is the one with the status but I can't manage to overwrite it (when i change something it refuses to save). I am using ES explorer.

Thank you!
[Android Apps and Games] deitrich:
the app works great in a5 2016

Wysłane z mojego SM-A510F przy użyciu Tapatalka
[Android Apps and Games] Droid_JD:
Any other pixel xl users using this issue?

If I set my phone to 80/60, it will charge to 80, but then also hold at that number. No discharge.

Any idea?
[Android Apps and Games] hgmichna:
Constant state of charge

Be glad. Most phones cannot do that. It is the nicest way to keep the battery cool and long-lived.
[Android Apps and Games] ulipo:
May I ask a dumb question?

What does "reset battery stats" do and what is it useful for?

Sorry for the ignorance and thanks in advance...
[Android Apps and Games] Droid_JD:
Agreed, better to have it partially working than not at all.

What's strange though is that 0.8.2 worked fine for me, but not later version's.

I don't pretend to know how this stuff works, I'm just grateful to those that do.
[Android Apps and Games] xDRAFT:
Will be never possible for non rooted phones? I use S8 and dont wanna root cause of knox
[Android Apps and Games] onolox:
No root no cookies.

Because it writes some things that are system protected.

And dude, remove knox.

---------- Post added at 03:15 PM ---------- Previous post was at 03:09 PM ----------

Most phones cannot enter deep sleep with this app.

__________________________________________________________

And, make a donation version too, or a donation inside the app. .:cool:
[Android Apps and Games] Bobbaloo:
It resets the battery graph the same way the OS does when charged to 100%
[Android Apps and Games] hgmichna:
Deep sleep

The purpose of deep sleep is only to extend the time the phone can run on its battery. When the phone is connected to a charger, deep sleep is not needed.
[Android Apps and Games] davekra:
What do you think would cause it to work sometimes on a OnePlus5 on OOS5.0.1?

Prior to Oreo it worked 100%, but now it is randomly not working. I see it pop up when I plug in the phone, but when I come back it's above the limit I set.

I'm running 1.1.0(22). I've tried 'charging_enabled' and 'input_suspend' control files and they both give the same results.

Selecting 'Configurable CTRL file data' I see a note about using 'Always write ctrl file' in the event of crashes or service not working.

Has anyone else had issues with Oreo, OOS5.0.1 and OnePluse5?

Thanks,

davidk
[Android Apps and Games] onolox:
This app stops the charge at 80%. Then the phone stays awake the entire time. If you pick the phone hours later the battery will be at, let's say 76%. Understand?

The pixel guy are fortunate.
[Android Apps and Games] xDRAFT:
If i do that, i cant use my guarantee anymore... anyway, S8 root tutorial is long
[Android Apps and Games] onolox:
I think it will be interesting, an option to not charge in a certain temp threshold. Something like: Max charge limit temperature: [ 25Cº ]

I usually wait to my devices to cool down before put them to charge.
[Android Apps and Games] :
Interesting. I am not sure how much of an issue this would be and it might be battery draining to constantly monitor battery temperature. I will look into this.
[Android Apps and Games] jungus:
I have exactly same issue with OP3T OOS5.0.1. If I remember correct everything was still fine OOS5.0.
[Android Apps and Games] hgmichna:
Charge-discharge cycle

Sounds like the normal mode of operation, as long as the screen is off.

You could set it to stop charging at 80% and to recharge at 78%. That's approximately how I have set mine. Works well and keeps the battery cool because it charges only for short periods.

---------- Post added at 05:06 PM ---------- Previous post was at 05:04 PM ----------

Interesting idea. But 25°C is far too low.

Perhaps the app could limit the temperature only when it rises by 10°C, so it would automatically adapt to the environment. Of course one could come up with all kinds of combined temperature criteria, but it may be difficult to invent something that cannot fail under unusual conditions.
[Android Apps and Games] bam80:
Not as normal as it could be.

The problem is, being on charger, the phone can't sleep even if it disconnected from charger programmatically by the app. In result, those short periods between charges it constantly runs CPU fully on battery, instead of taking energy from charger, or sleeping at least to decrease the discharging effect.
[Android Apps and Games] gohamstergo:
+1

Manually cycling to 0 and back to 1 seems to have fixed the issue. Perhaps you could have your app cycle it when unplugging?
[Android Apps and Games] Zeez Saud:
Is there any method to increase the 3% maintaining?

I don't want it to recharge.

Or

Is it possible to apply terminal emulator commands, using Tasker, to make it stop charging then not to recharge again?

Thanks in advance.
[Android Apps and Games] maik005:
Yes. If you have a Samsung then this script is a good escape but only works for wireless charging....

https://xdaforums.com/showpost.php?p=71116283&postcount=136

But the only thing you need to change is the Akku percentages and the file in the Skript that should be changed...
[Android Apps and Games] Cookie_93:
After some testing, store_mode 1 actually lets you charge to 70%. But then "turns off" charging.

Rebooting is the only thing that seems to be reseting it.

By changing the file batt_capacity_max I can fool the store_mode to charge beyond 70% of "real" battery capacity or stop before that.

batt_capacity_max default is close to 1000, guessing this is 100%. If you set this to lets say 800(80%), your phone will say that your battery is at 100% when it hits 80% of max real charge(for s7 Edge: 3600mAh*0.8). With store_mode 1, this will charge to about 56% of real battery max. Because it will stop at 70% of 3600*0.8. (3600*0.8*0.7 = 2016 =>56%)

So say we want to charge to 80% of real battery max. This will require a higher value of batt_capacity_max(potentially dangerous?) then default.

Setting batt_capacity_max to 1142(again, could be very dangerous.), will allow us to do this. Because 800/0.7=1142.

That equation comes from: x(what you should batt_capacity_max to)*0.7(store_mode 1 stops at 70% of fake value)=800(wanted percentage*10). x*0.7=800 => x = 1142.

Keep in mind, that your phone will say 70% still, but it's 70% of 114.2% = 80% unless you change batt_capacity_max back to 1000.

Basically store_mode could be used to further enhance the app, with a proper way of stopping charge instead of toggling it. Problem occurs when we want to "go all the way" and charge to real 100%, this still requires a reboot to reset store_mode to 0.

I guess we could set batt_capacity_max to such a high value, so that 70% of the new batt_capacity_max = 100% of real battery capacity.

Again this could potentially be very very dangerous.

I've tested setting batt_capacity_max to higher value and it works the way I tried to explain.

Though, it seems like the batt_capacity_max can't be set to higher values then 1188 for safety reasons I guess. So we're back to needing to reboot to be able to charge to real 100%.

As long as the phone doesn't try to charge beyond 100% of real capacity, this shouldn't be dangerous.

Made a tasker profile of this. Which for example reverts batt_capacity_max to default when I unplugg my charger. Just so that I can see my real percentage and not the fake one I get when changing batt_capacity_max.

To sum up: having store_mode always set to 1 and changing batt_capacity_max will give you a way of limiting your charge in a better way then toggling charging, cause of store_mode way of handling stuff and it will keep the charge at same level when done charging. But we still need to reboot to charge to 100% if needed.

If anyone understands what I just wrote, they deserve a cookie.

Then again, there could be an easier way, this is just me, messing around with stuff I probably shouldn't touch.

Oh and this was tested on a S7 Edge SM-G935F running Supermanrom 2.2 Android version 7.0.

---------- Post added at 03:21 AM ---------- Previous post was at 03:07 AM ----------

Forgot to mention, only changing batt_capacity_max won't stop charging if the fake percentage says 100%, otherwise this would've been the easiest way of limiting charge ^^
[Android Apps and Games] frequentc:
store_mode must work differently on your phone than my Note 3 (android 5.0). On my phone with store_mode = 1, it doesn't charge when it's below 70%. I'm at 62% now, and it's just maintaining that 62% but not increasing. Maybe the percentage is lower on older kernels.
[Android Apps and Games] Cookie_93:
Do you have a siop_level file? Is it writable? What's the current value?

Also, factory_mode seems to be doing same thing on my phone as store_mode. Though factory_mode has a delay when setting it to 1 with like a minute or so before it actually stops charging, it can be changed back to 0 without a reboot.
[Android Apps and Games] sriharshaarangi:
From the findings of [MENTION=4710301]frequentc[/MENTION] for Samsung devices, and [MENTION=7721249]almightysiman[/MENTION] for Pixel/Nexus devices, I have added two new modes in the app. I am uploading the apk here. If it works, then I will update the OP.

Those having Samsung/Pixel/Nexus devices, please select the appropriate option in the app, test and report.
[Android Apps and Games] almightysiman:
thanks！will try and report.

update：working fine when screen on.but when the screen off,it doesn't work.
[Android Apps and Games] sriharshaarangi:
Is it charging beyond limit when screen is off? Can you explain what is happening?
[Android Apps and Games] elikplim442:
Its working fine here on my Galaxy Note5 and Galaxy S5 even when screen is off, running leaked nougat rom and Resurrection Remix 5.8.1 respectively :good::good::good:
[Android Apps and Games] czrtst:
Thanks for this App, works perfect with my Xperia Z1c.
[Android Apps and Games] almightysiman:
yes,it charge beyond limit.it seem that /sys/class/power_supply/battery/battery_charging_enabled will change back to 1 when the screen off.
[Android Apps and Games] gohamstergo:
Testing now, but charging_enabled is what is on the Nexus 6 Stock Marshmallow, so might need to adjust the new labels. Could the app just auto-detect?

Update: v2 doesn't fix charging getting stuck for me. Steps: set limit to 40, charged to 40, unplugged, disabled app, changed limit, enabled app, plugged in, doesn't charge. Still have to manually cycle the 0/1. Charging was with screen off.
[Android Apps and Games] sriharshaarangi:
In the sequence, after you disabled, the file is 0 or 1? Ideally when you disable it should change to 1.

I tried the same sequence, but the app is working fine. Regarding auto detect, for some mobiles there are both battery_charging_enabled and charging_enabled, and the former is working for some, and latter for others. So, in that case, we don't know which file to use.
[Android Apps and Games] ash001:
So USB is the directory and online is the main file????
[Android Apps and Games] almightysiman:
update：I find the way to disable charging when screen off on my Pixel.it need to echo 0 to both charging_enabled and battery_charging_enabled.I have test it and it work！@harsha1397
[Android Apps and Games] gohamstergo:
The file ends up as 1, but still doesn't charge until cycling, for some reason.
[Android Apps and Games] Mohammad_pd:
Hey There Brother

Your 0.2 Version Doesn't Work Again On My Phone

Htc One E9 Plus

Android 5.0.2

And There Is Some Screenshots When I Searched For This Words:

Batt_

Battery

Charger

Even You Want The Whole Of That Directory

Tell Me To Send Them To You.

Thanks For Your hard Work!
[Android Apps and Games] ash001:
Didn't work for me too ..No file present
[Android Apps and Games] sriharshaarangi:
Check for battery_charging_enabled or charging_enabled in /sys/class/power_supply/battery/ folder
[Android Apps and Games] post-mortem:
The Android OS automatically resets the battery stats when the charge level is 90% or higher, and you unplug the charger. Since many people use this app to limit charging to something below 90%, the battery stats will never get reset by the OS. In that case, the graph will be useless if it contains weeks of data. So this app can reset the battery stats manually, or automatically when the battery reaches whatever level you've selected.
[Android Apps and Games] Bobbaloo:
What was that? ?
[Android Apps and Games] onolox:
For clarification, the [25] Cº is selectable. It's just a safety measure.

This function will only be enabled when the charger is connected after all. Then, check the battery temp in the intervals of 30s.

Use case: You phone is 35Cº, put on charger, the app awaits temp drop to 25Cº to start charging.

All this ideia is from the exact same source of the idea of this app, the thing that most kill the battery, is charge it at high termperatures. I usually put my at a mini fan at my job to keep it cool while charging.

I want to try to fiddle with this idea to make a more advanced temp control, something like, make the app wait and see if the temp is dropping, and when it stops dropping for some time, start charging.

And thanks for the open source it!
[Android Apps and Games] :
Yes, we will discuss and consider this. Question: what device are you using where you're this worried about temperature? All my devices stay pretty cool
[Android Apps and Games] onolox:
All devices get pretty hot, especially after gaming.

But any usage make the battery get 5~10Cº hotter than the ambient. If you take out of pocket, it's 33Cº...

If you start charging it at almost any temp it stays in this temperature.

The ideal temp to charge is 10~20Cº, to have an reference. Anything above this are damaging the battery. And heat damages are way worst than voltage ones.

And I am neurotic. ;)
[Android Apps and Games] post-mortem:
Also, if the device is in a case, especially one of those battery cases, heat will be more of an issue. I suppose, potentially, people who use those car air vent mounts during the winter time may also have increased concerns about heat buildup.
[Android Apps and Games] duttyend:
You guys are awesome, thank you sooo much, this is one of the best Android apps ever !!!

Until version 1.1, I wasn't able to get it to charge again after it previously reached limit (80%) and discharged after that (Nexus 6 on LOS 14.1 and using wireless charging).

Now, after enabling Always Write Ctrl. File, it works beautifully!!!
[Android Apps and Games] post-mortem:
As I reported previously, those of us on d2 variants (Samsung Galaxy S3) have been unable to get this app to work reliably. It would sometimes appear to work, but after an unpredictable length of time on the charger, the device would begin charging above our set limit until reaching 100%. So if charging overnight, we always woke up to 100% battery.

I installed the Play store version a few weeks ago, and noticed the same thing. However, I now have something new to add, as I think it's related to the charge/discharge cycling which has been previously reported. I noticed that when the phone reaches the set level and charging stops, sometimes the phone cycles (though sometimes it doesn't). When cycling, the notification shows "Please wait..." as you can see in my 1st attachment. Occasionally, this "Please wait..." lasts for a long time, and the device starts charging again, as shown in my 2nd attachment. My settings at the time were to limit charging at 90%.

As I remember, the wait period was originally 6 seconds, which was lengthened to help prevent this. I would like to suggest, perhaps in an "Advanced Options" section, a setting to allow the user to set a custom value. I feel that if I changed it to, say, 1 or 2 minutes, then my issues may go away.

What do you think?
[Android Apps and Games] deitrich:
Hello. Does anyone know why the application causes such a big phone awakening after the end of charging?

Wysłane z mojego SM-A510F przy użyciu Tapatalka
[Android Apps and Games] :
If the charger is still plugged in, it is because the service is still actively running to allow for recharging if the lower threshold is met. Once charging has stopped at a desired level, you should unplug the device and stop the service to stop any battery drain.
[Android Apps and Games] dsjd:
Is there a way to automatically simulate the disable button ,once charging is done or disconnected so that the battery stats are reset automatically
[Android Apps and Games] deitrich:
[MENTION=6280728]xdnax[/MENTION] Thank you for your answer. But I will not get up at night to disconnect the charger. [emoji6] Tasker will be able to close the application after charging the battery?

Wysłane z mojego SM-A510F przy użyciu Tapatalka
[Android Apps and Games] :
Long story short no. Answer is a page or two back.

---------- Post added at 03:10 PM ---------- Previous post was at 03:09 PM ----------

That may be difficult! If anything, raise the lower limit so it stays in that range more overnight.
[Android Apps and Games] Gregbol:
With tasker you can stop the load by giving for my case 1 to the control file when the battery is 85% for example.
[Android Apps and Games] Mindrila:
Sorry, I haven't read the last 150 pages or so. My phone works fine with this app (ZTE Axon 7, generic file) but while charging the voltage of the battery is upped to 4.3 V.

Now someone gave me a hint, that it is possible to limit the maximum battery voltage by writing the value to:

/sys/class/power_supply/battery/voltage_max

(The value is in mV)

I tried that and it works fine. So writing 4100 will limit the battery voltage during charge to 4.1 V. Which will further enhance the battery life.

Now the value gets reset with a reset of the device and I was wondering if it would be possible to integrate this into this app. So that you can choose a maximum battery voltage. There is also a voltage_max_design which seems to give the maximum battery voltage (in micro volt) the battery was designed for, so it could be used as an upper limit on the settable voltage.

If this has been discussed before, sorry for repeating old news.
[Android Apps and Games] gowengel:
Hi, seems like a nice approach.

My Moto Z has a default Charging Voltage of 4400 mV, which in my Opinion is waaay too much. There are many People in the Moto Z Community with degraded Batteries because of that. In general Lipos shouldn't be charged higher than 4,35V, which already is high.

There is also /sys/class/power_supply/battery/constant_charge_current

which seems to limit the Charging Current. After changing the Values, they will be overwritten soon by some other routine...
[Android Apps and Games] westhaking:
Is it possible to add functionality where this app could integrate with your alarm clock or you could set a manual time in that it would charge your battery and be at 100% right when you wake up for the day? The app would still function as is, charging back and forth between your two set values, but those values would be ignored for a set amount of time of your choosing (15, 30 min, etc.) before your alarm clock goes off. This way you could have a full battery when you start your day but it would only be at 100% charge just moments prior to waking up when you can unplug it.
[Android Apps and Games] bam80:
It's interesting who overwrites it :confused:
[Android Apps and Games] mochamoo:
Yes. This is what I have been doing. Works great for my pixel XL. Can something like this be integrated into this app?

https://xdaforums.com/showthread.php?t=3668059

Sent from my Very Silver Pixel XL 128GB
[Android Apps and Games] bam80:
My issue seems similar, but for Nexus 4: https://github.com/sriharshaarangi/BatteryChargeLimit/issues/4

Compare your log.
[Android Apps and Games] post-mortem:
You can use Tasker to send an intent so the app disables at a certain time.
[Android Apps and Games] pat357:
The app seems to work OK on my Sammy S8+ : it loads the battery to 75% and then the bat discharge to 65% and starts charging again.

The only thing that does not work is resetting the battery stats :

not only automatic resetting does not work, but also manually resetting by pushing the button in the app does nothing...

Any idea ?
[Android Apps and Games] deitrich:
I need a plugin for this?

Wysłane z mojego SM-A510F przy użyciu Tapatalka
[Android Apps and Games] :
No plugin. Read the GitHub Read.Me for more info.