We have an Android Application which has to be installed at Client Location in Tab and the tab has to be charged and running continuosly without getting tab turn off which leads to battery health drop. So We have to implement a solution in our app where the user can set some limit to charging to control even if the charger is connected physically.
(Example: If i set some 80% as higher limit and 20% as lower limit then the tab should get stop charging when it reaches to 80% and start charging when it reaches to 20% automatically).
Can someone Please tell me Is there any way to do this.
Thanks in advance.
You may need to use BroadCastReceiver with intent-filter on BroadcastReceiver try to get battery Level via BatteryManager: