I’m developing an app that wants to display a list (ListView) of all the .csv files on the device.
I’m using the FileTools and/or TaifunFiles extension (FileToools1).ListFiles block to get the file names.
When running with the companion, it preforms just fine, but when I create the apk file, the list view is blank. Currently the csv file are copied manually from the computer to the internal storage of the device not an SD card. The Verizon Droid Turbo i’m using doesn’t have an SD card slot.
I’ve tried a variety of options for the file dir. no “/”, one “/”, two “//”, even three “///” using both FileTools or TaifunFiles. All have the same result of a blank ListView from the apk.
Anyone have any ideas why the ListView is blank when operating from the apk version?
Which, in android/AI2 terms is a virtual SDcard at location:
EDITED: /sdcard/emulated/0
/storage/emulated/0
You should be able to reference these files with a "/path/to/filename" or a full path
EDITED file:///sdcard/emulated/0/path/to/filename
file:///storage/emulated/0/path/to/filename
Btw, I would always prefer this path: /storage/emulated/0/
among other things - but not least - because of the Refresh.Gallery method (Taifun’s Tools extension), which does not work with: file:///storage/emulated/0/.
Update, after some trial and error, I find that the “ListView” will function as hoped If the device has given permission to access photos, media and files. So how can I initially get/give that permission (without user interaction)?
… means, you do not need any permissions (READ_/WRITE_EXTERNAL_STORAGE) to read from / write to the app-specific directory. And App Inventor has to implement that when targeting API 29.