How to get list of USB accessories connected to android device?

前端 未结 2 1967
清酒与你
清酒与你 2021-01-21 09:13

I have a Lollipop based android box. The box has a USB port similarly to micro USB port in Android phones. I want to check if any host is connected to the USB port with the andr

2条回答
  •  滥情空心
    2021-01-21 09:24

    you can use the Android USBManager like in this thread Android : how to detect already connected usb device? or you can install libusb on android: https://github.com/libusb/libusb/tree/master/android

    (https://developer.android.com/guide/topics/connectivity/usb/host.html, https://electronics.stackexchange.com/questions/49140/what-exactly-are-the-difference-between-a-usb-host-and-device)

提交回复
热议问题