Bug? File.ListFiles(File.DirAssets) different behaviour B4A / BaJ - klaus    
Feb 12, 2020   
(4 reactions)There is a difference between B4A and B4J with File.ListFiles(File.DirAssets).
This code works in B4A but not in B4J:
For Each FileName As String In File.ListFiles(File.DirAssets)
This code works in...
link: There is no bug here.
As the documentation in B4J says File.ListFiles doesn't support listing...
link:
So, the system behind should handle this difference and not oblige the user to take care of it, wel...
link: life.
In our case, there are two possibilities: File.DirAssets or "../files/".
So...
B4A Question File.ListFiles(File.Assets) in Debug - lip    
Sep 21, 2021.
'Get files from Tablet
Dim AssetFiles As List
AssetFiles = File.ListFiles(File.DirAssets... there are 21 files found by ListFiles. However, if compile in debug there are 32 files. The additional...
link: the list of files you need to use in that text document. Then your app can open the (known) text...
link:
How did the files get into that directory? Where did they come from? And how did you know...
link: I am
This works, unless I am lost also:
For Each f As String In File.ListFiles(File.DirAssets...
B4A Question [Solved] ExternalStorage.ListFiles behaving unexpectedly - agraham    
Dec 16, 2018 Long UK.jpg
ListFiles =Lat Long UK.jpg
for a known file
/storage/0000-0000/Maps OS 1000K/Lat Long... FindFile and ListFiles are looking in this folder and not the expected one. If I set filename to...
link: ListFiles "For Each f As JavaObject In files" uses the same JavaObject instance, "f"...
link: This is a workaround for the unexpected behaviour in ListFiles. Each ExternalFile in the returned...
link: We are having phone/Inernet problems so if I don't respond I'm not deliberately ignoring you...
B4A Question File.ListFiles usage - Erel (first post)    
Aug 12, 2025You can use ExternalStorage or ContentChooser to access those files. See the link above....
link: Thanks. I'm a newbie, so I might ask silly questions. I need to edit some files in the internal...
link: /saveas-let-the-user-select-a-target-folder-list-of-other-related-methods.129897/#content...
link: mylist As List = File.ListFiles("/storage/emulated/0/Android/media/com.whatsapp/WhatsApp...
B4A Code Snippet [B4X] CopyFolder / DeleteFolder / RecursiveList - Erel    
Oct 19, 2025   
(26 reactions), "")
For Each f As String In File.ListFiles(Source)
If File.IsDirectory(Source, f... As String In File.ListFiles(folder)
If File.IsDirectory(folder, f) Then
DeleteFolder... As List)
For Each f As String In File.ListFiles(File.Combine(Root, Folder))
Result.Add(File...
'Recursively lists the files in the given folder.
'Relative - Whether paths collected are relative to...
RecursiveListHelper(Root, File.Combine(Folder, f), Result)
End If
Next
End Sub
...
B4A Question file.listfiles not working. only returns one file - apti (first post)    
Jan 28, 2025 but not seeing where I would be able to choose a folder from the users file area. I just want to get a listing of what is in the chosen folder. I can get to the point of choosing the folder just not...
link:
No one should use ListView.
What is the output of:
Log(MusicFolder)
Log(File.ListFiles...
link: found it. had to request permission to read and now I get what I expected. I think we need a better ...
link: No one should use ListView.
What is the output of:
Log(MusicFolder)
Log(File.ListFiles...
B4i Question [SOLVED?] Bug in File.ListFiles in Release mode - JackKirk    
May 6, 2017 Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
Private wrk_files As List
Private wrk_str As String
Private wrk_ptr As Int
'Get names of files in assets directory
wrk_files = File.ListFiles(File.DirAssets)
'For all files...
For wrk_ptr = 0 To...
link: You shouldn't use File.ListFiles with the assets folder. I will add a note about it in...
link: ).
You shouldn't use File.ListFiles with the assets folder. I will add a note about it in...
B4A Question File.ListFiles only listing folders - Luthier (first post)    
Dec 18, 2023Thank you Erel.
Not sending it to Google Play and App now showing files having set targetSdkVersion to 28....
link: The problem is not in File.ListFiles. As @DonManfred wrote, the only accessible path is XUI...
link: File.ListFiles(dir) or the async version.)...
link: What is the exact path you want to show/list? Depending in TargetSDK you are not able to access...
B4J Question Resumable subs with recursive File.ListFiles to update UI - walt61    
Jun 3, 2017 As String)
LabelFolder.Text = fldr ' Show this folder
For Each x In File.ListFiles(fldr... after returning from a subfolder
Else
fList.Add(File.Combine(fldr, x)) ' Found a file; add it to list 'fList'
End If
Next
End Sub...
link: Thanks for your help guys;
@LucaMs : that was the first thing I tried as it looked straightforward, but the recursion seemed to thro...
link: :${flist.Size}"$
Sleep(0)
Dim entries As List = File.ListFiles(fldr)
If entries...
B4A Question File.DirRootExternal and ListFiles not working - Scantech    
Aug 28, 2020TargetSDKVersion 29 and Android-29 does not work with l1.AddAll(File.ListFiles(File.DirRootExternal))
We can't populate list in File.DirRootExternal. Is there anyway to populate the list from...
link: Please do not make duplicate threads....
link: Oh, now I gotcha.
Maybe this might help:
https://www.b4x.com/android/forum/threads/externalstorage...
link: it.
I did do the workaround. Still no progress. It says list not initialized. I do not...
Page: 1  
2  
3  
4  
5  
6  
7