You do not need to flash anything. It's already available on Android phones even without root. I use it on unrooted Nexus 6p.
Google "Termux emacs".
Google "Termux emacs".
I started using it purely for the novelty of running emacs on my phone (a moto x pure) and it's a great piece of software. It's even open source!
Otherwise, the Logitech K380 Multi-Device Bluetooth Keyboard ( https://www.amazon.com/dp/B0148NPH9I/ref=cm_sw_r_other_apa_l... ) is great.