Hi,
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?
Sense?
If you did not added any into your assets then there are none
I have lot of galleries like this:
gal1:
-gal1img1
-gal1img2
…
gal2:
-gal2img1
-gal2img2
…
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
Hi dora_paz,
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.
Any suggestion?
In this post…
there is a block: ListAllAssets that gets a list of assets files when the app is installed.
Try this
this will work only in the companion app, but not anymore after building the app
the file extension offers the method FileListFromAssets
https://puravidaapps.com/file.php
Note: in Kodular this works only after building the app, see here why
Taifun
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?
.jpg image
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:
http://kio4.com/appinventor/278_extension_shell.htm
Terminal.Run — commandLine: ls -al /mnt/sdcard/Makeroid/assets/
or
ls /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.
Thank you
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.