Upload HEX to Arduino via Bluetooth in Java

Hi at all! I have a Arduino Uno board, with Optiboot bootloader. I am using a HM-10 BLE adapter. I want to be able to upload HEX files using bluetooth in Java. When I press Reset on the Arduino Uno board, it sends the AT+MODE2 command on the BLE service, then the sketch executes. So, what is the way to talk with the Optiboot bootloader and upload the HEX file? Thanks in advance!


????? Please, it's important!

Optiboot bootloader doesn’t do that. You need to find another method.
Perhaps a bootloader change, link below, and a short sketch to use the flash-writing capability of this new bootloader, that then jumps to the newly loaded .hex file when it finishes loading? New sketch can check a byte somewhere to determine if a new sketch is to be added on a reset? Timeout out on Bluetooth if no sketch?

There is this app: http://www.apploader.info/

How does it perform the upload? I don't know... Can someone explain it?