The host/slave selection is automatically done. In fact both are initialized and running simultaneously at all times. The library that enables the USB comms just does a check to see if data is available, and if so, send it or receive it.
The majority of the complications is in fact on the Android side.
I’ve had a few ideas on how to improve reliability, things like the Arduino auto-rebooting itself until the USB is connected.
A lot of the difficulty is lack of documentation and having to dig through code to find the problem.