USB Host API’s in the android.hardware.usb Android by Manasi Dharne - April 26, 2019April 30, 20190 When Android-powered device is in USB host mode, it acts as the USB host, powers the bus, and enumerates connected USB devices. Contents Manifest Requirements Following things need to be add in Manifest file: <uses-feature> element that declares that your application uses the android.hardware.usb.host 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="android.hardware.usb.host" /> <uses-sdk android:minSdkVersion="12" /> ... <application> <activity ...> ... <intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> </intent-filter> <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/xml_file_name" /> </activity> </application> </manifest> android.hardware.usb package USB host API’s in the android.hardware.usb Share this:Click to share on Twitter (Opens in new window)Click to share on Facebook (Opens in new window)MoreClick to share on LinkedIn (Opens in new window)Click to share on WhatsApp (Opens in new window)Click to email a link to a friend (Opens in new window)Like this:Like Loading... Related