0
votes

i have a USB device (fingerprint reader) which I'd connect to the Galaxy S2 (since it supports USB host mode) and use it in my own app exploiting newest Android USB APIs http://developer.android.com/reference/android/hardware/usb/UsbDevice.html

When I connect the reader to the phone, it says "unknown USB peripheral device" and the reader is switched on, so there is no power supply problem. I have the Linux driver source code of the reader, so I can compile it for ARM architecture if necessary.

How can I integrate this driver in the Android kernel (if possible, since it is based on Linux)?? Is possible to create a separate module?? root privileges are absolutely needed?

Or simpler maybe, can I determine the peripheral type through the USB APIs??

3
It looks like the official USB host api's only come in at api level 12, while the S2 seems to ship with Gingerbread (api level 9 or 10) so it's not clear if that method would be available unless samsung somehow backported it. If you can install a custom kernel on that device, or you have root and it already supports modules, and the appropriate sources have been released by now, then the traditional linux kernel driver method should be possible.Chris Stratton
it used to work but apple sued.b_yng

3 Answers

0
votes

I know there could be an incompatibility with the APIs. But since Galaxy natively supports USB Host mode maybe there is no problem...

However, regarding the driver integration into the kernel with a separate module, is there a guide which explains the procedure?

0
votes

You can find a guide for the integration here: http://android.serverbox.ch/?p=285

Though this example shows how to compile a ftdi driver for Honeycomb, it could get you started.

0
votes

You will have to compile your linux driver as a module to get a "fingerprintdriver.ko". Do exactly as if it was a linux 2.6.35 (version depends on your Android version) driver with the ARM cross compiler. Now, I've seen on blogs that you should get the ARM compiler from the Android tool kit since there is a small difference in it that sometimes make a difference but I never tried it myself since I'm using the one provided with the Android Dev kit. Then you will install it with the command "insmod /modules/fingerprintdriver.ko". You should also put it in the "init.rc" file so it installs itself at boot time. But depending on the driver, it might not (most likely not) be seen by the Android API. If it's what you want, you will have to write the piece of code to get the device to be seen as, for example, a "sensor". Then your device would get available to the whole community of Android programmer. If you just want to use it just for your own purpose and not by the whole Android app programmer community, you probably just want to use it through the USB API. Much less work for you.

Hope that little piece of info is of some help.