yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] I<Aow:
Hmm, strange. Where are the people who buy the millions of iPhones and Samsungs (and ...) every year? Because have a look at the statistics about their sold devices, that doesn't look like everyone is using his phone untill its litrrally dead. Only in 2018 Apple sold over 200 million iPhones and this was even a bad year for Apple.

However there are more than 200 million users in the world but there is also more than one brand (of course Apple is a big player, Nokia or similar brands only dream about these statistics). Nevertheless these (actual growing) statistics don't look like there are many people who really care about there battery (I do not know a single person except of me), because even under worse conditions the battery will survive two maybe even three years untill it will annoy the user with small remaining capacity.

This was quite off topic because like I said before I do and therefore I'm here.
[Android Apps and Games] hgmichna:
Quantify "still going strong". Do they still have more than half their original capacity?

You can measure the capacity fairly precisely with the AccuBattery app or with a hardware USB meter by discharging fully and then measuring while charging fully. Most phones nowadays allow the app to read charging current, voltage, etc., so the app can calculate the total capacity in mAh. AccuBattery even knows the design capacity of many phones.
[Android Apps and Games] SGH-i200:
I will run the test.
[Android Apps and Games] Klusio19:
Since I installed app, my vibrations aren't working! They work only during charging! Uninstalling app and rebooting doesn't help. Please help!!! My device is Xiaomi Pocophone F1
[Android Apps and Games] ngshixuan:
It might be the power saving mode that disable the vibration. Try to disable the power saving mode and see.
[Android Apps and Games] gohamstergo:
Cool script, modified to my liking and giving it a test! I'm new to Automate, so on the 'target level' step, what is the code to enter to allow for typing in a custom level?

All,

Did anyone ever give any concrete data on whether it's better to re-charge battery after 1% drop, or to wait longer? Hard to think of what to google for an answer...
[Android Apps and Games] blueberry.sky:
Batteries naturally drop voltage a little after the charger is removed, a 1% recharge point makes it cycle an excessive amount. Whereas 3% cycles much less (not merely 1/3 of what 1% did). I tested different percentages on few devices and 3% seems to be the sweet spot.

And percentage is just an estimation, it's not extremely accurate.

To expand a bit, because we are cutting off charging prematurely the natural voltage drop when charging is removed is larger & quicker for us. A normal full charge profile for li-ions is CC/CV, a constant current phase followed by a constant voltage aka saturation charge at the end. By cutting off charging prematurely we are not getting the saturation charge phase since that starts ~4.1v (assuming not 4.3 or 4.35v li-ion). When you don't do a saturation charge you get a larger & quicker voltage drop. It's not a real drop in capacity / percentage, just the voltage settling. But estimating li-ion percentage is always a bit difficult. So it looks like a drop in capacity & we get excessive cycling.

TL;DR

The OP, Harsha1397, was right not to try to hold 1%. Some of the initial drop isn't real.
[Android Apps and Games] SpeeD180883:
Nice app
[Android Apps and Games] blueberry.sky:
Change that "Choice dialog" block to a "Dialog number?" (under "interface"), enter Maximum value "99" (or less), set Output variables to whatever it was in the "Choice dialog" block.

I could upload a modified version if you have trouble.
[Android Apps and Games] gohamstergo:
[MENTION=5997572]blueberry.sky[/MENTION] Cool, will do that after work, thanks.

Also, I figured out why OPs app never really worked for me and only charged once, then got stuck. Turns out, my Nexus 6 had been conspiring against me the whole time. After reaching the threshold, app writes "0" to charging file, then my phone/OS changes it back to "1" (tested without app and it still goes back to "1," so gotta be the OS) shortly after BUT that doesn't reenable charging. So, it just gets stuck and doesn't charge anymore until cycle to "0" then "1" again. Luckily with Automate, can force it to cycle the file before/after reaching threshold to trick phone into not being a jackass.
[Android Apps and Games] DMagister:
[MENTION=6898873]harsha1397[/MENTION], hello!

I would like to ask you add the tunable hysteresis feature with lower level entry. For example : the unit stop charging at 80% and still connected to charger. Now it will start charging again when charge level drop below 78‰. Can this value can be tunable?
[Android Apps and Games] HikingMoose:
Holy cow is that confusing to look at! It doesn't seem to work on a Nexus 6P. I think because it's not getting permission to check for the file, but it has root access...
[Android Apps and Games] gohamstergo:
First thing I'd recommend is take some time to wrap your head around what it's doing. I just sat and stared at it for a while until I figured it out. Never used automate before, was a tasker guy.. Then, remove all the file checkers. If you know what file your phone has and what needs changed, just tell the Flow to do that directly. That'll remove some of the visual confusion.

It's a great Flow though, helped me get on track and figure out my phone was a saboteur unto itself.
[Android Apps and Games] blueberry.sky:
Thanks for adding your experience & information beeshyams.

I noticed that file. Two problems with it tho. 1) Setting it to zero makes harsha1397's app believe usb has be unplugged. 2) On some devices, it seems the file can not be changed. On my Amazon Fire 7 (SlimLP rom) it can't be changed by echo even with /system remounted rw & file permissions changed to rw. And attempting to replace it by cp causes reboot.

But it might work well on cooperative devices.

~edit~

How did you confirm that you found the true path? Running find in terminal shows me a different path which I'm assuming is the true one but I still can't edit or replace it.
[Android Apps and Games] PoochyX:
Thank you now i can shut down my phone, still couldn't boot into twrp thru the power menu I guess I use a app for that.... Not as big a issue as not being able to turn the phone off
[Android Apps and Games] beeshyams:
[MENTION=5997572]blueberry.sky[/MENTION]

Thanks

1. First off, my Linux knowledge of nearly null and probably because of that had problems echoing 0 or 1 to the files and choose the option of replacing files when required automatically

2. On my device, it is the true one since charging notification disappears when charge is removed - can't say about other devices ( I only have old Samsung note 2 as spare). Actually, isolating this path was the problem because I got duped into thinking that main file selection was wrong. I know it is true because it works, can't comment on terminal results

3. I haven't downloaded OPs app and tried but saw that we are on same lines

4. If you are interested in the automation script, i have a suggestion- please ask a question on stack exchange asking for details quoting my question and I will provide a detailed answer, that can be used here also and thus benefit both groups. Making a fresh post here would take time and am short of it. Of that is not suitable to you, I can post screen shots of macros involved and you can figure out yourself- there is actually one more case of requiring to disable charging notification, which I can explain better in a detailed answer

I don't know if I have answered enough
[Android Apps and Games] dennyk23:
seconded, please add this feature to app :) the default 3% sounds like a very low range
[Android Apps and Games] michaelvue:
thank you been hope this helps identify battery charge
[Android Apps and Games] gohamstergo:
wonder what happened to [MENTION=6898873]harsha1397[/MENTION]. havent seen anything from him in a while. seems like thread has mostly been taken over by scripts. XD
[Android Apps and Games] blueberry.sky:
I think he mentioned that exams were coming up & he wouldn't have much time for a bit.

I hope he open sources it. I don't run closed source Root apps unless there is absolutely no alternative. Plus then we can contribute. I'm running my own little script. Plaining to share it if I can add decent multi-device support.
[Android Apps and Games] kos25k:
hello.I had a strange issue on my moto x play 6.0.1. I enabled charge limit (stock value) and successfully stopped at 78%.I pulled charger off and at night I puted the charger again.but when I woke up in the morning my mobile didnt charge!why?thanks.
[Android Apps and Games] TR2N:
Hello! I am not able to import the flow. Automate is always telling me that the file is corrupt..
[Android Apps and Games] real_milux:
Thanks man, and it just got better! (And more complex, of course... ^^) Now featuring:

Target Percentage Ranges (instead of fixed percentage)

Custom Range

Memorizing last range (both selection and custom input)

Asynchronous statistics reset in separate fiber

Every (sufficiently stable) flow version will be published to the Automate community as "Maintain Battery Percentage [ROOT] vX", category "Tools".

Further improvement suggestions welcome!

Cheers!
[Android Apps and Games] real_milux:
Could you provide some more details about this? Maybe an adapted flow? This could be integrated into my flow somehow...
[Android Apps and Games] regh:
(Im on MI A2.PIE.

I think you tried A2 on OREO. im on pie, and not working. tried lot of switch, reboots, charging just stops and charges again to 100% )

SOLVED SOLVED SOLVED SOLVED SOLVED

switched to magisk ACC module, then SWITCHED to slow charger! QC wont work! happy! thanks man!
[Android Apps and Games] Klusio19:
Didn't help your solution. I had to clean flash again ROM. Dirty flashing didn't help too.
[Android Apps and Games] oseiasrodrigues0:
Not working on my device GALAXY S DUOS 2 GTS7582L WITH ROM LINEAGEOS 14.1 ROOT MAGISK
[Android Apps and Games] Flipz77:
The app works great on Pixel 1 (stock Pie, Magisk, Franco the fascist kernel)

Percentage calculation when unplugged is still a bit wonky (stays fixed for more than 1 hour sometimes) but it's been like that since I got the phone so not the app's fault.
[Android Apps and Games] hgmichna:
Battery percentage goes down very slowly

Android 9 "Pie" can achieve this with its rather extreme battery saving measures. With its "Battery optimization", "Adaptive battery", and (manually controlled) "Background restrictions" it slows, delays or even kills background apps, leading to an extremely low energy consumption while sleeping.

Works pretty well for the most part, as far as I can see, but if you have an app that you need to run in the background, you may have to disable these energy optimizations for that app, or it may not work in a timely fashion or may even get killed after a few hours.

So perhaps not wonky after all. :)
[Android Apps and Games] dd805bb:
Did this on my pixel XL. Works great. Question, how do I reset battery stats because they only will clear at 100? Thank you for your help in advance.
[Android Apps and Games] Flipz77:
I hope it's really that way but it's not a deep sleep thing and it's not related to Pie, my phone has always acted weird with battery level calculation even on Oreo.

The percentage only freezes when disconnected from the charger, otherwise it's a pretty normal standby drain, under 1% per hour.
[Android Apps and Games] kenshin79:
Thanks a lot for this tip! I use a Xiaomi Mipad 1 with custom ROM Lineage OS 14.1 based on Shield Blobs and it works great! :good:
[Android Apps and Games] zputnyq:
It seems you have to enable "automatically reset battery stats" located below "Notify when limit is reached"
[Android Apps and Games] dd805bb:
Oh I used the method I quoted of just modifying my battery preference file on my pixel XL. It charges to 95% and stays at 95%. It had kept the battery stats in the stock battery stats via settings. It finally reset after to charged to 95 again. It is all good now. On the pixel XL the battery file is in an htc battery file.
[Android Apps and Games] post-mortem:
My understanding is that the OS will automatically reset battery stats when the battery level is at 90% or higher at the time the charger is disconnected.
[Android Apps and Games] dd805bb:
I had to restart the first time to reset. Now yes it resets when it stops at 95%. But when I first did it, it held the 95 and discharged and charged back. Still showing previous battery stats before the current full false charge. Now it is fine. Charges to 95 and resets itself.
[Android Apps and Games] Tuxshine:
Is there any way to hide or turn off the notification of this app automatically as long as my smartphone is disconnected to the power bank or USB charging cable.

Only as connected for charging again, a notification should appear on the display automatically.
[Android Apps and Games] post-mortem:
The problem is that if you do that, the OS may kill the app; it will appear as an unused background process wasting resources. Keeping the notification present will prevent the app from being killed.
[Android Apps and Games] amplatfus:
In my case (OnePlus2 on Lineage 14.1 there is no notification when the phone is unplugged.
[Android Apps and Games] Tuxshine:
And how can I assign this behaviour to my environment? I'm using TGP as custom-rom, Android 8.0 on my Samsung Galaxy S7 (SM-G930F).
[Android Apps and Games] hyborian:
On my Poco f1 phone with Android Pie, notification shows when I plug in the phone to the charger. I have low as 93%, and high as 98%. Once it reaches 98%, charging stops, and notification changes to something like "maintaining between 93-98". I unplug it, notification is still there, but disappears after a short while. Next time I charge it, it goes the same cycle.

I have the app systemized as a privilege app using App Systemizer under magisk.

---------- Post added at 08:34 PM ---------- Previous post was at 08:17 PM ----------

On my Huawei phone, it has some tips from Huawei regarding various stuff. One article was myths about batteries.

One was that it was bad to overcharge at night. Huawei points out that it is a myth for modern phones, as these phones now regulate battery charging when full.

My Xiaomi phones all stop charging when they reach 100%, light goes off as well. If left plugged overnight, light never comes back on, and it still is 100% next day.

The Huawei still has the light on once full and still plugged in, but it and the other phones don't even get warm if left plugged in overnight, unlike the old phones in the old days.

Anyway, I still use this Battery Charge Limit on my rooted phones with Snapdragon, habit I guess. This app does not work on my MTK phones properly though, and even other apps similar to this can't work properly too. The MTK phones seem to have a different control.
[Android Apps and Games] amplatfus:
Sorry but I didn't set this. This behaviour was default.
[Android Apps and Games] cristobalite1983:
Hi guys, will this work for Samsung note 4, sprint variant? If yes, what settings do I need to use for charging regulation? Thanks
[Android Apps and Games] fuzzychicken:
Issues with Pixel XL

Hello folks,

Trying this one on rooted Pixel XL (fully updated). It works first time after the reboot but it doesn't work during next charges until I reboot it.

Nothing changed in the setting, other than 'Enable Battery charge limit'.

I have Accubattery installed as well but I experienced this even before installing Accubattery.

I have logcats attached.

Thanks in advance.
[Android Apps and Games] b8842dc0:
I'm trying to figure out what file needs to be modified to get the Pixel C to work with this app. I've discovered that there is a file: /sys/class/power_supply/CROS_USB_PD_CHARGER0/uevent that looks like this, when plugged in:

POWER_SUPPLY_NAME=CROS_USB_PD_CHARGER0
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_CURRENT_MAX=1000000
POWER_SUPPLY_VOLTAGE_MAX_DESIGN=5000000
POWER_SUPPLY_VOLTAGE_NOW=4738000
POWER_SUPPLY_CHARGE_CONTROL_LIMIT_MAX=0
POWER_SUPPLY_MODEL_NAME=4000
POWER_SUPPLY_MANUFACTURER=0

When, not plugged in, it looks like this:

POWER_SUPPLY_NAME=CROS_USB_PD_CHARGER0
POWER_SUPPLY_ONLINE=0
POWER_SUPPLY_STATUS=Not charging
POWER_SUPPLY_CURRENT_MAX=0
POWER_SUPPLY_VOLTAGE_MAX_DESIGN=0
POWER_SUPPLY_VOLTAGE_NOW=0
POWER_SUPPLY_CHARGE_CONTROL_LIMIT_MAX=0
POWER_SUPPLY_MODEL_NAME=1d00
POWER_SUPPLY_MANUFACTURER=0

But I'm trying, and failing, to modify this file, to see if it is the file that needs to be modified for this app. If I use Vim to try and set POWER_SUPPLY_ONLINE=1, I get the following error:

"uevent" E667: Fsync failed
WARNING: Original file may be lost or damaged
don't quit the editor until the file is successfully written!

Obviously, I'm doing all of this as the root user. I've also tried with sed, but that doesn't work either. Any suggestions for how to modify this file?
[Android Apps and Games] fox0001:
Thanks for this app! Now I can turn my old phone into a server
[Android Apps and Games] guest4711:
This is a type of logfile. It's written by the kernel. You cannot use it to control the behaviour (of the kernel or your system).
[Android Apps and Games] MDV106:
It does not work on my rooted nokia 8. It simply continues charging even after the desired battery charge has been reached.
[Android Apps and Games] guest4711:
Probably the wrong control file.
[Android Apps and Games] MDV106:
How do i pick one? In the settings when i click set control file i only get the "input_suspend (pixel 2/xiaomi mi6)" and "status (motorola defy+)" options and the first one is what i chose. How do i pick the right one if there are only 2 available?
[Android Apps and Games] DualJoe:
I'm using ''batt_slate_mode' 30/90 on Samsung i9506. It works properly but the app doesn't close itself when i pull the cable and i always have to pull down the status bar and click 'disable' manually to make it vanish. This happens on LOS15.1 and LOS16 with BCL v1.1.1. I think it worked properly some time ago (maybe v1.1.0).

Is there any solution for this for actual version?
[Android Apps and Games] guest4711:
See the FAQ in OP. First try these which are shown for you. If none fits, ask the developer of your kernel. Or have a look into /sys e.g. /sys/devices/platform/sec-battery/power_supply/battery and observe whats happens if you change their values (try and error).

But be aware that some kernels do not have control files to control charging.
[Android Apps and Games] MDV106:
It works fine if i dont use a ctrl file
[Android Apps and Games] sriharshaarangi:
DELETED
[Android Apps and Games] sriharshaarangi:
Hello everyone!

It has been a long time since I posted anything here. [MENTION=6929614]real_milux[/MENTION] and myself were responding to issues here and there on GitHub, but the project was mostly dormant. I started reviving it again, and you check the source code, quite a few commits have gone into it. To make sure the upcoming update is stable, I have created a beta Telegram group. It would be a small group, and a group for advanced users who understand the how the app functions well and can identify issues and suggesting improvements, and it is NOT for requesting support for phones, unless you come up with a control file which works on your phone and it is not present in the app. Also, no off-topic allowed which wastes other people's time, and we don't hesitate to remove the annoying ones. Finally, although we try our best, it is an open source project, nothing is guaranteed. If you think you are fine with all the above, feel free to join it here: https://t.me/joinchat/ILY0fRZP05xQS19WTIM76A. It can be closed anytime as we want it to be small and dedicated
[Android Apps and Games] MiluX:
Not sure you quoted the right person btw ?
[Android Apps and Games] sriharshaarangi:
Corrected, thanks!
[Android Apps and Games] onoakino:
Hi devs! I wish you could also support the Nexus 10. It's an awesome tablet but it is very old. So an extra care with its battery will be very much appreciated.
[Android Apps and Games] MDV106:
Is it normal for the phone to saying "not charging" after reaching its limit but with battery percentage still increasing as long as its still plugged in? Thats what im experiencing using this app
[Android Apps and Games] SGH-i200:
I have to manually disable/close the notification on the lastest Pie firmware of my Sony XZ1. On my ZTE Axon 7 mini (LOS 14.1 = Nougat) everything runs fine! :good:
[Android Apps and Games] Predatorhaze:
Does this affect the chip inside the battery?
[Android Apps and Games] hgmichna:
Chip in battery?

Do you have any indication that there is a chip inside your smartphone battery?
[Android Apps and Games] post-mortem:
No, it's no different than manually unplugging your phone every time the battery level reaches 60% (or whatever value you set).
[Android Apps and Games] pirogof:
Same issue here. My phone drops 7-8% at night after reaching max limit. Normally it shouldn't drop more than 1%. I don't like the idea of setting lower limit close to the top limit and having the phone discharge and charge for hours. Not that it's going to do that more than once, but still, a better solution will be ... well better :).
[Android Apps and Games] I<Aow:
He probably talks about the BMS. However the BMS is more likely located on the motherboard than inside the battery pack.
[Android Apps and Games] hgmichna:
Chip in battery?

That's what I thought too.
[Android Apps and Games] remyvrs:
Can you please add support for OnePlus 3 ?

I have Resurrection Remix installed, does this make a difference ?
[Android Apps and Games] guest4711:
It depends on the kernel you use, not on the flavour of your operating systems. Dome kernels support control files, others support status files only, others none of them.

And there are no general naming conventions for these files. So it's "try and error".
[Android Apps and Games] remyvrs:
it turns out that it works after I have selected control file : "charging_enabled [Universal]"

Thanks !
[Android Apps and Games] papatzis:
Hi to the dev I have a Xiaomi redmi note 4 ( nikel ) Mediatek and I try to make this app works I have selected the 2 choices I have if I press Set control, File I have the Motorola Defy+ option and the Xiaomi Redmi note 2 ( hermes ). both are not working I can find the file path in hermes option /sys/devices/platform/battery/ChargerEnable but I set the linit at 80% the app stops ( maintening from % to % but the phone still charges, because the percentage is going over the limit and I have a charging cable with display on it and I see the same charging current.

What I do wrong?

Thanks in advance
[Android Apps and Games] guest4711:
Probably your ROM/kernel does not provide any control file needed by this app. If you wish to make it work you should read the docs how to identity a working control file and how to apply it.
[Android Apps and Games] hyborian:
I have the same phone, MTK is a pain with some apps.

Forget it, it regulates charging by itself anyway (as most modern Xiaomis and Huaweis do). I leave it charging the whole night for over 1.5 years, it turns off by itself when full, and battery is still excellent like new.
[Android Apps and Games] hgmichna:
How do you know? If you charge it full every night, it will have lost a significant part of its original capacity after 1.5 years.

You can use the AccuBattery app to measure your battery's current capacity.