How to programmatically find a USB storage path?

I connected a USB drive to my phone and I used

getExternalFilesDirs("");

to find all directories, including sdcard and USB.

The path to the SD card comes out correctly, but the USB function is not called by the function.

In any case, find the relative USB path instead of the absolute path?

I got stuck in this problem for several weeks but received nothing.

+4
source share
1 answer

Due to Android permissions, you may not be able to do this, but here's a recommendation anyway. Try reading the contents of / proc / mounts and grep "sda1". It will show you the connection point of your USB drive.

0
source

All Articles