tags:

views:

68

answers:

2
+1  Q: 

Android USB I/O

OK, so i have seen all the stuff about how acting as a USB host is impossible on vanilla android, but is there anything in the Android API that would allow an app to override the default USB behavior in order to manually control the USB i/o responses, in order to support some other protocol? I have not seen anything that would facilitate this, but is it possible without hacking the kernel?

This seems like the sort of thing which should be relatively easy, but i haven't found anything. Forgive me if i've been googling incorrectly.

A: 

Last year I worked on an application that had a PC component and a smartphone component, and the two were communicating over a USB connection (using ADB port forwarding and regular sockets). So, if you want to do something like that, I'll show you how I did it, maybe it's helpful.

anothem
That's a clever solution... though raw access to the data stream would be ideal. But I certainly had not thought of that.
Robert Mason
I briefly explained what I did at the following link. There's also some sample code following the link at the bottom of the post. Hope it helps! http://www.anothem.net/archives/2010/02/15/communicating-over-the-usb-cable/
anothem
A: 

I believe that the stock kernel does not include the correct drivers for this. You need to be able to root your device and you need one of the devices capable of acting as a USB host.

See this page, http://sven.killig.de/android/N1/2.2/usb_host/

The linked page had source for the kernel and drivers you'll need ... GOOD LUCK, you'll need it

basszero