Android Question copying from Dir...External to DefaultFolder not work

vmag

Active Member
Hello,
there was a problem with copying from DefaultFolder to DirRootExternal and it was perfectly solved here...
but it turns out there is a problem with copying from Dir...External to DefaultFolder I can't solve.
Need to copy to DefaultFolder from anywhere Dir External,
thanks in advance.
 

vmag

Active Member
Code with File.DirRootExternal = broken code.
Code with File.DirDefaultExternal = broken code.
Both will never work.
well, is there at least some way to just read the text file line by line from any external on android-31 + sdk?
For example, there is a trivial task - analyzing the contents of files, it turns out that only files installed with the program can be analyzed?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
For example, there is a trivial task - analyzing the contents of files
Google doesn't allow developers to directly access the external storage.

You should use ContentChooser to let the user choose the file and then read it with File.ReadList. This is actually quite trivial.

B4X:
Dim CC As ContentChooser
    CC.Initialize("cc")
    CC.Show("text/*", "choose image")
    Wait For CC_Result (Success As Boolean, Dir As String, FileName As String)
   If Success Then
     Dim lines As List = File.ReadList(Dir, FileName)
   End If
 
Upvote 1

vmag

Active Member
I felt that the solution should be simple, but I didn't think that to such an extent...
I've seen a lot of forums, but here is probably the most adequate support.
Thank you very much!
May God grant you all good health and a great mind for many years to come.
 
Upvote 0
Top