Reputation:
I have tablet pc, which uses Android.
It's config:
marvell mohawk rev 0 v51
bogoMIPS: 797.00
Features: swp, half, thumb, fastmult, edsp, java, iwmmxt
cpu implementer: 0x56
cpu arch: 5te
cpu part: 0x840
cpu revision: 0
Hardware: pxa168 edge development platform
My aim is to develop my own driver, which will get stream from usb ( from the microscope ) and then render it in Android app in my tablet pc.
As I understand , I must learn not only arm v5 arch, but need to get arm-gnu C compiler and must know hot to handle byte stream from usb.
I have looked at usblib (OpenUSB) project, but seems to be it's not such clear project for arm arch and will cause a lot of problems.
So, how can I natively get stream from usb of my tablet pc ( armv5/android ), then obtain in in native part ( ndk ) than through JNI send data to Java and render it in my tablet pc.
Is the way I think correct and what troubles I shall get on this way?
Thanaks,
Best Regards
Upvotes: 2
Views: 1753
Reputation: 107839
Android runs on a Linux kernel. So what you're after is either a Linux kernel driver for your microscope, or a user mode program to interface with it (some USB devices can be driven entirely from user land). In either case, you'll need to root your device. Use the Android NDK if you need to write a native mode program. If you need to write a kernel module, get the kernel sources for your platform (either from https://android.googlesource.com/kernel/common.git or, if applicable, from a manufacturer-specific repository). Before you embark on writing a driver, check if there isn't already one for Linux; chances that it will work with minor adaptations if at all on Android (what definitely won't work is any Linux GUI application).
Upvotes: 1
Reputation: 8725
Android doesn't currently support 3rd party drivers for USB devices. However, starting with Android 3.1 (Honeycomb), there is a Java API to directly communicate with USB devices. You can write an Android application which detects and communicates directly with your microscope completely in Java. If the processing of the data coming from the microscope requires higher performance, you can write native code (through the NDK/JNI) to do the processing.
Upvotes: 1