I don't have android 11, I tested these apps on android 9 but it seems they don't work on android 9. App asks for permissions but files are not saved. So I still don't really know what's going on and what you're trying to convey in all these posts. Later I will test on android 10, if it makes sense?
These apps are only ONE app.
Did you test → saveTestFile_API29.apk
on your Android 9 device?
Then you should get this:
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
@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?
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 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....
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 ?
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
How to ask permssions?
I tried this:
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.