I've given this a serious try a few times, on both phones and tablets, because I am keen for an ultra-portable dev setup. Unfortunately Android falls pretty short, even though Termux is amazing. I've never been able to stick with it long term.
For me, a much better small and cheap dev setup is the Raspberry Pi, particularly the new Raspberry Pi 4. Pair it with a bluetooth keyboard, a portable Monitor, and a battery pack, and it's nearly as good as a laptop, but much more hackable. And you get an actual GNU/Linux development environment.