Hello, that's perfectly possible, actually I was selfhosting on android until recently. You can find more info in this post: https://lemmy.world/post/5342541
Unless you need some heavyweight lifting and you're ok with installing directly the applications (no docker, sorry), that's a good portable homeserver.
My only suggestion: buy an ethernet adapter as the WiFi connectivity will drop sometimes.
Keep us posted!
Based on my personal experience at least one year on a 5 years old mobile. It can last longer but I decommissioned it because I got a NUC.
I had setup a charge limiter (between 20% and 80%) with Magisk, initially it was through an automation in homeassistant but the battery usage was very high.
In terms of charge cycles it was one or two per day max