Absolute path of storage connected via OTG in Android,
I have tried using storage access framework i can get the content uri of the directory selected but i couldn't convert to absolute file:// path.
https://developer.android.com/reference/android/content/Intent.html#ACTION_OPEN_DOCUMENT_TREE
I need to store the absolute file path to scan the directories when the app is opened or when user access the folders.
As explained in SO How to get the file path from a device acting as a usb mass storage in android
this does provide the natively mounted otg storage devices, Samsung device natively mount the storage device where you can get the absolute path, but other device its not mounting natively,
I have tried out with String sdcard_path = System.getenv("SECONDARY_STORAGE"); it won't provide the usb mounted path.
Environment.getExternalStorageDirectory() provides the internal mounted device path /storage/emulated/0/ /sdcard/
not the otg mounted storages.