Goodmorning everyone,
I'm trying to use this library for
Read a file in the Download folder
But I don't know how to pass the correct parameter,
I took the example from here:
Here is my code:
when I compile it gives me this error
B4A Versione: 10.70
Analisi del Codice. (0.01s)
Java Versione: 14
Building folders structure. (0.02s)
Compilazione del codice. (0.02s)
Compilazione del codice di layouts (0.03s)
Organizzazione Librerie. (0.03s)
(AndroidX SDK)
Compiling resources (0.24s)
Linking resources (0.44s)
Compilazione del codice Java prodotto. Error
B4A line: 139
ReaderFileTxt.Initialize(Storage.OpenInputStream
src\b4a\example3\main.java:434: error: incompatible types: String cannot be converted to _externalfile
_readerfiletxt.Initialize((java.io.InputStream)(_storage._openinputstream /*anywheresoftware.b4a.objects.streams.File.InputStreamWrapper*/ ((b4a.example3.externalstorage._externalfile)(_cnomefilearticoli)).getObject()));
I'm trying to use this library for
Read a file in the Download folder
But I don't know how to pass the correct parameter,
I took the example from here:
ExternalStorage - Access SD cards and USB sticks
Before we start: External storage means a real sd card or a connected mass storage USB device. This class can also be used to access the secondary storage (File.DirRootExternal). This becomes relevant with newer versions of Android that restrict direct access. It has nothing to do with runtime...
www.b4x.com
Here is my code:
B4X:
Private Sub Button1_Click
Private cNomeFileArticoli As String = "download/articoli.csv"
Dim ReaderFileTxt As TextReader
If File.Exists(File.DirRootExternal, cNomeFileArticoli)= True Then
'ReaderFileTxt.Initialize(File.OpenInput(File.DirRootExternal, cNomeFileArticoli)) ' works with SDK 29 does not work with SDK 30
ReaderFileTxt.Initialize(Storage.OpenInputStream(cNomeFileArticoli)) ' not correct
End If
End Sub
when I compile it gives me this error
B4A Versione: 10.70
Analisi del Codice. (0.01s)
Java Versione: 14
Building folders structure. (0.02s)
Compilazione del codice. (0.02s)
Compilazione del codice di layouts (0.03s)
Organizzazione Librerie. (0.03s)
(AndroidX SDK)
Compiling resources (0.24s)
Linking resources (0.44s)
Compilazione del codice Java prodotto. Error
B4A line: 139
ReaderFileTxt.Initialize(Storage.OpenInputStream
src\b4a\example3\main.java:434: error: incompatible types: String cannot be converted to _externalfile
_readerfiletxt.Initialize((java.io.InputStream)(_storage._openinputstream /*anywheresoftware.b4a.objects.streams.File.InputStreamWrapper*/ ((b4a.example3.externalstorage._externalfile)(_cnomefilearticoli)).getObject()));