This is one of the issues keeping Android from being an excellent platform for music applications. Coupled with the general hackability of Android devices (Accessory Development Kit, etc.), it could be an amazing platform for digital audio workstations, synthesizers, samplers, and audio effects processing.
iOS is better in this regard, but still not perfect. Audio routing between applications is a dicey affair (done through a 3rd party app that runs in the background), and it's not possible to charge while using USB accessories, like audio interfaces or MIDI keyboards.