Android Question load to application start application .csv file

fgh3966

Active Member
Licensed User
Hello Everybody

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

It is possible ?

Thanks.
 

Attachments

  • csvBase.zip
    13.8 KB · Views: 114

fgh3966

Active Member
Licensed User
(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
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
if file dir.asset is a read only it's good for me
you still do not get it.

You can NOT copy the result from ContentChooser to DirAssets.
 
Upvote 0
Top