Stay organized with collections
Save and categorize content based on your preferences.
android.hardware.usb
Provides support to communicate with USB hardware peripherals that are connected to
Android-powered devices.
For more information, see the
USB guide.
Use UsbManager
to access the state of the USB and to
communicate with connected hardware peripherals. Use UsbDevice
to
communicate with the hardware peripheral if the Android-powered device is acting as the USB host.
Use UsbAccessory
if the peripheral is acting as the USB host.
Classes
UsbAccessory |
A class representing a USB accessory, which is an external hardware component
that communicates with an android application over USB.
|
UsbConfiguration |
A class representing a configuration on a UsbDevice .
|
UsbConstants |
Contains constants for the USB protocol.
|
UsbDevice |
This class represents a USB device attached to the android device with the android device
acting as the USB host.
|
UsbDeviceConnection |
This class is used for sending and receiving data and control messages to a USB device.
|
UsbEndpoint |
A class representing an endpoint on a UsbInterface .
|
UsbInterface |
A class representing an interface on a UsbDevice .
|
UsbManager |
This class allows you to access the state of USB and communicate with USB devices.
|
UsbRequest |
A class representing USB request packet.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# android.hardware.usb\n\nAdded in [API level 12](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nandroid.hardware.usb\n====================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/hardware/usb/package-summary \"View this page in Kotlin\") \\|Java\n\nProvides support to communicate with USB hardware peripherals that are connected to\nAndroid-powered devices.\n\nFor more information, see the\n[USB](/guide/topics/connectivity/usb) guide.\n\n\nUse [UsbManager](/reference/android/hardware/usb/UsbManager) to access the state of the USB and to\ncommunicate with connected hardware peripherals. Use [UsbDevice](/reference/android/hardware/usb/UsbDevice) to\ncommunicate with the hardware peripheral if the Android-powered device is acting as the USB host.\nUse [UsbAccessory](/reference/android/hardware/usb/UsbAccessory) if the peripheral is acting as the USB host.\n\nClasses\n-------\n\n|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [UsbAccessory](/reference/android/hardware/usb/UsbAccessory) | A class representing a USB accessory, which is an external hardware component that communicates with an android application over USB. |\n| [UsbConfiguration](/reference/android/hardware/usb/UsbConfiguration) | A class representing a configuration on a [UsbDevice](/reference/android/hardware/usb/UsbDevice). |\n| [UsbConstants](/reference/android/hardware/usb/UsbConstants) | Contains constants for the USB protocol. |\n| [UsbDevice](/reference/android/hardware/usb/UsbDevice) | This class represents a USB device attached to the android device with the android device acting as the USB host. |\n| [UsbDeviceConnection](/reference/android/hardware/usb/UsbDeviceConnection) | This class is used for sending and receiving data and control messages to a USB device. |\n| [UsbEndpoint](/reference/android/hardware/usb/UsbEndpoint) | A class representing an endpoint on a [UsbInterface](/reference/android/hardware/usb/UsbInterface). |\n| [UsbInterface](/reference/android/hardware/usb/UsbInterface) | A class representing an interface on a [UsbDevice](/reference/android/hardware/usb/UsbDevice). |\n| [UsbManager](/reference/android/hardware/usb/UsbManager) | This class allows you to access the state of USB and communicate with USB devices. |\n| [UsbRequest](/reference/android/hardware/usb/UsbRequest) | A class representing USB request packet. |\n\n-\n\n Classes\n -------\n\n - [UsbAccessory](/reference/android/hardware/usb/UsbAccessory)\n - [UsbConfiguration](/reference/android/hardware/usb/UsbConfiguration)\n - [UsbConstants](/reference/android/hardware/usb/UsbConstants)\n - [UsbDevice](/reference/android/hardware/usb/UsbDevice)\n - [UsbDeviceConnection](/reference/android/hardware/usb/UsbDeviceConnection)\n - [UsbEndpoint](/reference/android/hardware/usb/UsbEndpoint)\n - [UsbInterface](/reference/android/hardware/usb/UsbInterface)\n - [UsbManager](/reference/android/hardware/usb/UsbManager)\n - [UsbRequest](/reference/android/hardware/usb/UsbRequest)"]]