I want to load a file for example csv file, that are into the directory Téléchargement and use it as if it had been supported by this sub.
B4X:
Private Sub HandleLoadResult(Result As LoadResult)
If Result.Success Then
Try
Dim Reader As TextReader
Reader.Initialize(File.OpenInput(Result.Dir, Result.FileName))
' Dim line As String
line = Reader.ReadLine
' stringList.Add(line)
Do While line <> Null
line = Reader.ReadLine
stringList.Add(line)
increm = increm +1 ' nombre lignes dans le CSV
Loop
Reader.Close
' chainetexte = File.ReadString(Result.Dir, Result.FileName)
toast.Show($"File '${Result.RealName}' loaded"$)
Catch
chainetexte = "Error loading file"
'Log(LastException)
End Try
End If
' LoadGTR2
Log ("nbre lignes "&increm)
' txtField.Text = chainetexte
End Sub
(google traduct)
I did some research to navigate the Android path and it's not easy and Google doesn't simplify the task.
Can you tell me where to find content chooser documentation and if possible examples
So we need a variable as complex as Type LoadResult?
(Success As Boolean, Dir As String, FileName As String, RealName As String, Size As Long, Modified As Long, MimeType As String
THANKS