I have been researching how some apps have been able to access some directories, I got to this point.
Now my issue, listing files in the chosen location.
Now my issue, listing files in the chosen location.
B4X:
Sub ion_Event (MethodName As String, Args() As Object) As Object
'Args(0) = resultCode
'Args(1) = intent data
If -1 = Args(0) Then
Log(Args(1)) 'Intent { dat=content://com.android.externalstorage.documents/... flg=0xc3 }
Dim folderUri As Intent = Args(1)
Log(folderUri.GetData) 'content://com.android.externalstorage.documents/tree/primary%3APodcasts
''Persist permission - Code from ChatGPT
Dim flags As Int = Bit.Or(folderUri.Flags, 1) ' READ Permission
flags = Bit.Or(flags, 2) ' WRITE Permission
'TODO: List Files from the location
Else
Log("Folder selection was canceled.")
Return Null
End If
End Sub
Last edited: