How can I have my device charge only when battery is below a given percentage? So I've mounted my Nexus 7 onto a wall and use it as a sort of info screen / home automatisation device. Now this would require the screen to be on all the time which is why I want it to be connected to a charging cable 24/7.

Is there a way I can make the device start charging when the battery level falls below 10%? I don't want it to be charging all the time as this would wear off the battery pretty quickly.

I don't have root access.
No, It is not possible on unrooted devices and yes, it can be done on rooted devices.

In a rooted device,

Add a permission to Android : android.permission.WRITE_SECURE_SETTINGS.

Then, system call the set function of the BATTERY_STATUS_CHARGING
from the BatteryManager with a 0 value.

To automate this function, use a third-party application like Tasker to set a trigger on Battery % &lt; 10 to do the forementioned system call.