As far as I know, LiIon batteries should be kept in about 40%-80% range in order to degrade more slowly.
On my laptop I use the following commands to make it change battery conditionally, only when it's lower than 45% and up to 90% instead of to 100%:
tpacpi-bat -v -s ST 1 45
tpacpi-bat -v -s SP 1 90
How do I do the same for Android? I can control the charger from software, so it should be definitely possible.
Device: Huawei Honor 6 (H60-L04)