Reputation: 1300
I am looking for a solution where my Android Device is connected to IoT devices such as Electric Imp, Arduino or Windows PC via USB.
So the requirement here comes that I want to write some data(text or binary data) at my Android USB port so that the other IoT devices which are connected via USB are able to read that data.
Android Device will act as a slave and IoT devices will act as master which will read the information.
Note: There is no connection with WiFi or Bluetooth, only via USB it is needed.
Upvotes: 0
Views: 1843
Reputation: 1
You would probably also be able access the usb data lines directly as a serial connection that carries the raw information.
Upvotes: 0
Reputation: 40397
This is in practical terms likely a bad idea as an architecture, but if you want to pursue it is is exactly what the Android USB Accessory Protocol was designed to enable.
You need an embedded device capable of being a USB host, the reference implementation was the Android Accessory Development Kit (ADK) thought that hardware was never a great choice and obsolete as even in it's era ARM MCU's with native USB host support were already common.
Note that this method is opposite that of "USB OTG" where the Android devices is the USB host. Although Accessory mode requires a more capable embedded hardware (with host vs only device support) Accessory mode is more widely supported by Android devices, some of which cannot function in OTG mode, and many of which rapidly run down their battery when doing so. But both suffer from the physical USB connection to a sculpted-for-a-hand phone often making an intermittent and easily damaged connection in comparison to the sorts of connectors typically chosen for interfaces which will be semi-permanently connected.
Upvotes: 0