Sending data from a PC to an Android device using USB OTG

user2461391 picture user2461391 · Jun 27, 2013 · Viewed 10.1k times · Source

I want to send data between a host (Android) and a client (PC) using the Android USB OTG API.

Code to send data from the host to the client using the API exists. However, I'm having difficulty finding code to send data from the client to the host.

Is it possible to send data from a PC to Android using USB OTG?

Answer

user2461391 picture user2461391 · Jun 27, 2013

It is not possible to send data that way. Android devices running the USB-OTG will act as a USB host. A PC only has USB host capabilities. So by connecting a USB cable directly from a PC's USB port to an Android device running USB OTG, you are attempting to connect two USB hosts together - which doesn't work!

That also means you won't be able to send data from the Android device to the PC using USB-OTG.

If you would like to communicate between an Android device and a PC, there are other methods. Serial through USB and Android ADK come to mind.