yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] crispyduck:
Hi, thanks for this nice and simple App.

I am using it on my Redmi 3 with Official Lineage OS 14.1.

Limiting works with the charging_enabled file.

Whats a bit strange on my phone is that it stops charging at the configured limit e.g. 80%, after this the capacity is no more updated and stays at 80% as long as the cable is connected. But seems in this state the phone is powered by the battery and only not updating the capacity value, because when I disconnect the charging cable in the morning the capacity suddenly falls for several percent to e.g. 73%. So the lower level will never work while charging.

Also the App does not recognize when the charger is disconnected so I have to end the service manually.

Actual workaround for this is that I set min = max level, so the service stops as soon as the capacity drops when disconnecting the charger in the morning.

Is this a known behaviour? Reading through this thread so far I did not see someone reporting similar behaviour.
[Android Apps and Games] harryspar:
Does anyone know the correct settings for a Motorola Moto G6 Play?

If I use the "battery_charging_enabled' file, the percentage stops going up when it reaches 80, but the charging icon in the status bar still shows the charging symbol and the percentage doesn't go down no matter how long I wait.

If I change to "charging_enabled", then it seems to correctly stop charging at 80, but the notification doesn't go away when I unplug.
[Android Apps and Games] post-mortem:
You may find the behavior to be different with a different kernel.

Many consider this to be preferred behavior, so consider yourself lucky. It's as if the device ignores the battery and runs directly off of the charger.
[Android Apps and Games] crispyduck:
Thanks, yes, I would like to try another kernel, but seems there are no more maintained kernels for this device. Think I will stay with LOS official weekly and simply use it as described in previous post.

Or could you recommend any other kernel?
[Android Apps and Games] harryspar:
If that's what's happening it's awesome. I just hope there isn't something else going on.

I wasn't aware that they can run straight from the charger.
[Android Apps and Games] jerry18:
Reporting back = result for mine battery drain (several posts on previous page) is quite simple.

After battery reach desired max limit, phone don't go into deep sleep and this causing a drain if you keep phone still connected into the charger (more time = more drain).

As suggested before what you can do is just set lower limit close to the max one and you won't be surprised by the drain.

Although I would rather have an option to close apk immediately after max limit is reached so phone could go instantly into deep sleep (but this would start charging again to 100% so no big deal).
[Android Apps and Games] devsk:
"/sys/devices/platform/soc/soc:google,charger/charge_stop_level" is what you are looking for on Pixel devices. Set it at boot once. No monitoring or app needed.
[Android Apps and Games] hgmichna:
Replying to very old posting

You have replied to a posting that is over 13 months old.

Apparently it still helped somebody, so no problem. I just wanted to alert you to the fact.
[Android Apps and Games] MartinC#1:
I'm on Tegra K1, once battery charging has been completed will DC/USB continue to power the device, bypassing the charged battery?
[Android Apps and Games] devsk:
That was deliberate on my part because when I searched for info on limiting charging on Pixel, I got very little information and got sent to that post (and an inefficient way using tasker periodic poll). My replying to that post will now prime the google search with my reply...:) And hence will help someone in future.
[Android Apps and Games] webbrowser:
Thanks!

Strange, on my Pixel 2 XL made by LG, I don't have /sys/devices/platform/soc , so I also don't have the subdirectories below it. Which model did you have or did your research suggest that this exists on all Pixels?

Battery Charger Limit's default control file /sys/class/power_supply/battery/input_suspend (0,1) seems to work mostly ok. I set mine to stop charging at 63% and resume at 60%, and it will keep bouncing between those two levels as long as the power supply is connect. Cons are:

- when connected to my laptop, it produces irritating dings every few seconds on my laptop. I think it's the USB device being (re)discovered or something.

- it still bounces between the two, which probably still leads to some degradation
[Android Apps and Games] hgmichna:
Charging Li-ion batteries

Current knowledge is that it doesn't. Below 60% you will get thousands of cycles before any serious degradation

It generally makes no sense to count cycles for Li-ion batteries.
[Android Apps and Games] Azims Lives:
I'm having same problem with my Redmi 4A running stock miui 10.
[Android Apps and Games] crispyduck:
Yes, seems to be the same on Redmi 4A. There are also exactly the same power_supply files.

There is also no way to limit the charging current like on some other phones with current_max, so I simply use a old 500mA charger I found so it charges slowly over night and set min value equal max value in the app.
[Android Apps and Games] Azims Lives:
This is so frustrating, it all seems to work except the device itself is not able to update the battery value
[Android Apps and Games] crispyduck:
Yes, but still better then nothing, so you can set a upper limit where the phone gets disconnected from the charger.
[Android Apps and Games] hgmichna:
Slow charger, 500 mA

I have been looking for one of those for a long time and have not found one.

In fact, I found and bought a 500 mA charger on Amazon, only to find that it happily delivers quite a bit more than 1 A. It is almost a quick charger.

You cannot even google for a slow charger, because you find a thousand messages of people complaining about their charger, which they think is too slow, but not a single one actually offering or even looking for a slow charger. Practically nobody seems to understand that slow charging leads to a longer battery lifespan, not to mention that 500 mA are more than sufficient to charge a smartphone over night.
[Android Apps and Games] crispyduck:
Its a old BlackBerry charger.

Actually everyone is looking on fast charge,... and then the fast charger is simply used to charge the phone overnight.

But at all, even if I now also set a charging limit and use a low amp charger, I am still not sure if this really makes sense.

Just checked when I brought my Redmi 3, which I always simply charged overnight with a 1A charger.

And at least for 2 years the 4000mAh battery always lasted or 1 day where I would say I am really a heavy user.
[Android Apps and Games] hgmichna:
Battery lifespan

The batteries usually survive two years, but they lose quite a bit of their capacity. You could use the AccuBattery app to measure your current battery capacity.

Some people, like me, use the same phone for four, five, or even six years. If the battery is fully charged every night, it will not survive that long. It will lose most of its capacity and will need to be replaced.

I would not mind so much having to replace the battery once in the phone's lifetime, but there is another nasty problem. Many, if not most, replacement batteries are extremely low-quality fakes. And if you ask the manufacturer of the phone to replace the battery, they will charge you an outrageous price, because they would prefer that you buy a new phone instead. I, for one, do not want to play along with that.
[Android Apps and Games] Ace42:
From my experience, charging to 90, and depleting the battery to no less than 20/25% helps a great deal. My Moto E, which released in 2015, still adheres to my standards today. It's a super reliable backup phone, and only for $10, ha.

My laptop, an antique from 2013, has reached a wear level of 22%. That's great for an older ultrabook. Current phone was bought around Nov 2016 and battery life is about the same. But it's worth mentioning that I only charge to 50-75% (4000mAh batt). Now, things are different for my Galaxy S1 since it's 8 or so years old. The NAND actually died before the original battery. Recovery sees every partition as 0MB!

I'm pretty much like you. I try to squeeze as much value as possible from electronics. It saves me a ton of money. And don't forget, we'll be able to buy older flagships for next to nothing. :cowboy:
[Android Apps and Games] post-mortem:
Many laptops and other, non-computer devices with USB ports (TV, DVD player, audio equipment, etc.) put out 500 mA, and continue to supply power even when the device is turned off. I have a very old netbook which I use as a glorified power adaptor.
[Android Apps and Games] hgmichna:
Replacing the battery or replacing the phone; slow charger

Thanks for the good information and confirmation of the battery lifetime extension methods.

It seems though that the interesting older, used phones, for example the OnePlus One, carry an excessive price on eBay. A OnePlus One in good condition seems to fetch €150 over here, so perhaps $150 in the US.

That is too much for my taste. Per year of use it is cheaper to buy a Nokia 6.1 for €250, because it will have a longer useful lifespan, and it is a somewhat more powerful phone than the OnePlus One. And it will have a good, brand new battery, while the battery of a used phone may be worn out.

Currently I only look at Nokia and OnePlus, because these two appear to deliver timely Android updates for about three years.

---------- Post added at 10:33 AM ---------- Previous post was at 10:23 AM ----------

I know, I know. While I write this, my phone is connected to my computer and draws 500 mA from it.

But I would still like to have a charger that behaves like a computer USB port for charging at night.

I guess we all agree that charging at only 500 mA will extend the life of the battery to some degree, even in combination with the app, because the voltage at the charge limit and the battery temperature is lower.

If anybody finds a genuine 500 mA charger, please report! Apparently there is absolutely none on Amazon. The one that you can easily find there, available from various (Chinese, I suppose) companies delivers much more than that, over 1 A. I know, because I bought it. The best bet is an old charger from the early days of smartphones, but I don't have one any more.
[Android Apps and Games] cattolicboy:
This one works just fine:

https://www.aliexpress.com/item/EU-US-Plug-5V-0-5A-Power-Adapter-AC-5V-500mA-Charger-Switching-Power-Supply-Universal/32831175426.html
[Android Apps and Games] hgmichna:
Slow charger

That's the one I have. It does indeed work fine, but it happily delivers more than 1 A. Not slow enough for me.

This charger is very widespread. Every webshop has it, like Amazon.
[Android Apps and Games] cattolicboy:
mine deliveres 500mA exactly
[Android Apps and Games] salmanfarisy:
Just bought OnePlus One for cheap. The seller said that he use it for 3 years already. Using AccuBattery, battery health is just about 70%. Hope this device can last longer.

---------- Post added 29th December 2018 at 12:18 AM ---------- Previous post was 28th December 2018 at 11:52 PM ----------

Ah.. I still have one from old days. If I remember correctly, this one is from Hisense E860, old Android device with Android 4.0 pre-installed.

Tested it, and it delivers slightly below 500 ma.

I also still have 700 ma and 850 ma (the later is from LG E435 Jellybean with only 1540 mah battery!) chargers from my old days.
[Android Apps and Games] hgmichna:
Used smartphones are expensive nowadays

How cheap? Does it look good, without too many scratches?

70% battery capacity is not good, but not catastrophic either. If you plan to use it for several more years, I think you should consider swapping the battery. You can do that yourself, if you get the right tools. It is a bit tricky, but not really difficult. The most difficult part is to find a good replacement battery, because all you get is fakes. In my experience, over 50% of the fakes still work well, while the rest fails after half a year.

The perfect solution is to send it to the manufacturer for battery replacement, but that costs 2 to 4 times as much and is usually not worth it for a phone as old as this one.
[Android Apps and Games] webbrowser:
Ok, on my Pixel 2 XL, I found the file /sys/module/lge_battery/parameters/charge_stop_level which is set to 100 by default.

1. What's a good way to change this file on boot without modifying system?

2. Suppose I try to use Battery Charge Limit's custom control file. Under the prompt "Set Enabled Value" there are greyed words "1, enabled, desired_value" and under Set Disabled Value is "0, disabled, desired_value". What should I set these to, if I desire to limit charging to 63% and recharge below 60%?
[Android Apps and Games] Ace42:
OPO's SD800 suffers from poor NAND performance - I owned two LG G2s, and they slowed to a crawl on Lollipop years ago. I can't imagine using one today. And forget about playing games. Overall, it's just not worth it in 2019. I can find used SD805 - 835 phones for dirt cheap. They're usually good "fixer uppers", or suffer from solvable issues.

I think budget phones are fine, but purchases should be tailored to one's habits. The Z3 Play is a neat looking phone and includes a battery mod in the US. Sadly, Moto's checkered history tells me the phone won't get many updates compared to Nokia's offerings...

OnePlus has always had my attention, just not to an extent where I've felt the desire to become a customer. They hold their value a little too well, haha. Essential phone seems like a decent alternative for less. The Poco F1 is worth considering, though it's useless in the US. ):

The oem charger for my LG Sunrise and LG Tones outputs .7A. I think the Nokia 520's does .5A.

Why didn't you go for a more recent device? If you're in the US many phone sales/clearances occur throughout the year btw.
[Android Apps and Games] webbrowser:
Instead of using a 0.5A charger, how about using some sort of "charge-only" cable? I *think* that when the data pins are not present altogether, the device ends up charging very slowly.
[Android Apps and Games] tecs.ottawa:
Blackview BV9600 Pro

I can't seem to get this app working on my phone. It doesn't have any of the standard files available, but I have tried a couple of them including "status" and "present". They don't work. I've noticed something strange though. When I set them up in the custom control data screen, they don't actually get changed. The app has root access and I checked those files in ES File Explorer to see if they were being modified or not and they the app seems to have no effect on them. Is this normal?

Any help would be appreciated, thanks!
[Android Apps and Games] lionhealth:
I charge with power bank - which have funtion like turn off when phone are full charging (or turn off when phone do not charge anymore) and turn on automatic when it be called.

So when I use your app and the phone rich limit number, it turn off chaging and so it lead to the power bank is turn off, but after the power bank turn off, your app think I unplus the cable and it disable service. When your app disable service, the power bank will charge again because no service stop it, and when it charge, it start your app service and because it rich the limit number and it disable charge again and it loop the same circle which i said from the start.

So in this case, your app is useless. It a really pity because i love this app anf your idea too much, but can not use it because I mostly charge with my power bank and it being loop enable disable thing.

Base on your idea. I trying to write my own tasker but it not easy like i think.

My idea is when ever it rich %limit (which can be setup) the phone is completely disable charge funtion. Untill it lower than %number we want to charge, and the charge funtion is enable again.

With this step, I think it will fix all special, rare case in the real life - a case of auto-discharge-when-phone-not-charge-power-bank.

Sorry for my bad English.

Again, I really love your app and what u done.

Thank for your reading.
[Android Apps and Games] hgmichna:
Slow charger

The charge-only cables all have a shortcut in the data lines, which signals to the phone that it may draw a higher current than 500 mA, so that will not work. Apparently the chargers also contain that shortcut, so phones draw a higher current even with standard USB cables. So that won't work.

A cable with interrupted or missing data lines, but without the shortcut, might work. I may try that one day.
[Android Apps and Games] MarcoCount:
Thanks a lot for this tool!

It's working great on my op6.

It would be nice if it detected by itself when power is disconnected after reaching the percentage set, because I have to always disable the service otherwise battery stats are not reset.

Anyway working great!
[Android Apps and Games] georgiapi:
Hi Guys, Search is not working for me on this one, its an FYI & Question,

I have a OP6 Unlocked & Magisk rooted that ran Battery Charge Limit fine until I updated to OxygenOS 9.0.3 and now it will not work saying I'm not rooted. All my other apks requiring root work.

Tried all the uninstall, reboots, re-installs and such, but no good.

When started it would lock up with a white screen sometimes coming up telling me I'm not rooted. I looked in the Magisk menu SU list and its not listed there.

Thank the stars for Titanium BU I had a version 1.1.1. and restored apk & data and its like it never happened.

What was the cause?
[Android Apps and Games] salmanfarisy:
About $57.

So far I'm quite satisfied with the battery life. Using Xposed so I can get the best of Greenify, and using a xposed module called Better Battery Saver to suppress wakelock. No excessive heat either.

---------- Post added at 10:58 PM ---------- Previous post was at 10:43 PM ----------

I'm not in US. I'm in Indonesia.

Just found LG G4 Dual for about $80. Better CPU but LTE cat 4, same with OPO, so I skipped. My previous device is entry level, Mediatek powered, second generation Android One, 2gb ram with 1700 mah battery running Marshmallow, so I'm quite happy with my new device. It's improvement in many aspects.

OPO is running lollipop here, quite smooth really. OPO has official marshmallow but I'm still satisfied with lollipop 5.1 so maybe later.
[Android Apps and Games] apusoft:
Charge maintained even if out of range

Hi,

I'm using Battery Charge Limit on Huawei P8 Lite with the file "enable_charger".

I have a doubt about the operation.

I set up as lower limit 75%, maximum 85%.

If I connect my phone to the charger when its battery is at 89%, the status is correctly "NOT CHARGING".

But the charge is kept unchanged over time, even after many hours.

I would expect instead that the charge decreases up to 75% and then the charge returns up to 85%.

Is there a reason why the charge is maintained even if it is outside the prefixed range?

Thank a lot!
[Android Apps and Games] gnabtib8:
Can you provide the settings you used to make it work on the HTC U12+? Much appreciated
[Android Apps and Games] athraugh:
I meet similar that issue.

My setting High and Low is 91% and 86%.

My Battery stoped charging even it was at 65% untimely.

I tried to disconnect from Adapter and connect again.

It is the same.

I must restarted my phone, it go back to normal.

Phone: Pixel 3 XL

OS : android 9 with security patch 2018/12

Root: Magisk 18
[Android Apps and Games] Ace42:
The app already achieves this, it just doesn't behave as designed on every ROM/Android build. When I unplug my phone running Pie (Dec patch) it automatically resets stats.

LG G4 should be avoided like the plague... It has a known bootloop defect due to its solder, and a class action lawsuit was opened against LG. It included multiple LG phones.
[Android Apps and Games] mauiblue:
Here you go:
[Android Apps and Games] pupun47:
Reinstall magisk.
[Android Apps and Games] Adi Laxman:
This App is a classic example showcasing how versatile an OS Android is.

Thank you, developer, for this fantastic app.
[Android Apps and Games] hgmichna:
Extending the battery lifespan

Actually it shows that a clever developer can do things in Android against the will of the manufacturers of Android phones.

(They want your battery to die a slow, painful death after two years, and they want you to be unable to swap the dead battery for a new, good one, so you buy a whole new phone.)
[Android Apps and Games] Adi Laxman:
Totally Agree with you.
[Android Apps and Games] I<Aow:
Probably most people would buy a new one either way, no matter If the battery works fine or not. I'm not sure if the developer really worry about that as long as this behaviour is quite normal.
[Android Apps and Games] hgmichna:
Smartphone lifetime

"Most" is the key word here. Have you ever seen any believable statistics?

I know, or know of, a lot of people who cannot or will not afford to buy a new smartphone every two years.

I am sure that planned obsolescence is involved in the design of devices with built-in, non-swappable Li-ion batteries, like smartphones and increasingly laptops as well. (Recent Acer laptops have non-swappable batteries, for instance. Probably many others too.)

Anyway, let's not extend this discussion much further, as it makes no difference to us why smartphones are designed for a 2-year battery lifetime. We are in this thread because we want to extend it to 4 or 5 or 6 years.
[Android Apps and Games] joeandjoe:
Hi all,

i would like to ask for advice,

i am using slackware linux distribution via linux deploy app on OnePlus One (bacon), and im trying to limit battery charge so i can leave the phone on cable all the time,

but battery charge limit doesnt seem to work for me,

first it was restarting after limit was reached, switching charging on/off in short time (off when it started, on when it stopped)

then i tried to change some settings (dont remember which) and it seemed to be working,

only problem was that while phone was discharging battery capacity was unchanged (for almost one day)

i wasnt sure its a problem until i tried power meter and saw 0 watts and 0 amperes readings, and android app ampere also read 0 mA (wall charger plugged in)

i tried battery charge limit, but i also tried manually change values in linux filesystem:

echo 0 > /sys/class/power_supply/battery/charging_enabled

the result was the same like with battery charge limit

now im not sure if the battery readings are wrong, if i need to calibrate battery or what to do,

i havent tried magisk module yet cause i am on android 4.4

Thanks
[Android Apps and Games] post-mortem:
Try another kernel, if available.
[Android Apps and Games] nicodelius666:
Hi! Thanks for this wonderful app!

If you want, you can post in a pinned list that my HTC U11+ works well with two of given controllers:

- battery_charging_enabled;

or

- charging_enabled.

This on a stock OceanMDUGL_HTC_WWE_O80_CRC_Sense90GP_Stable_1.24.401.7 9.0_g CL1010171 release-keys.

Bye!
[Android Apps and Games] SGH-i200:
Thats simply a lie. I know a lot of non-techy people who use there phones till they break apart. And the techy people, who buy a new phone once a year want to sell their old phones. I bought the phone I'm using right know because the privat seller never charged the battery above 80%! ;)

I have some Moto G2 2014 smartphones in our house that were charged to the fullest every time and the batteries are still going strong. Thank you (Google-)Motorola (before Lenovo)! :good: