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

1

6

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?

Bassorilievo answered 27/6, 2013 at 20:16 Comment(0)
B
5

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.

Bassorilievo answered 27/6, 2013 at 20:16 Comment(1)
But, isn't Android by default a client? So while this would not match the question, it would allow (and does allow) connecting an Android device to PC and transfer data. Why would having USB OTG get on the way, with proper (i.e. strd A/B cable) this would just work?Tifanytiff

© 2022 - 2024 — McMap. All rights reserved.