Example usage for Java android.hardware.usb UsbManager fields, constructors, methods, implement or subclass
The text is from its open source code.
String | ACTION_USB_STATE Broadcast Action: A sticky broadcast for USB state change events when in device mode. |
String | ACTION_USB_DEVICE_ATTACHED Activity intent sent when user attaches a USB device. |
String | ACTION_USB_DEVICE_DETACHED Broadcast Action: A broadcast for USB device detached event. |
String | ACTION_USB_ACCESSORY_ATTACHED Activity intent sent when user attaches a USB accessory. |
String | ACTION_USB_ACCESSORY_DETACHED Broadcast Action: A broadcast for USB accessory detached event. |
String | EXTRA_DEVICE Name of extra for #ACTION_USB_DEVICE_ATTACHED and #ACTION_USB_DEVICE_DETACHED broadcasts containing the UsbDevice object for the device. |
String | EXTRA_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. |
UsbAccessory[] | getAccessoryList() Returns a list of currently attached USB accessories. |
HashMap | getDeviceList() Returns a HashMap containing all USB devices currently attached. |
boolean | hasPermission(UsbDevice device) Returns true if the caller has permission to access the device. |
boolean | hasPermission(UsbAccessory accessory) Returns true if the caller has permission to access the accessory. |
ParcelFileDescriptor | openAccessory(UsbAccessory accessory) Opens a file descriptor for reading and writing data to the USB accessory. |
UsbDeviceConnection | openDevice(UsbDevice device) Opens the device so it can be used to send and receive data using android.hardware.usb.UsbRequest . |
void | requestPermission(UsbDevice device, PendingIntent pi) Requests temporary permission for the given package to access the device. |
void | requestPermission(UsbAccessory accessory, PendingIntent pi) Requests temporary permission for the given package to access the accessory. |