Java android.hardware.usb UsbManager fields, constructors, methods, implement or subclass

Example usage for Java android.hardware.usb UsbManager fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.hardware.usb UsbManager.

The text is from its open source code.

Field

StringACTION_USB_STATE
Broadcast Action: A sticky broadcast for USB state change events when in device mode.
StringACTION_USB_DEVICE_ATTACHED
Activity intent sent when user attaches a USB device.
StringACTION_USB_DEVICE_DETACHED
Broadcast Action: A broadcast for USB device detached event.
StringACTION_USB_ACCESSORY_ATTACHED
Activity intent sent when user attaches a USB accessory.
StringACTION_USB_ACCESSORY_DETACHED
Broadcast Action: A broadcast for USB accessory detached event.
StringEXTRA_DEVICE
Name of extra for #ACTION_USB_DEVICE_ATTACHED and #ACTION_USB_DEVICE_DETACHED broadcasts containing the UsbDevice object for the device.
StringEXTRA_PERMISSION_GRANTED
Name of extra added to the android.app.PendingIntent passed into #requestPermission(UsbDevice,PendingIntent) or #requestPermission(UsbAccessory,PendingIntent) containing a boolean value indicating whether the user granted permission or not.

Method

UsbAccessory[]getAccessoryList()
Returns a list of currently attached USB accessories.
HashMapgetDeviceList()
Returns a HashMap containing all USB devices currently attached.
booleanhasPermission(UsbDevice device)
Returns true if the caller has permission to access the device.
booleanhasPermission(UsbAccessory accessory)
Returns true if the caller has permission to access the accessory.
ParcelFileDescriptoropenAccessory(UsbAccessory accessory)
Opens a file descriptor for reading and writing data to the USB accessory.
UsbDeviceConnectionopenDevice(UsbDevice device)
Opens the device so it can be used to send and receive data using android.hardware.usb.UsbRequest .
voidrequestPermission(UsbDevice device, PendingIntent pi)
Requests temporary permission for the given package to access the device.
voidrequestPermission(UsbAccessory accessory, PendingIntent pi)
Requests temporary permission for the given package to access the accessory.