Path of OTG in Android device

Neha Shukla picture Neha Shukla · Dec 22, 2014 · Viewed 8.1k times · Source

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

Answer

Mukesh Parmar picture Mukesh Parmar · Apr 2, 2015

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...

see github example