Hi everybody,
Is there a full library or a simple way to select file and read it in B4A ?
I mean, I made my research. I have found the FilePicker library from @DonManfred
https://www.b4x.com/android/forum/threads/filepicker.69161/
Verygood by the way, but had to correct some permission problems in the example due to sdk26.
And for the reading part, there is the File object from Core lib. BUT, here is my code :
The problem is that I have the fullpath of the file in the shared var, something like, "lol/storage/emulated/0/convertcsv.csv"
and I cannot send it directly to the ReadString() method because it needs to be "lol/storage/emulated/0" and "convertcsv.csv". Yes, it's nothing really hard to deal with, but I don't want to cut my string, or split it with the "/" character, and extract the name, or etc...
So is there an existing thing more powerful than this ?
(FileChooser lib exists only in B4J if I'm right :/)
Is there a full library or a simple way to select file and read it in B4A ?
I mean, I made my research. I have found the FilePicker library from @DonManfred
https://www.b4x.com/android/forum/threads/filepicker.69161/
Verygood by the way, but had to correct some permission problems in the example due to sdk26.
And for the reading part, there is the File object from Core lib. BUT, here is my code :
B4X:
Sub FilePicker_onSelectedFilePaths(selected() As String)
Log($"FilePicker_onSelectedFilePaths(${selected.Length})"$)
For i = 0 To selected.Length -1
Log($"${selected(i)}"$)
shared = selected(i)
ReadStringExample
Next
fp.dismiss
End Sub
Sub ReadStringExample
Msgbox(File.ReadString(File.DirRootExternal, shared), "") 'NOPE :'(
End Sub
and I cannot send it directly to the ReadString() method because it needs to be "lol/storage/emulated/0" and "convertcsv.csv". Yes, it's nothing really hard to deal with, but I don't want to cut my string, or split it with the "/" character, and extract the name, or etc...
So is there an existing thing more powerful than this ?
(FileChooser lib exists only in B4J if I'm right :/)