Alexander Stolte Expert Licensed User Longtime User Jun 18, 2020 #1 Hey, i found on stackoverflow this thread: Android: Getting a file URI from a content URI? In my app the user is to select an audio file which the app then handles. The problem is that in order for the app to do what I want it to do with the audio files, I need the URI to be in file form... stackoverflow.com The first answer is, to use the ContentResolver.openinputstream: https://developer.android.com/reference/android/content/ContentResolver.html#openInputStream(android.net.Uri) Why is this missing in B4A?
Hey, i found on stackoverflow this thread: Android: Getting a file URI from a content URI? In my app the user is to select an audio file which the app then handles. The problem is that in order for the app to do what I want it to do with the audio files, I need the URI to be in file form... stackoverflow.com The first answer is, to use the ContentResolver.openinputstream: https://developer.android.com/reference/android/content/ContentResolver.html#openInputStream(android.net.Uri) Why is this missing in B4A?
Erel B4X founder Staff member Licensed User Longtime User Jun 18, 2020 #2 This is equivalent to: Code: Copy File.OpenInput(Dir, File) 'in ContentChooser event. It has nothing to do with getting a file URI. Upvote 0
This is equivalent to: Code: Copy File.OpenInput(Dir, File) 'in ContentChooser event. It has nothing to do with getting a file URI.
Alexander Stolte Expert Licensed User Longtime User Jun 18, 2020 #3 Erel said: 'in ContentChooser event. Click to expand... so? B4X: Copy Dim cc As ContentChooser cc.Initialize("cc") cc.Show("*/*", "Select file to be upload.") wait for cc_Result (Success As Boolean, Dir As String, FileName As String) File.OpenInput(Dir, FileName) 'in ContentChooser event. Upvote 0
Erel said: 'in ContentChooser event. Click to expand... so? B4X: Copy Dim cc As ContentChooser cc.Initialize("cc") cc.Show("*/*", "Select file to be upload.") wait for cc_Result (Success As Boolean, Dir As String, FileName As String) File.OpenInput(Dir, FileName) 'in ContentChooser event.