2

I have a Archos a28 internet tablet running Android Froyo 2.2. I have a HID Input class device that I would like to get working on Android. The tablet itself is already capable of handling a mouse and USB Flash drive out of the box.

I would like to my USB device with the a28. It is a custom designed device. I need to be able to read and write the raw USB input and output reports to and from the device.

How can I accomplish this? I have heard that it might be possible to create a module to do this.

Brian
  • 6,910
  • 8
  • 44
  • 82
  • Can you give more specific information on the device you want to connect. Some devices have their own drivers such as FTDI USB interfaces that may be easier to use than doing all the low level USB from scratch. – Romain Hippeau Jan 01 '11 at 20:20
  • FTDI USB is Uart over USB, not true USB. You would need to consume a VCOM driver. I agree this is easier, but we've already gone to the trouble of developing a HID compliant device, so VCOM is not an option at this point in the game. We just need to get our device running on Android, which means consuming the existing Linux HID driver. – Brian Jan 04 '11 at 01:54
  • Here is a comment from #android-dev on freenode: what you need is to write a service and somehow hook it into udev (might need superuser permissions, I guess) and then talk to /dev/input/* files which include devices from HID driver. – Brian Jan 04 '11 at 01:58

1 Answers1

1

Essentially you need to do two things:

First, you need to get the custom USB device working with linux. Eventually, the linux underlying the android stack on the tablet. But first, you probably want to get it working with a desktop linux where it is easier to experiment interactively. Probably this will involve loading or even modifying a kernel driver, and possibly setting up rules to have it automatically loaded. Once you have that going, document what you did and do the equivalent for the linux of the android tablet. This almost certainly requires root. In the android context, the method of autoloading the driver on connection may be different, but the driver itself would be essentially the same, only compiled against the appropriate kernel.

Second, you need to make the device available to application programs. If you only desire to make it available to custom programs, you may be able to do this via direct interaction with a device file, or creating something in /proc or /sys. Controversially, those files would have to either be world accessible, or you would have to patch another special group ID/android permission pair into the stack and let that group own the file to make it available to applications which have that android permission. A more sophisticated approach would be to write a low level service which manages the device, and exposes it to android applications via the usual binder-based android service communication mechanism.

Chris Stratton
  • 39,853
  • 6
  • 84
  • 117