i need to know if a specified file is present in the asset directory like the example below. The file is present but the result is always false.
I have tried whit di prefix “\” or “//” but the result is the same.
Can anyone help me?
Try this /Makeroid/assets/your_file
You are the only one who can upload assets into your apk.
So why do you need to check if it exists?
If you did not added any into your assets then there are none
I have lot of galleries like this:
I can upload photos, delete it etc. i i do not want count everitime how much photos i have in the asset. With file exist dinamically i can populate the list
in Kompanion your solution work fine but when a create apk and test fileexist i obtain FALSE
I tried to use a if condition where with develop=true use “/Makeroid/assets/1.jpg” while when develop=false use “//1.jpg” but the result is always false.
In this post…
there is a block: ListAllAssets that gets a list of assets files when the app is installed.
this will work only in the companion app, but not anymore after building the app
Yes, this is also a bug with the File component. This path doesn’t work:
there is no path to access the assets so far.
I reported this also several times.
See here (point 4):
@Mika is / was working on it:
With the next release it should be possible too to check if a asset file exist.
No matter if companion or real apk.
It will work then with two // (slashes) at the start to tell the code it’s a asset file check.
What is the extension of the files that are not listed?
That block works when the app is installed.
If you want to see the list of files in assets while you are in emulation (COMPANION), check:
Terminal.Run — commandLine: ls -al /mnt/sdcard/Makeroid/assets/
for now i have solved with dora-paz solution when the app run in companion
and [juananton1991] solution when the app is installed.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.