4
votes

I'm trying to connect a usb sensor (see Toradex) to an android phone (Desire Z) running android 4.0.3.

To test this, I wrote a small app to enumerate the attached device(s).

This supposed to have USB HOST mode implemented and to power the usb sensor (HID)... but it doesn't.

I got a USB OTG cable and now, when I attach the cable, a small icon appears in the status bar (car mode).

I'm disappointed since I waited for this feature for awhile now...

Any thoughts? I read almost everything out there related to this (Sven work and whatnot) but I might have missed something...

Thanks!

1
I ditched the Desire Z and bought an Xperia Arc that supports USB OTG. Although the phone interacts with a mouse or keyboard (as expected via OTG cable), I cannot enumerate the devices via the API. What is the case the API should work? I've read in some (xda) threads that this is happening because of the 'other' devices not being whitelisted and the solution would be to add the 'other' usb providers into the kernel. Please advise :(Viorel Stolea
Started to work with the next system update... ;)Viorel Stolea

1 Answers

0
votes

I have worked a lot in the past year and a half to build custom android platform. Some was under Froyo but mostly on Gingerbread. Most on the hardware I added was on either a UART or on USB, which is what you want to do. Unfortunately, it is not as easy to add a USB peripheral on an Android device than on a PC or a MAC. PCs and MACs have virtually unlimited memory space (hard drive). They can hold the drivers of a very large number of devices. That makes it possible to do auto-detection and automatic loading of drivers. On an Android device, it is a lot more lean therefor, just the required drivers are stored on the device. Every time I added a new device, I had to compile the driver for my platform and make some modification in my configuration. It is also possible to load the driver as a module instead of compiling it with the kernel (gives a file.ko output). Although, the driver must have been written accordingly. But, you will have to install it by modifying the "init.rc" which requires root privilege.

here is a few link of question/answer about about drivers in Android. That should give you a little bit more info: USB touchscreen driver

Hope it helps but unfortunately, it is quiet a lot of work do do.