You are here
Home > Android >

USB Host API’s in the android.hardware.usb

When Android-powered device is in USB host mode, it acts as the USB host, powers the bus, and enumerates connected USB devices.


Manifest Requirements

Following things need to be add in Manifest file:

  • <uses-feature> element that declares that your application uses the feature.
  • Set the minimum SDK of the application to API Level 12 or higher.
  • add <intent-filter>(USB_DEVICE_ATTACHED) and <meta-data> .<meta-data> points to an xml file which contains vendor-id,produt-id,class,subclass,protocol.
  • to give information <usb-device> tag can be used.
<manifest ...>
<uses-feature android:name="" />
<uses-sdk android:minSdkVersion="12" />
<activity ...>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/xml_file_name" />

android.hardware.usb package

USB host API’s in the android.hardware.usb

Leave a Reply