yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] buriimishka:
Based on my tests, the application works great, as long as the screen is turned on, the smartphone is charging, reaches the limit, stops charging, all right. But if you "forget" the smartphone on charge for a while, let it fall asleep, then when you return you will find it charged 100%. First of all, I thought about the doze mode, but for the application it is disabled by default. I do not even know what the reason may be.

The smartphone will charge 100%, and the app notification will remain hanging as a reminder, that something went wrong.
[Android Apps and Games] gerlium:
Same problem here, but it did work with the version 0.3.
[Android Apps and Games] Diljinder:
Is it possible for you, [MENTION=6898873]sriharshaarangi[/MENTION] to make it work for Nexus 7 2013 tablet?
[Android Apps and Games] StonebridgeGr:
Hello. The bar on 0.5 version what exactly doing? I can't understand. Either in the first post don't say exactly
[Android Apps and Games] blueberry.sky:
Bar? The one to the left of "Recharge below XX%"? It adjusts the range that the app will hold. The default is usually fine.

---------- Post added at 03:06 AM ---------- Previous post was at 03:02 AM ----------

As soon as someone tells him what file the Nexus 7 2013 uses. Someone who owns a Nexus 7 perhaps? :cowboy:
[Android Apps and Games] hgmichna:
Range bar musings

Let's say you use the default setting of charging up to 80%. When the battery reaches 80%, the app switches off the charging.

From that time on the battery will, hopefully slowly, go down, first to 79%, then 78%, and so on.

At some point you want the charging to resume. That point is determined by the slider setting.

This creates the question, which point is optimal? I personally think that the slider is completely superfluous and could be replaced by a fixed setting of 1% below the charging target, i.e. resume charging whenever the battery goes below 79% in our example. Letting the battery discharge any lower than that serves absolutely no purpose in all use cases I can imagine.

In fact, in my phone, a OnePlus One with LineageOS 14.1, I can even set the slider to 80%, such that the charge status swings between 79% and 80%. I have observed the phone and found that it swings slowly. In theory there may be phones in which this setting might cause a very rapid charge-discharge cycle, which would be undesirable, but my phone is not of that kind.

Using a setting where the battery is kept within a very tight range even has one distinct advantage. When I drive and navigate, I have three power-hungry apps running at the same time, a track recorder, a speed trap warner, and Google Maps. This causes the phone to heat up quite a bit, and battery charging heats it up even more.

In this situation, when you set a large range, the battery could discharge down to 70% perhaps in half an hour, then charge back up in another half hour. During the charging the phone would get hotter and reach some peak temperature. If, however, you keep the charge within a very small range, charging can start and stop within very few minutes, such that the phone never heats up to the peak temperature that would otherwise be reached. This would cause a nice reduction in heat stress for the entire phone, including the battery.

I propose to redesign the app such that it no longer has the slider and instead keeps the charge as close as possible to the desired charge level (80% by default). To avoid quick charge-discharge cycles, have the app switch off charging for at least one minute. In other words, charging should never resume before a minute has passed.

This would reduce the number of settings, which is always an advantage.
[Android Apps and Games] savvymatthew:
To many people wanted the slider so it was added. I personally use it set to 10 because I don't want charging on and off all night, weather that affects the battery or not I don't know but my limited knowledge would assume it's better to not have it do that?. And I have a oneplus-3 so with dash charge I'm unaware how that effects the overall battery together if it were to go on and off all night .
[Android Apps and Games] HikingMoose:
But a lot of people asked for it. There's no reason to remove it, "it would serve purpose" to remove it at this point. If you want it to keep your phone between 79 and 80, then just set it at 79-80. A redesign would not help your situation (because you already have the functionality you're after), but would make others lose a function that they seek.

I would suggest just stating your peace, so others can think their charge regime, and leave it at that. There's no need to change the app busy because you think a feature is unnecessary. What you're saying is correct, and I agree that a very short bump charge to maintain a set level is probably much better for the battery than a bunch of 10% cycles. But people may have reasons they want to do so.

---------- Post added at 07:44 AM ---------- Previous post was at 07:37 AM ----------

On a side note, how much battery do you lose overnight? You might want to address, because I lose about 1% over night, so mine has never had to recharge overnight (with it set to recharge at 78%).

But to answer your inquiry, I feel it most be less damaging for your phone to charge from 78 or 79% 3 times over night, than to charge the battery for 10% which will generate more heat and more crystals (damage) than a 1% bump charge. I don't know that to be true, but I have studied and paid very close attention to batterys and their technology for several years now, and that's my hypothesis.
[Android Apps and Games] Midomad:
So the best charge limit is 80?
[Android Apps and Games] hgmichna:
Best charge limit

If you want to keep your battery for many years, charge it only to 60%. It will last for thousands of charging cycles, perhaps more than you need.

80% is a good compromise. It will make the battery last for around 3 to perhaps 4 years, given daily or nightly charging.

Charging to 100% every day or night yields around 300 to 500 charge cycles, so the battery will have lost a good part of its capacity after two years and may well become unusable soon thereafter.

What you can also do is adapt your charging to the expected usage for each day. For example, on a normal day, when I can charge even during the day, I charge only to 60%. Before days when I travel and expect to use the smartphone a lot, I charge to 100%.

Of course the life expectancy of the battery depends on other factors as well, particularly on the quality of the battery and on how the phone determines what 100% means. On some phones it means 4.2 V, on others 4.3 V, occasionally even more, which means an even shorter life time.

The usual "original" replacement batteries you can buy for less than $10 are Chinese fakes, many of which last only a half year, no matter how you charge them. Or be prepared to exchange the battery several times until you strike luck and find one that lasts longer than a year. It is much better to buy branded batteries, like Anker, Duracell, Hama, and others. Or, if money plays no role, spend $30 to $50 and buy a replacement battery directly from the manufacturer of your phone.
[Android Apps and Games] Midomad:
Thanks for you're valuable explanation.

One more thing i'm using a OnePlus 3T should i only click on enable and voila,or should i modify something else(i'm a little confused with the option battery charging enabled(Nexus/Pixel) and Charging enabled (generic) )Which one to choose?
[Android Apps and Games] gerlium:
Any idea about why the app doesn't work on my Oneplus One with Cyanogenmod 13 Sultan? From what I remember the 0.3 version did work.

And why can't I change the charge limit?
[Android Apps and Games] hgmichna:
OnePlus One

It works well here on my OnePlus One with LineageOS 14.1. You could try to upgrade.

The charge limit can only be changed after you switch off the function. This makes no sense and looks like a user interface design error to me, but at least it works.
[Android Apps and Games] Midomad:
Up? [MENTION=2893530]hgmichna[/MENTION] [MENTION=6898873]sriharshaarangi[/MENTION]
[Android Apps and Games] hgmichna:
Versions 0.3 and 0.5

Make sure you are running version 0.5 of the app.
[Android Apps and Games] Midomad:
I'm already running that version!

I'm talking about the option in the screenshot wich one should i select nexus/pixel or generic(i'm using a OP3T)?View attachment 4112207
[Android Apps and Games] hgmichna:
Settings

I'm guessing generic, but I think there is no harm in trying out which one works.
[Android Apps and Games] Yiouuhh:
Thanks , very good app, i love reset battery stat option because i dont knew how to do on OOS
[Android Apps and Games] Balino:
With 0.3 version default was generic, with 0.5 it's Nexus/pixel, they both works fine for me. I guess is quite similar to stock Nexus rom, that's why it's working on both
[Android Apps and Games] StonebridgeGr:
Took one hour to read your post hahaha but thanks
[Android Apps and Games] sriharshaarangi:
Oneplus 3/3T users on oxygenOS should use generic, as the battery_charging_file is not working
[Android Apps and Games] realista87:
but if a person is lucky that his rom....does fully support the nexus/pixel OPTION, all what you said is useless.....i think.

because with the nexus/pixel option the phone never goes down from the max value you set ( so that range you can set, is only needed for person who use generic option.....), and if you use it with screen on it only charges the same amount of power u draw... if screen off it's almost idling at 0 mah of 0.1mah just sometimes ....to compensate the idle power usage by network....
[Android Apps and Games] Balino:
An alert notification when the charge is reached would be a very nice addition to the app. One like accubattery has
[Android Apps and Games] :
Feature request:

An intent to enable and disable the limit. This would be really great because then we could make Tasker tasks that automatically enable or disable the limit based on events.

For example, for LMT launcher (an app used for pie controls), I have a Tasker task that runs

su am stopservice -n com.noname81.lmt/.TouchService

when I want it to disable LMT and

su am startservice -n com.noname81.lmt/.TouchService

when I want it enabled.

If Battery Charge Limit had an intent, we'd be able to enable it using Tasker on certain days if we wanted or only disable it when we get a message from a certain someone (and then automatically enable it after 24 hours). The possibilities are endless.
[Android Apps and Games] Technical:
Strange that the app says it is not compatible with my Asus Zenfone (see my signature), however Holo Kernel has battery charge limit as one of its settings. I can set 80% for instance and it works. But using the app, nothing happens.
[Android Apps and Games] @sumit@007:
Device not supported yet. .

Android one sprout4
[Android Apps and Games] alismatales:
What about support for Huawei devices?

Toggling /sys/class/hw_power/charger/charge_data/enable_charger manually works fine on my P9 lite

App says device not supported
[Android Apps and Games] alismatales:
Oh well, for now i solved it with a Cronjob and this simple script:

#!/system/bin/sh
STATE_PATH="/sys/class/hw_power/charger/charge_data/enable_charger"
LEVEL_PATH="/sys/class/power_supply/Battery/capacity"
UPPER_LIMIT=80
LOWER_LIMIT=78

CHARGE_STATE=$(cat $STATE_PATH)
CHARGE_LEVEL=$(cat $LEVEL_PATH)

if [ $CHARGE_LEVEL -gt $UPPER_LIMIT ]; then
echo 0 > $STATE_PATH
fi

if [ $CHARGE_LEVEL -lt $LOWER_LIMIT ]; then
echo 1 > $STATE_PATH
fi

I set cron to run this script every 5 minutes.

Works like a charm.

All i have to do now is figure out how to autostart cron at boottime and im all set. :silly:

Edit:

Okay, so i added support for my Huawei phone myself, but the sourcecode on git says its still version 0.3 - is that the most recent sourcecode and you just forgot to update the version number?
[Android Apps and Games] KBay:
Is your phone need to be rooted to change /sys/class/hw_power/charger/charge_data/enable_charger?
[Android Apps and Games] alismatales:
Dont know, my phone was already rooted when i started playing around with this.
[Android Apps and Games] hgmichna:
Root

Does this app not require root on all compatible devices?
[Android Apps and Games] KBay:
Sorry for stupid question, my bad
[Android Apps and Games] alismatales:
By the way, here's what i did: https://github.com/alismatales/BatteryChargeLimit/commit/ec251f7b4e9c0b98ad29a18a49f8d561c7033934

That was really all that was necessary to make it work on my huawei.
[Android Apps and Games] sriharshaarangi:
As mentioned in one of the posts above, use generic. Though oneplus 3/3T has the other file, it doesn't work.
[Android Apps and Games] Midomad:
Yep, you already mentionned it here [emoji4]

https://xdaforums.com/showthread.php?p=71875428
[Android Apps and Games] real_milux:
Not exactly. The typical behavior on my phone is that the battery is BYPASSED, so actually it WILL lose voltage

a) over a long time span because of self-discharge effects and

b) because of the voltage drop after the charging stops.

For my phone, the drop is 2-3%, with a) being visible in the battery statistics when you look veeeeery closely. You may want to use the slider of v. 0.5 to avoid any cycling because of b), and should be fine with it.

---------- Post added at 02:08 PM ---------- Previous post was at 02:04 PM ----------

ALWAYS PREFER

battery_charging_enabled over charging_enabled

and

store_mode over batt_slate_mode

, except if your phone has specific issues with the former one (like the OnePlus devices), PERIOD.

I explained the reasons multiple times, read the old stuff. ;)

---------- Post added at 02:15 PM ---------- Previous post was at 02:08 PM ----------

Sorry for disagreeing with you here, but the battery_charging_enabled is better for both battery and quick unplug detection wherever it doesn't cause specific problems. No offence! ;)
[Android Apps and Games] real_milux:
Look above, I changed it slightly to be more clear. The OnePlus problem is what I meant when I said "unless your phone has specific issues with the former one". ;)
[Android Apps and Games] sriharshaarangi:
I agree with you. Yes, the battery_charging_enabled is always better, but it is not working on oxygenOS on oneplus 3/3T. Since he asked about oneplus 3, I told him to use generic.

Edit: I should have been more specific, I don't know if battery_charging_file works fine on lineageOS /AOSP based roms.
[Android Apps and Games] real_milux:
Version 0.6

Pre-release of my latest updates:

https://mega.nz/#!498SlTpC!9Y8twW4IOfuzwU0taHR7VTp83LmRljtZeC0HB4aUe1A

fixed a bug that caused charging beyond the limit in some situations

experimental support for Huawei devices using enable_charger

simplified control file management via JSON

This is just a test release, it's signed with a debug key!
[Android Apps and Games] Midomad:
So You advise to use battery_charging_enabled on the OP3T?
[Android Apps and Games] real_milux:
No, I advise to use charging_enabled there, because this device is one with "specific issues".

Sorry for the confusion, I overlooked that I was answering a OP3-related question.
[Android Apps and Games] real_milux:
Version 0.7

New experimental build 0.7, now with external control over the charging limit (Tasker, Automate, etc.):

https://mega.nz/#!Bwkk2CyA!9xk13pau4v_UGWUipTVIOudRk3-bYbYgHH1CP-bzPuE

Charging limit can be changed in two ways:

Starting Activity com.slash.batterychargelimit.IntentHandleActivity with a SEND intent, using mime type "text/x-battery-limit" and supplying the percentage as String with Intent extra "android.intent.extra.TEXT" (Intent.EXTRA_TEXT)

Using an Intent to Broadcast a message of type "com.slash.batterychargelimit.CHANGE_LIMIT", again with the percentage in Intent extra "android.intent.extra.TEXT" (Intent.EXTRA_TEXT)

Have fun!
[Android Apps and Games] Nitrooo84:
Is this an "official" release or a modded branch? ?
[Android Apps and Games] real_milux:
Semi-official ;) Harsha added me as a contributor, so I could modify the OP. However, you may want to wait until he officially publishes the 0.7 APK signed with his dev key, then you don't have to uninstall it.

The pull request was just merged by Harsha minutes ago.
[Android Apps and Games] sriharshaarangi:
v0.7

Credits: [MENTION=6929614]real_milux[/MENTION]

Uninstall previous versions before installing this!

Download link: https://www.androidfilehost.com/?fid=745425885120725870

Changelog:

- Experimental support for Huawei and Nexus 4 devices

- Support for external control over charging limit

- Bug fixes
[Android Apps and Games] hovnonium:
I cant install it even after uninstalling previous version.
[Android Apps and Games] hgmichna:
Version 0.7

What happens when you try?

I am testing it now on my OnePlus One with LineageOS 14.1. Appears to work fine so far.
[Android Apps and Games] real_milux:
Same here somehow. I can of course always use my own builds, but trying to install fails with a non-informative error message of the packet installer...

Could the signature be corrupted? :confused:
[Android Apps and Games] hovnonium:
it just says App not installed.

#449 +1
[Android Apps and Games] alirey:
Working fine with openbeta 14
[Android Apps and Games] iperov:
cannot install v0.7 on xiaomi redmi 3s

installer error
[Android Apps and Games] :
Can you give me an example of these? I think I'm doing it wrong. I got a toast saying that the percentage was invalid or something. Also, is there an intent to simply enable/disable the service?
[Android Apps and Games] real_milux:
If it says that the percentage is invalid, check that you provide the data as String, not Integer, and that it is within the permitted range [40;99].

See attachments for an example using Automate to set the limit to 80% between 0:00 and 8:00, and to 65% otherwise.

There isn't any intent to disable the service yet, you can use the suggestion functionality here, on GitHub, or both to make as remember that we implement it. ;)
[Android Apps and Games] Syamsyung:
Can't be installed on version 0.7

It say application not installed

On my samsung galaxy j5 2015 6.0.1
[Android Apps and Games] guyton100:
Can someone give link to version working on redmi 3s?
[Android Apps and Games] Midomad:
0.7 version working great on my side,

Uninstalled 0.5 and installed the new 0.7 one.
[Android Apps and Games] post-mortem:
Version 0.7 doesn't work on SGS3, though the app correctly identifies the device as a Samsung. Same as previous versions.

What can I do to help?

(BTW, the 0.7 download file is misspelled.)
[Android Apps and Games] netr0pa:
Sorry for going a bit off topic but are there any similar programs like this on Windows side? (which works with all computers I mean cause I have only seen Samsung and Lenovo laptops with this programs)

Going back to topic: I tried this one out on Redmi Note 3 pro and it was impossible for me to install, it just says:

"App not installed"

And this is version 0.7

EDIT: Only version 0.5 is working but it's a bit pity 0.7 didn't work, I was curious about the "Support for external control over charging limit" function.
[Android Apps and Games] hgmichna:
Best hysteresis setting

I had mentioned earlier that I could use the setting of recharging exactly below the charge target, i.e. slider at the left stop, on my OnePlus One with LineageOS 14.1 / Android 7.1.1, because the app switched the charging slowly on and off.

I have now found that this is not always so and have to correct myself. I have watched a situation when the app switched rapidly, within seconds, between charging on and off when the slider was set fully left.

So my general recommendation is to set the slider one stop to the right of the left edge. Example: Charging target is 80%; set the slider to recharge below 79%.

Setting the slider further to the right serves no useful purpose, so I don't recommend it, unless you have a very special case where that is needed. I cannot imagine such a case.
[Android Apps and Games] Midomad:
So for exemple my charging target is 95% i should set the slider to 94%?
[Android Apps and Games] chonghua:
Latest version not working with Xiaomi or MIUI ROM. :(
[Android Apps and Games] bam80:
Thanks for that!

Any plans to distribute it through F-Droid?

PS:

or, it could be distributed through XDA Labs at least..
[Android Apps and Games] hgmichna:
Best hysteresis setting

Yes, exactly. That's what I think is best.
[Android Apps and Games] bam80:
doesn't work for Wireless Charging on my Nexus 4
[Android Apps and Games] Midomad:
Did you read somewhere wireless charging is mentionned?

Thanks
[Android Apps and Games] bam80:
I saw nowhere mentioned it doesn't work.

If it wasn't supposed to be working, then it's a feature request.

Thanks
[Android Apps and Games] Dziewan:
Yeah thats true. 0.7 is not working on my Xiaomi phones (Redmi 3s Prime, and Redmi Note 3).

"App not installed"

But i had that app, previous version, and it was working fine, but now i cant find where i can download it.

Please put in the first post links to previous versions.

Edit: previous versions here: androidfilehost.com/?w=search&s=BatteryChargeLimit_

0.5 is working fine on MIUI
[Android Apps and Games] TR2N:
Hi guys,

0.7 is working fine on my Nexus 6P. But after uninstalling the old 0.7 and reinstalling the new one the app defaults to the generic setting. I'm not sure which setting I have to apply on my Nexus. Any suggestions?
[Android Apps and Games] smayor:
I can't install this version on my Oneplus X either. It says App not installed. Previous version worked fine
[Android Apps and Games] Midomad:
Battery charging enabled as mentionned in OP.
[Android Apps and Games] netr0pa:
Are you sure that 0.5 version worked well with your Redmi Note 3?

I have also redmi Note 3.

To install 0.5 version is OK but the problem is that the app itself didn't work as intended. I cannot manage to charge up to 80 % like the settings. It just charges past 80 % mark.

Which settings did you use? Do you mind sharing the printscreen of that setting page you have for your Redmi Note 3?
[Android Apps and Games] HikingMoose:
I'm still on 0.5, and haven't tried the latest version - but how does one change which file the app chooses? It's automatic since 0.5 and can't be clicked.
[Android Apps and Games] Dziewan:
Yeah, its working, just checked. You need to check "charging_enabled (Generic)"on xiaomi phones
[Android Apps and Games] skeeter123:
...seems to be working (V0.7) on OnePlus 3T running Zenity RR ROM) using default settings. I haven't let it drop below 78% yet...

Thanks, sriharshaarangi !!:good::D
[Android Apps and Games] real_milux:
It's automatic if only one file is available on your device. Otherwise, you can switch between the available files.

Other question:

Some time ago, somebody stated that a low charging level is also harmful for battery longevity.

Can somebody provide a link to research about that? Because I don't see why it would harm the battery, unless you deep discharge the battery, which would kill it entirely.
[Android Apps and Games] hgmichna:
Low charging level

To my knowledge that is only true in certain situations. A low voltage above 3.6 V does not harm a Li-Ion battery.

The only caveat is that the battery can be harmed if not used and not charged due to self-discharge below the lowest safe voltage.

So for your practical purposes I would say, no, that is not true.
[Android Apps and Games] real_milux:
v0.8

Harsha and me did some experiments with "real" developer keys the last days.

However, the build process on his machine doesn't work well yet for whatever reasons, we try to sort it out.

Here is the link to the 0.8 build, that's the most recent version, signed with our new development key:

https://mega.nz/#!4gEB2bRJ!jkFYRLcibVA6Xw5CtUjb-gpDSY7CiHE2NSY1OfzeBBA

IMPORTANT: New key means also that the old version has to be uninstalled, before installing, otherwise the installation will fail!

Changelog:

Detects charging state after reboot and starts service if power supply is detected.

Bugfix: For charging_enabled and files with equal semantics, service was restarted on every refresh. This has been fixed.