Testing the next release of MIT App Inventor (nb187)

These apps are only ONE app.
Did you test → saveTestFile_API29.apk on your Android 9 device?
Then you should get this:

Screenshot → saveTestFile_API29.apk

Screenshot → saveTestFile_AP30.apk

tested on a Galaxy Note8, Android 9.
But these AKPs are only built for testing on Android 11 (10+).

They infer that what I want to do is possible, that is to read non "media" files from a Documents or Downloads directory ( one of the shared dirs )

And again: No ...

Here are two nice short tutorials on scoped storage:

Saving Files in External / Scoped Storage (API 30+) - Android Studio Tutorial

https://www.youtube.com/watch?v=dEASm7nv7DA

@Anke, let me respectfully disagree...
as already said earlier

see also this Stackoverflow answer

You can ask the user to select a folder (which will be under the restricted public locations) and then you can programmatically access and check and files in this location. See Access documents and other files from shared storage  |  Android Developers

You can ask the user once and then store the permission they have given you to access files/folders with Access documents and other files from shared storage  |  Android Developers

Taifun

I had read all of this before. How about if you post

  • the appropriate code (but I don't mean the code snippets from Google)
  • if necessary an extension for this and
  • an example so that we can test it?

I haven't found anything like it yet.

So how can that be put into practice?

Yes, work only Download folder, other no)

Did you test this with a compiled app from the test-server?
How did you place the file in /Download in the first instance ?

yes apk, sdk 30.
call SaveFile and have :slightly_smiling_face: scope-legacy

This only works if you create the file in/with the app. Not for files that are already there or come from another source/app....

1 Like

How ReadFile TXT file, will maked from other app?
Only via pasting from clipboard in my app?

What do you want to tell us with these blocks?
What does you mean with "other no"?

Your blocks save / read in the ASD for devices with API > 28.
Your blocks have nothing to do with → shared storage.

Note: The File component still incorrectly requests READ / WRITE permissions for the ASD.

other folder not read/write , except Download

ASD work good

need ReadFile TXT file, maked from other app...
How work ImagePicker, FilePicker after picking...mmm)

I have no idea what you are talking about.
Anyway, of course it also works with other paths (folders), e.g.: /Downloads/test2.txt.
Post a test aia.

Solved)
If Rename txt,htm to media file, as .jpg may Read Any file in any folder from FilePicker
Also Save

Yes, this is a nice idea and it seems to work.

"Also save" ... what ?

Few foldres) DCIM jpg, Documents , Download any)

which file picker extension are you using? any link?
as we can see, there are a lot of spelling errors and ignoring the naming conventions...

it is hard to understand, what you are trying to say... you might want to elaborate...

Taifun

save only this folder, else think Music, Pictures
fom deephost

How to ask permssions?
I tried this:
Snipaste_2021-08-18_13-25-16
it's working in compaion, but not in apk.
In apk it said the "permission ... has been denied. Please enable it in the Setting app", but in Setting there is no such WriteExternalStorage permission.

I also tried:


and

But the app denied the permission automaticly.
please help.

It basically seems to work. I received a test APK (from Krish Jha - Niotron team) that copies a text file from the assets to /Download or /Documents (of course without WRITE permission, which is no longer available on Android 11).

  • /Download and
  • /Documents

are the ONLY two folders where this works. (even /Downloads does NOT work!)

Tested on a Pixel 2XL (Android 11).

I don't think this has anything to do with SAF.

1 Like