Problem in selecting a file by activity starter

Sorry if this is a very basic question; but I couldn't find the right answer in spite of a lot of searching.

In my app, I want to load a file (or image) from a specific folder in sdcard (Data_save), so that the user goes directly in that folder instead of searching the phone memory.

I have problem with ActivityStarter Uri. I tried the following ways and the path looks correct, but always the images are non-selectable (faded out). But if I navigate to the "files" and find that folder and open it, I can can select images and they load.

I test the app in real phone (Huawei mate 10) not the emulator.

"Uri"s I tried are the following:
file///Data_save
/Data_save
Data_save
//Data_save

Thanks for your help,
Sirous

blocks (7)

1 Like

to find out the path to the external removable sdcard, you can try the file extension and its AvailableStorageDirectories method

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

He should use Get Path from Uri method. :thinking:

I have exactly the same issue... Please could anyone help with iInstructions for beginners.

Thanks

see here App Inventor Tutorials and Examples: Pick a file | Pura Vida Apps
and in case the result uri is a content uri and not a path to the file, then additionally use the GetFileName method from the file extension
App Inventor Extensions: File | Pura Vida Apps

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.