-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove file permissions, use Storage Access Framework #6
Comments
Indeed, we had a problem with file access on Android 10. Temporary workaround was added in 69a88a3 and I reported this problem to NativeScript team: NativeScript/NativeScript#8203 |
That issue was closed some months ago. I'm mildly curious if their fix is enough for this app. Isn't File.read only half the issue? You'll need File.write as well? And does their approach to fixing File.read apply towards the direction of using Storage Access Framework to avoid requiring file permissions? Above I mentioned hacking together my own use of Storage Access Framework, but fortunately Footnotes |
I think they fixed it in NativeScript 8.0 but this release contains so many breaking changes. Some plugins don't work at all and abandoned by their maintainers. |
I don't think this issue is a priority, but I think in the long term it is likely relevant.
I was able to use code examples at https://developer.android.com/training/data-storage/shared/documents-files to remove need for file permissions for my Android app.
I think then you could remove the following lines from
App_Resources/Android/src/main/AndroidManifest.xml
.I'm not sure I'm reading this correctly, but it seems as soon as an app begins targeting Android 29, some of the old way of accessing files on Android will not be available. Note that
ACTION_OPEN_DOCUMENT
requires Android 19 butACTION_GET_CONTENT
only requires Android 16. A difference of about 3% of existing Android devices.You could wait for one of your frameworks to implement this, I don't know if that would be NativeScript, Angular or Typescript. I've had to implement my own plugin for now, to get persistent and smooth read/write access to local files an Android.
You can see where I've implemented a custom plugin here: https://github.com/bradyt/cone/blob/v0.2.18/uri_picker/android/src/main/java/info/tangential/uri_picker/UriPickerPlugin.java#L81-L90.
EDITS:
ACTION_GET_CONTENT
. That apparently goes back to API 1. But the framework goes back to API 17, if I'm reading this right: https://docs.nativescript.org/core-concepts/android-runtime/requirements. So then the difference in existing devices would only be 2%, according to https://developer.android.com/about/dashboards. You could useACTION_GET_CONTENT
to support those devices, but I think the user experience would be more like importing/exporting a file.The text was updated successfully, but these errors were encountered: