Android Question File.Exists Does not work with Asset directories

Devv

Active Member
Licensed User
This code will set the image without any error
B4X:
ImageView_LeftItem.SetBackgroundImage(LoadBitmap(File.DirAssets,"categories/" & tag1 & ".png"))

while this code returns false

B4X:
log(File.Exists(File.DirAssets,"categories/" & tag1 & ".png"))
i'am confused why the app cant check files inside folders in assets but can load them !

note: the file does exist in the assets folder
 

DonManfred

Expert
Licensed User
subfolder are not supported by b4a.
It does work and the files are inside the apk. But you can not use any File.Exists on any of the subfolders files.

Create a txt file with all the content (including subfolders) and put it in assets. Use the txt list then to check if a file is available.
 

ac9ts

Active Member
Licensed User
Since the asset folder is part of the app when you package it, you should already know what's in it.
 
Top