Sending data from PC to Android device using USB OTG

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

Code for sending data from the host to the client using the API exists. However, it is difficult for me to find the code to send data from the client to the host.

Can I send data from a PC to Android using USB OTG?

+4
source share
1 answer

Unable to send data this way. Android devices with USB-OTG will act as a USB host. The PC only has the capabilities of a USB host. Thus, by connecting the USB cable directly from the USB port of the PC to the Android device with USB OTG, you are trying to connect two USB hosts together - this does not work!

It also means that you cannot send data from an Android device to a PC using USB-OTG.

If you want to establish a connection between an Android device and a PC, there are other methods. The serial interface via USB and Android ADK come to mind.

+2
source

Source: https://habr.com/ru/post/1488581/


All Articles