Android Question Using a custom directory inside the default directory

Lakhtin_V

Active Member
Licensed User
Longtime User
Please help me solve my problem. I created a custom directory inside the standard directory (File.DirInternal).
File.MakeDir(File.DirInternal,"Sound"):
File.MakeDir(File.DirInternal,"Sound")
How can I get a list of files from this custom directory - "Sound" ?
B4X:
allFiles = File.ListFiles(File.DirInternal)
    For Each fName As String In allFiles
        If fName.ToLowerCase.EndsWith(".pcm") Then
The File.ListFiles command does not support specifying internal folders.
How can I save a file inside the SOUND folder?
B4X:
saveFile = File.OpenOutput(File.DirInternal, fName, False)
 

teddybear

Well-Known Member
Licensed User
saveFile = File.OpenOutput(File.DirInternal, fName, False)

As DonManfred said, do it like this

B4X:
saveFile = File.OpenOutput(File.Combine(File.DirInternal, "Sound"), "sound01.pcm", False)
or
saveFile = File.OpenOutput(File.DirInternal&"/Sound", "sound01.pcm", False)
 
Last edited:
Upvote 0
Top