I would like to make an app on android which sends MIDI messages over USB to a computer to be able to control music softwares such as Cubase, FL, Reason, ect...
Hardware MIDI controllers (e.g Keyboards) are automatically recognized in music software on Windows. I guess it's because they use the universal MIDI protocol which is directly recognized by the music software. They don't need their own driver.
I'd like to be able to use my phone/tablet as a midi controller without having to install staff on the computer (like with hardware controllers).
There's a Demo Code on Android Developers to control a Missile Launcher toy through USB. If I send, using the same technique, messages that follow the MIDI protocol will it work just like that ?
Thank you in advance for your help
No, it doesn't work remotely like that.
USB MIDI devices do use a driver... it's just that they are generally "class compliant", and can all use the same stock driver that comes with the OS.
To do what you are proposing, you will need to emulate a device over USB... complete with the appropriate PnP IDs and what not. This is next to impossible. The code you found was for using USB in host mode, not the other way around.
You will find that it is far easier to send MIDI via network, and use one of the many network MIDI drivers available.