Is there a way to get the Volume label or name of the storage URI returned by the storage access framework?
For example:
content://com.android.externalstorage.documents/tree/8173-1901%3A
The label of that sdcard as shown in file managers is VideoClips, which is what I want my app to use. It would be confusing to the user if my app keeps referring to it as 8173-1901.
You can get more information about an ExternalFile with this code:
B4X:
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim rs As ResultSet = ctxt.RunMethodJO("getContentResolver", Null).RunMethod("query", Array(f.Native.RunMethod("getUri", Null), Null, Null, Null, Null, Null))
If rs.NextRow Then
For i = 0 To rs.ColumnCount - 1
Log($"Column: ${rs.GetColumnName(i)}, value: ${rs.GetString2(i))}"$
Next
End If
I was just about to also ask how to get those details of an externalfile Thank you for that code.
But I what i'm asking about is the name of the removable storage so that if I ask the user to select a folder in order to get a persistable uri it will be easier to give an instruction like "Swipe from the left edge of the screen then tap VideoClips" instead of saying "tap 8173-1901" because that's nowhere to be seen in the dialog, especially if there's more than 1 removable storage present.