How to read the file from ASD folder

Please do not spam community with irrelevant answers

1 Like

i put slash but same error

Screenshot 2022-02-25 180056

On Android ≥ 10:

On Android < 10:

Note: The File component uses a relative path (to save / read text files).

where should I get this block
(call GetASD1 .AppSpecificDirectory)

Thanks for helping me get the materials I needed.
:slightly_smiling_face:

1 Like

label1 text
contain what …?
its just label or indicating other block

If not mistaken from your code above I believe you are using Text_Box1.Text, so try with that

this what, I tried.
it giving me same error.

Use an if then statement if api level greater or equal to 29 read from …else read from …

In order to get api level use Device utilities or Get the API Level of the device - Extensions - MIT App Inventor Community

image

I tried this and its work with android version 9 .
but android version greater than 10 give me same error.

1 Like

Do what @dora_paz has shown in post #18.

1 Like

what about device_utilities1 block

which extension :thinking:

thank you :slightly_smiling_face:

For Android > 9 (API 28) the File component automatically redirects the path to the ASD, defining a relative path in the process. For Android < 10, the relative path must be specified.

Kodular’s component see Device Utilities - Kodular Docs

I added getAPI level (SdkVersion) in my GetASD extension:

grafik

1 Like

Thank you for taking the trouble to help me.
now everything works well as I expect. :slightly_smiling_face:

1 Like