[Q] Where does Android map USB devices to the apps that handle them? - Android Software/Hacking General [Developers Only]

When I plug a USB device into an Android tablet, the OS has the ability to "know" what app needs to be launched in order to handle it. This is probably based on the VID/PID values that come from the USB device during configuration. But somewhere, Android must be storing the relationship between VID/PID and application. Where is that mapping stored? I've searched and cannot find anything on this topic.
Thanks!

Related

[Q] is /dev/bus/usb/* Standard in Android

I have an ePad (Android 2.1) that mounts usb devices in the normal Linux way so that I can use libusb to access them, I have managed to control my usb robot arm using an NDK app. Before I move onto making it a proper app instead of a hack job I wanted to know if the usb device files are standard to Android or if it's specific to my system.
Put it this way, if I make a nice cuddly app is it going to fail on most devices or work on most devices? (ones with USB OTG interface)
Sorry, I understand this could be a 'how long is a piece of string' type of question.
Many thanks,
Richard e Collins.
After a few hours of routing about on the internet I found an article on an exploit on the init daemon, google "android-root-source-code-looking-at-the-c-skills". This gave enough insight for me to deduce that this functionality I am getting is present on at least anything running 2.1 and above and is not a customisation unique to my device.

[Q] developing app to use USB webcam

Hello *,
a customer asked me to develop an app for Android tablets that should use an external USB webcam (UVC). The app should target any consumer tablet that has a USB Host interface and MUST NOT require rooting.
According to API level 12 docs or Android 3.1, it is possible to use any external USB device.
Until here is theory. Is it actually possible, in practice, and how hard can it be to write java code that implements a UVC driver in user space? The UVC standard documents are hundreds pages long and I fail to understand how much of that specs need to be implemented on the host side, and how much is eventually already implemented in the Android Linux kernels.

Accessing USB devices without root from Android NDK code

First up, I tried to post this in "Android Software Development" but unfortunately don't have the minimum 10 posts required to do so and didn't really feel like spamming the forums to make the count. If a moderator could move this post for me it would be greatly appreciated.
On an Android 4.0+ device (ie, contains the USB Host APIs), you can write applications that interface with USB devices that don't require root. Unfortunately I'm working with a codebase that is in C using libusb and while I've gotten a prototype working in a terminal emulator, at this stage it seems to require root to actually talk to the devices (enumerating devices seems ok though).
I had a look at the Android NDK API list but didn't see any reference to USB Host APIs leading me to believe that the only ones that exist are the underlying Linux APIs. Is there a way (without bouncing all calls to the USB Host APIs through JNI, or rewriting the entire thing in Java) to access USB devices when in USB OTG mode without root from Android NDK code?

[Q] Using USB Host API - cannot enumerate device

I am quite interested in usage USB host ability on my china no-name tablet based on Allwinner A13 CPU. I'd like to use it as GUI front-end for my embedded project with STM32F4 ARM microcotroller. So far I use laptop as the GUI for this device. STM32F4 is connected via USB as a vendor-specified device. I use WinUSB library on laptop to enumerate connected device and to open endpoints.
I'd like to use tablet instead of PC. So I looked to the USB host API on Android and tried to enumerate devices. However I couldn't enumerate any device - includes mouse or flash drive, which works perfectly in the system, but getDeviceList from UsbManager returns emtpy list.
I installed USB Host Diagnostics application and run a test. All results are yes, only items "Claims support" and "Device detected" in Android API shows no. But there's an item "Device detected" in Rooted API, which is yes.
I'm quite new to Andoroid developing. What is Rooted USB host API? How can I use it? Thank you for your answer.

Anyone know about USB Dev?

Hi,
Android Dev Noob and just looking at the SDK I have this question which probably someone will be able to tell be straight away.
I want to relay USB Host port data to a USB accessory port.
I am looking at the USB Host APIs >= Andriod 3.1
What I want to do is be able to relay the keyboard, mouse and touchscreen that I have connected on the host port and relay that to the OTG.
So here is my noob questions before I waste loads of time.
1... Is it possible to create device manifests on the fly.
I was thinking I could just make devices connected on the host appear as if they are on the accessory port.
If not then I guess I could create some default manifests and pick the most relevant.
2... This is hardware related but many tablets and android boxes have separate usb host & otg ports?
It is possible to have a host and accessory going at the same time.
This might makes things a little easier as the rationale is that I have a windows 8 machine and an RK3288 android box and I want to share the keyboard, mouse and touchscreen.
Video is easy as I can just swap the input between pc & hdmi.
I was thinking if I plugged all my devices into android I could just have a hot Key to redirect to windows 8 or don't capture and use devices on android.
I thought it might be a much simpler way without network needs and have read there are gesture problems with KVM products such as Synergy.
What do you think is it possible, does anyone know if this has already been done and there is an app?
Also if you have any better ideas or some pointers where to start all will be welcome.
Many Thanks
Stuart

Categories

Resources