My directory in directory Files

Dominex

Active Member
Licensed User
Longtime User
It would be possible to create a directory in the directory Files to order more files, and then call via code these files?

For example, if I create the directory /Files/MyDirectory/, I would use the following code to load files ... LoadBitmap(File.DirAssets & "/MyDirecotory/", "icon.png").
 

Mahares

Expert
Licensed User
Longtime User
To get the list of files in Dir.Assets you do this:
B4X:
Dim MyFile() As String
Dim Lista As List
Lista.Initialize
Lista=File.ListFiles(File.DirAssets)
'Lista=File.ListFiles(File.DirAssets & "/mydirectory")
For i=0 To Lista.Size-1
    MyFile(i)=Lista.Get
    Log(Lista(i))
    Msgbox(Lista(i),"")
Next

For a subdirectory in DirAssets try to use this line below. I never created a subdirectory in assets, so try it.
B4X:
Lista=File.ListFiles(File.DirAssets & "/mydirectory")
 
Upvote 0

Dominex

Active Member
Licensed User
Longtime User
To get the list of files in DirAsset this code works fine.

B4X:
Dim Lista As List
Lista.Initialize2(File.ListFiles(File.DirAssets))

But it does not work for subdirectories.

This code it does not work.

B4X:
Lista=File.ListFiles(File.DirAssets & "/mydirectory")
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…