This is a partial Java port of the ESP loader from https://github.com/espressif/esptool I also got it to run on Android for my Rocket altimeter application https://github.com/bdureau/BearConsole2/tree/master/app/src/main/java/com/altimeter/bdureau/bearconsole/Flash