HOWTO: Get Application Specific Directory -ASD (where one exists) without Extensions

Yes OK ...

I'm sorry, I wrote "dummy/jpg"

Or even more compact:

2 Likes

Hi Anke, I can not find Procedure block as your

You will have to make that yourself

1 Like

How can I get the file path for a specific file?

Thank you Peter

Here is the aia: getASD_2.aia (8.6 KB)

or:

1 Like

Thank you @Anke :smile:

1 Like

Could you explain how this is supposed to work on a pre Android 10 device?

I compiled and installed your aia on an Android 7 device, and pressing the "false" button returned a string of a file path (which is really all the blocks do, they do not go and find a file path):

/storage/emulated/0/Android/data/appinventor.ai_bodymindpower.getASD/files

This file path does not exist, when inspecting with a File Manager (all other apps installed do show their "ASD" if they were given one). How is a user/developer meant to then use this string ? With your blocks how is the directory actually created ?

It is no problem to create the ASD on devices with API < 29 (there are numerous extensions that do that, I made 3 extensions myself that can do it). In addition, the ASD can of course also be created with the Canvas component (but then incorrectly only with WRITE permission).

Whether the ASD exists was / is not the subject of this topic, but only how to get the ASD.

We should end this discussion.
Do what @Taifun suggested. I will then post my solution in a separate topic.

You therefore have to use an extension to create this directory that doesn't exist? Crazy. And defeats the whole object of the exercise!

But this is precisely my point, my blocks do "GET" the ASD if there is one, if there isn't one they fall back to the previous position of the root of the sdcard in pre 10 versions.

:slight_smile:

@TIMAI2 You obviously don't want to understand.
In addition, you confuse the others more and more.
(although it's actually pretty simple)

Sorry for going off-topic :confused: :disappointed:

and even a little bit more... :wink:

Taifun

Of course, that was because I first wanted to output the packageName and then the ASD
(in my first approach; therefore I left it that way).

Hi Anke.
I'm trying that files remain in the same folder for all Android versions.
I think I heard you say that /storage/emulated/0 exists in all devices and Android versions.
That would be great if I could download files there from FireBase Storage.
Do you know how should I "set Web1 .ResponseFileName to" before "call Web1 .Get"?
HowToSendDownloadedFileTo_storage_emulated_0

A quick answer. Right now your approach will work. Once App Inventor starts targeting Android SDK 30 (July/August), then you will not be able to save to the sdcard location.

See this discussion:

for more details....