I am developing an Android application in which I have to get details of USB device connected to Tablet via OTG .
when I use sys/bus/usb0/devices then I am getting list of all devices of Tablet while I want to only fetch device name attached via OTG port .
Is there ant way to get which device is in built and which device is connected to Tablet.
When I used path /storage/usb0/ and /storage/usbdisk0/ , then I didnt get any device whicle device is attached via OTG port.
Please can anyone tell me how can I get the USB details attached via OTG port to Tablet
Below example link provides data like :
1)The Device class
2)The USB device path
3)The Vendor ID (VID) and the Product ID (PID).
4)A List of all interfaces and their endpoints. etc...
来源:https://stackoverflow.com/questions/27601157/path-of-otg-in-android-device