It worked! It ran on two devices (the apk installed one on internal sdcard and one on external storage) using only the path: file: /// storage / emulated / 0 / Android / data / packname / files.
Thanks for listening! \The/
Copying from the assets does not work for APK (checked with AI2):
Two slashes from file:///android_asset/
are removed, result:
Runtime Error: file:/android_asset/test.1.pdf (No such file or directory)
usually (and this is how the file component is implemented) to access the assets you have to use two slashes //, see also the documentation Storage
Prefix the filename with / to read from a specific file on the SD card. for instance /myFile.txt will read the file /sdcard/myFile.txt. To read assets packaged with an application (also works for the Companion) start the filename with // (two slashes).
in case this extension uses another logic, it would not be very helpful and would confuse everybody…
btw. the path file:///android_asset/
is only relevant for the webviewer to access files stored in the assets…
Taifun
Of course, I have tried this first: //test1.pdf
Doesn’t work:
Runtime Error: /test.1.pdf (No such file or directory)
Video on how to use…copy from SD card to phone or vise versa
ChangeLog Version4
New blocks
Added 6 new blocks:
Changes
- Replaced path with name.Now it will find path automatically from file name (Thanks to App Inventor)
- Some other minor changes
Bug Fixes
- Now it is able to copy files from assets (Thanks @bodymindpower)
- ‘AvailableStorageDirectories’ block is working now (Thanks @salem_m_s2021)
Is there more than thank you
I have no idea about that
We need an extension of that
There is already an extension
ChangeLog Version5
Changes
- Added ‘recursive’ in FilesList and FileListAsync
Bug Fixes
- Fixed bug in Delete method
- Fixed bug in getting assets list using FilesList.Use
//
in FilesList as dir to get Assets list while using Companion - Some minor bug fixes
Due to this extension my automatically my mobile’s all images and videos and other files lost when i export my app and install it, I dont used this extension in blocks remains unchanged, get file path only this block is used… and after installing all data lost… if it is a bug then solve it… if it is hacked then dont use anyone…
you might want to provide a screenshot of your relevant blocks…
and why do you think, the extension deleted all these files?
Taifun
I don’t think it is even possible…but you can give more details so that I can fix bugs if there is any…
It is quite confusing…you should elaborate more…
I think when we use delete file component and set path to empty it will delete all files…
No it will not delete all files if path is set to empty…but it will delete all files if path is set to /
because it is path toroot folder which contains all files of SD card.
I think thats my problem… thank you…
ChangeLog Version 6
Changes
- Removed some un-neccessary methods and imports which reduced aix size (40 kb to 31kb)
- Some internal changes like using empty string in any path socket will also return an empty string
Thanks to @Boban BTW, Looks like you still have an old version of extension - Fixed several spelling and grammar mistakes