save only this folder, else think Music, Pictures
fom deephost
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.
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.
Did you test with the APK?
If so, remove this file /Documents/test1.csv
from your device and try again to save this file:
It will no longer work ...
Yes, all work in Documents. button5
APK removed. This community does not allow posting of apk files in our threads.
Here is a test app that saves a text file in the → /Download
and → /Documents
folders (without WRITE
permission, as this is no longer available on Android 11).
Note: The file names have to be changed with each button click, otherwise it will only work as long as no file is manually deleted from /Download
or /Documents
.
Steps to test the app (especially on Android 10 and 11):
- Install the APK and test ... it will work.
- Unistall and reinstall it. Now it does no longer work.
- Then check the
CheckBox
and try again ... it should work again ...
This behavior is really strange.
Especially because I don't use any method regarding "shared storage" (FileScope.Shared
).
Maybe @ewpatton can say something about it.
No, it doesn't work (Pixel 2XL, Android 11).
Now uninstall the app and try again.
It shouldn't work until you check the CheckBox.
On Android 10+ you can no longer ask for WRITE
permission, because this is no longer availably.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
Need this permission, how solid file manager
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
Thanks Anke,
I noticed that and tried to ask read permission, but this only work when defaultFileScope set to legacy.
Where is the documents for file scope block?
Worked add manifest)
Please, do NOT post apk files in the community at all.
Yes, I mentioned that several times, e.g. here.
Whenever you need READ
/ WRITE
permissions for devices with Android 4.4 up (API 19+ / KitKat) you must set defaultFileScope = Legacy
to get READ
/ WRITE
permissions declared in the Manifest.
The same with Niotron.
But on Android 10 there is no problem with deleting files from /Download
and /Documents
or after uninstalling / reinstalling the app. These issues are only present on Android 11.
thank you for your tests...
did this work on the AI Test server or only in Niotron?
toFileName cannot have slash in starting
(taken from the Niotron thread)
What is the block Material_Textbox1.Text
block about? What is its content? An empty string?
this will not help (except your app is a file manager app or similar), see also 저장소 기기에 있는 모든 파일 관리 | Android 개발자 | Android Developers
the app's usage of the permission must fall within permitted uses, and must be directly tied to the core functionality of the app. If your app includes a use case that's similar to the following examples, it's likely to be allowed to request the MANAGE_EXTERNAL_STORAGE permission:
File managers Backup and restore apps Anti-virus apps Document management apps On-device file search Disk and file encryption Device-to-device data migration
see also Use of All files access (MANAGE_EXTERNAL_STORAGE) permission - Play Console Help
Taifun