5

I connected USB storage to my phone and I used

getExternalFilesDirs("");

to find all directories including sdcard and USB.

The path of sdcard comes out correctly, but USB path does not come out by the function.

Is there anyway to find relative path of USB instead of absolute path?

I've been stuck at this problem for few weeks, but got nothing.

jww
  • 97,681
  • 90
  • 411
  • 885
Jun
  • 73
  • 1
  • 5
  • i think you are finding http://stackoverflow.com/questions/11291882/how-to-access-usb-path-in-android – Keyur Lakhani Jun 22 '15 at 09:18
  • Also see [UsbEndpoint](https://developer.android.com/reference/android/hardware/usb/UsbEndpoint.html) and [UsbConstants](https://developer.android.com/reference/android/hardware/usb/UsbConstants.html) in the Android developer docs. Otherwise, we need to see the code you using to discover the paths. – jww Jun 22 '15 at 09:36

1 Answers1

0

Due to Android permissions you may not be able to do this, but here's the recommendation anyways. Try to read the contents of /proc/mounts and grep "sda1". It'll show you the mount point of your USB drive.