You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "oudoken (via GitHub)" <gi...@apache.org> on 2023/06/05 20:03:08 UTC
[GitHub] [cordova-plugin-file] oudoken commented on issue #565: Cordova can't read files with FileRead
oudoken commented on issue #565:
URL: https://github.com/apache/cordova-plugin-file/issues/565#issuecomment-1577399194
Hi there,
This post has lot of usefull informations.
Just wanting to add a bunch of infos:
- https://github.com/customautosys/cordova-plugin-saf-mediastore work as expected (see later for details on various SDK version specs, the only thing in my configuration (cordova android@12) was to add `implementation` `"androidx.documentfile:documentfile:1.0.1"` to "build.gradle (:app)" on "dependencies {" section
- SAF Mediastore it's made to work as "standalone": You need to use a file picker or another user initiated action for obtaining an content URI wich contain the correct authorization (read/write etc). This mean that You can use this plugin in combination with a "sharing" intent, if Your app it's configured for opening a specific file type this works pretty well thus on SDK 33 You will need to use SAF Mediastore as well for getting the content URI
Tested on these SDK's on emulators and real devices (targetSdkVersion 33):
SDK V 24 - 28 (Android 7.0-9.0): use standard cordova-plugin-file as usual the plugin SAF Mediastore does not work correctly
SDK V 29 - 32 (Android 10.0-12.0): use SAF Mediastore only or mixed SAF Mediastore (to get the arraybuffer) and then use cordova-plugin-file to write the blob from file
SDK V 33 (Android 13.0): use only SAF Mediastore
In AndroidManifest.xml i've modified a little reading and writing permissions:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
Thanks!
Rob
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org