I created an app (apk) to run MicroPython WebREPL on Android. Imagine you have your ESP8266 (with the MicroPython firmware) in some location where the only access to it is via a wireless connection. If you need to access and change/control it, you will need WebREPL.
Of course, a wireless enabled laptop would get access to WebREPL if you have it installed locally. However, if you are connected to the ESP8266, you might not have internet access to remotely load the WebREPL code.
Alternatively, an Android phone provides the ultimate in portability but has no file system (per se) to store and load the WebREPL code from a browser like the laptop would. You probably could load the WebREPL code in a browser while connected to the internet, then switch over the WiFi to the ESP8266. However, I prefer an app.
So, to make WebREPL available thru an app on Android, I used Apache Cordova to create it. This is a ‘screen shot’ of how it appears on the phone:
If you are interested in the complete Apache Cordova project code to access the MicroPython WebREPL on Android, download it from HERE. If you are only interested in the apk (app) file, download it from HERE.
The current version of WebREPL uses a no longer supported version of an xterm emulator called term.js found HERE. While that version works on a PC browser and a browser (like Firefox) in Android, it does not work right inside of an Android app. The keyboard does not function right. So I replaced it with its predecessor called xterm.js found HERE.
If you are interested in the steps I took to create the app, here is what I did:
cordova create micropython
cordova platform add android
cordova plugin add cordova-plugin-device
cordova plugin add cordova-plugin-inappbrowser
Next, I customized the config.xml to add the MicroPython icon by adding this line:
<icon src="MicroPython.png" />
Then I download the png graphic and put it in the micropython directory with the name MicroPython.png.
Next, I went to the micropython/www directory and removed everything there. Then I copied over to it these files from where I unzipped the webrepl code:
I renamed webrepl.html to index.html. Next, I copied over to it (micropython/www) all of the files and directories in the dist directory of the unzipped xterm.js. Then, index.html needed to be changed a bit to use xterm.js vs term.js.
Finally, I built the apk with the command:
cordova build android
and installed it in the phone. After connecting the Android phone wirelessly to the ESP8266 to get an IP address, the MicroPython WebREPL on Android apk is ready to run!