Android Question Error with external storage

Giusy

Active Member
Licensed User
Hi,
I copied these instructions from the forums
B4X:
Dim extFolder As ExternalFile = Storage.FindFile(Storage.Root, folder)
Log("Folder found: " & extFolder.IsInitialized)
If extFolder.IsInitialized Then
   Dim extFile As ExternalFile = Storage.FindFile(extFolder, filename)
   Log("File found: " & extFile.IsInitialized)
   If extFile.IsInitialized Then
       Dim rp As RuntimePermissions
       Dim out As OutputStream = File.OpenOutput(rp.GetSafeDirDefaultExternal(""), filename, False)
       File.Copy2(Storage.OpenInputStream(extFile), out)
       out.Close
   End If
End If
But I have mistakes, what did I forget?
Thanks
 

Attachments

Giusy

Active Member
Licensed User
Solved with
If File.Exists("/storage/extSdCard", "pippo.txt") Then
 
Top