1

Where is the USB class support implemented in Android devices, is it on the ANDROID version, or the chipset level?

In other words if I want to know if a specific smartphone supports for example UVC class, would I need to check the chipset or the Android version to know the answer to this?

Udi
  • 11
  • 1
  • If you want to use a specific USB device class as USB client connected to your Android phone the Android phone requires a driver to talk to the USB device. AFAIK the driver has to present in the Android/Linux kernel. Unfortunately the kernel on each device of the same Android version is similar but not the same (because each manufacturer modifies it). Therefore if a USB device is supported or not varies from smartphone to smartphone. – Robert Nov 10 '16 at 08:15
  • Thanks, that's real helpful. Would you know if there is a way to get this information from the vendors, do they advertise this sort of information? – Udi Nov 10 '16 at 09:35
  • I have not tested it but this question may be helpful for listing kernel drivers: [How can I get a list of all the active kernel drivers on my Android system?](http://stackoverflow.com/questions/8901631/how-can-i-get-a-list-of-all-the-active-kernel-drivers-on-my-android-system). – Robert Nov 10 '16 at 10:45

1 Answers1

1

The official way to determine if the device has USB host capability is to use the associated system feature.

Ideally, add a <uses-feature> element to your manifest, indicating that you are interested in the android.hardware.usb.host feature. If you do not absolutely need that feature, add android:required="false" as an attribute.

If you went with android:required="false", and you want to determine whether the device is a USB host at runtime, use PackageManager, hasSystemFeature(), and FEATURE_USB_HOST. FEATURE_USB_HOST is defined as the same string as you would be using in <uses-feature> (android.hardware.usb.host).

Muhammad Farhan Habib
  • 1,859
  • 20
  • 23