🔒 Closed Battery charge limit app can increase the longevity of your battery

Status
Not open for further replies.

JoKeR-26

Fanatic
Please read the following before installing the You do not have permission to view the full content of this post. Log in or register now.:
  • This app requires a rooted mobile(Android 4.4 or later)
  • All that the app modifies is /sys/class/power_supply/battery/charging_enabled to disable/enable charging
  • See below section
  • Before uninstalling the app, disable limit in the app before uninstalling(if not, reboot after uninstalling)

To know whether this app works for your mobile or not without installing the app:
(Note: If you mess with that file no need to panic, just reboot your You do not have permission to view the full content of this post. Log in or register now. and the file resets)

Method 1 (Using terminal emulator):
  1. Open terminal emulator
  2. Connect your mobile to the charger/USB
  3. Run the following command: echo 0 > /sys/class/power_supply/battery/charging_enabled
  4. If charging stops, then this app works for you. Otherwise, it will not.
  5. Run the following command to enable charging: echo 1 > /sys/class/power_supply/battery/charging_enabled
Method 2 (Using File Explorer):
  1. Open any root file manager
  2. Connect your mobile to the charger/USB
  3. Open the following file: /sys/class/power_supply/battery/charging_enabled (It should be 1 by default)
  4. Make it 0 while connected and save the file. If charging stops, then this app works for you. Otherwise, it will not
  5. Make it 1 again to enable charging
Method 3 (Using adb):
  1. You need adb installed on your computer, and enable usb debugging on your mobile(If you don't how to do, google it; there are many sources out there)
  2. Connect your mobile to the system
  3. Run the following command: adb shell "echo 0 > /sys/class/power_supply/battery/charging_enabled"
  4. If charging stops, then this app works for you. Otherwise, it will not work
  5. Run the following command to enable charging: adb shell "echo 1 > /sys/class/power_supply/battery/charging_enabled"
Usage instructions and app details:
  • Enable limit in the app
  • You can change the limit upto which it should charge(default: 80)
  • The app only gets kicked in while you connect a charger (or USB), and automatically closes shortly after unplugging charger(or USB) i.e It only runs in the background as long as it is plugged in, and it won't affect your battery life.
  • If your device is not charging even after disabling limit(which shouldn't happen, just in case), uninstall the app and reboot the device(The change made by the app doesn't survive a reboot). Your device should charge normally.
As I said, I have not tested the app on other devices. If it works on any other devices, please post it here.
I was searching for an app which does this, but I couldn't find one. Hence I have written one. The UI may not be great, but it servers the purpose, and is fully functional. If more people use this app, then I might add features and improve the UI.

FAQ
Q) Why do you want to limit charge to a lower capacity?
A) In short, to prolong battery life in long term usage. For more information, refer this : You do not have permission to view the full content of this post. Log in or register now.

Disclaimer: And lastly, though it does nothing except changing the mentioned file to enable/disable charging,
I am not responsible if anything wrong happening to your device. Try it at your own risk.

Thank you @You do not have permission to view the full content of this post. Log in or register now. bro for the icon!
XDA:DevDB Information
Battery Charge Limit, App for all devices (see above for details)

Contributors
You do not have permission to view the full content of this post. Log in or register now.

Version Information
Status: Beta
Current Beta Version: 0.1
Beta Release Date: 2017-02-15

Created 2017-02-15
Last Updated 2017-02-15

Attachment
You do not have permission to view the full content of this post. Log in or register now.

Download
You do not have permission to view the full content of this post. Log in or register now.
 
Status
Not open for further replies.

About this Thread

  • 6
    Replies
  • 2K
    Views
  • 7
    Participants
Last reply from:
realchaos40

Online now

Members online
756
Guests online
1,398
Total visitors
2,154

Forum statistics

Threads
2,273,537
Posts
28,950,256
Members
1,235,806
Latest member
dev4youu
Back
Top