0

I need to access a pen drive connected via OTG to android device. With expolorer I can find the mount point in /storage/usbdisk. But, how can I find the mount moint dynamicallu via code?

Thank you! Roberto

1 Answers1

4

I'm afraid the only way to access OTG on a wide range of devices is by querying all these directories:

/storage/UsbDriveA     (all Samsung devices)
/storage/USBstorage1   (LG G4, V10, G3, G2, other LG devices)
/storage/usbdisk       (Moto Maxx, Turbo 2, Moto X Pure, other Motorola devices)
/storage/usbotg        (Sony Xperia devices, Lenovo Tabs)
/storage/UDiskA        (Oppo devices)
/storage/usb-storage   (Acer Iconia Tabs)
/storage/usbcard       (Dell Venue -- Vanilla Android 4.3 tablet)
/storage/usb           (HTC One M7, and some Vanilla Android devices)

Tested on my collection of devices and the devices of 3 other people, and a quick trip to Bestbuy for testing the latest flagships. The only popular devices I know I'm missing are Hawuei/Xioami devices based in China, which are becoming popular in English countries.

Hope this helps

Aaron Gillion
  • 2,227
  • 3
  • 19
  • 31