Devv Active Member Licensed User Longtime User Feb 10, 2020 #1 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
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 Longtime User Feb 10, 2020 #2 File.Exists does not work with Files in Assets. Upvote 0
Devv Active Member Licensed User Longtime User Feb 10, 2020 #3 DonManfred said: File.Exists does not work with Files in Assets. Click to expand... but it worked for me with this B4X: Log("get, " & File.Exists(File.DirAssets, "categories.json")) seems it does not work'd with folder only Upvote 0
DonManfred said: File.Exists does not work with Files in Assets. Click to expand... but it worked for me with this B4X: Log("get, " & File.Exists(File.DirAssets, "categories.json")) seems it does not work'd with folder only
DonManfred Expert Licensed User Longtime User Feb 10, 2020 #4 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. Upvote 0
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 Longtime User Feb 10, 2020 #5 Since the asset folder is part of the app when you package it, you should already know what's in it. Upvote 0