Saving textfile in ASD (android 10)

It is the same file, using two different paths

I can not understand, for me 2 paths = 2 files, however you did not explain me why 2 paths, maybe for compatibility with older versions ?

In Android, in some situations, and with some components,

/storage/emulated/0/

and/or

/mnt/sdcard/

take you to the root of the external virtual sdcard of the device.

The second part of your path takes you to the app ASD part.

If I was looking to travel to London, the path I would take would all depend on where I started from.

And as my grandfather used to say when people stopped to ask directions:

Traveller: How do I get to London?
Grandfather: Where have you come from?
Traveller: Bristol
Grandfather: Well I wouldn't have started from there......:wink:

Is it the same in Linux ?

Not to my knowledge, but there are probably many soft and hard links in the file system which provide different paths to the same file.

Then only one file have been generated, when can I use /mnt/sdcard/ to access and when /storage/emulated/0/ ?

I would recommend using /storage/emulated/0, this is the more reliable path

See here:

When I try to read the textfile from /storage/emulated/0/ I receive a File not found error.
When I try to share the textfile from /storage/emulated/0/ all OK.
It's not easy to work with files.

File component need relative path
All other components (canvas, share,...) need absolute path
Is it correct ?

AI2 is made by many programmers. How a component works depends on the developer who worked on the component. Depends on how the PATH declared.
The colors are also not uniform. Different in the designer, different in blocks. It makes the work a bit difficult, but you need to get used to it

:thinking:
Sorry, did you mean AI2?

Yes, it is correct.

1 Like

Yes :rofl:. I corrected.

1 Like

No.

No.
Canvas for example also needs the relative path.

If you use e.g. this (absolute) path:
/storage/emulated/0/image1.jpg

the image is save here (API < 29):
/storage/emulated/0/storage/emulated/0/image1.jpg

1 Like

See also here:

https://community.appinventor.mit.edu/t/solved-web-component-not-saving-files-to-asd-in-companion/16851/6?u=anke

But ...
https://community.appinventor.mit.edu/t/solved-web-component-not-saving-files-to-asd-in-companion/16851/8?u=anke

Your links get Oops! That page doesn’t exist or is private.

Could someone make a table with components and path ?

Ahh ok, (Power user forum)

But ...

Got it.
What about the EFile extension? :sweat_smile: