Android App and Communications via USB

2.4k views Asked by At

Ok, so I have researched this somewhat and am not encouraged, but I'm going to ask anyway, and be specific about what I'm trying to do. Maybe it will help!

I have a custom board with DaVinci processor with USB 2.0 OTG controller on it. I have it configured as a host with an attached hub and various peripherals. This processor runs Monta Vista Linux (MVL) 4.0 with 2.6.18 based kernel. This custom board some video processing and streaming.

I also have a Moto Droid. I can attach the phone as a USB device to my DaVinci system and MVL will enumerate the phone, but obviously doesn't know which driver to use. That I can fix.

So what I would ideally like to do is be able to have a data connection between my board and the phone, and use the phone with a custom app, as a configuration tool (initially). I'm thinking RNDIS would be wonderful, but I don't know if Android supports that on the USB port. Then my custom app would establish a connection over the USB to a server on my custom board.

Can anyone attest to what Android DOES support over USB, besides adb and flash file system?

Any other suggestions are welcome, although please don't tell me "Bluetooth", it doesn't have bandwidth for video, which is a future goal.

Thanks!

2

There are 2 answers

1
Frank Hunleth On

Is using 802.11 an option for you on the Davinci board? E.g. either via a Wifi USB dongle or through wired ethernet to an AP? If so, that would seem to be an easier route to communicate with Android than trying to go through USB. Or are your video resolution and compression requirements more than what you'd expect to realistically get through 802.11?

0
Femi On

For small amounts of data, you could look at Working Android with Arduino, which points at Microbridge (http://code.google.com/p/microbridge/) or you could also look at IOIO (http://ytai-mer.blogspot.com/2011/04/meet-ioio-io-for-android.html).

For things like video, adb port forward (http://developer.android.com/guide/developing/tools/adb.html#forwardports) could be you friend (assuming you have the networking stack on MVL all setup and adb configured). You can basically set up port tunnels for TCP over USB and shift reasonably large amounts of data over the link. One end of the connection (probably the android device) runs a TCP/HTTP server, and the custom board opens connections to communicate. This works reasonably well, you set up a thread running adb devices to detect the plugging in of the Droid device, run adb port forward to set up the port forward, then open your sockets and you're good to go.