You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2022/06/05 11:03:42 UTC
[GitHub] [cordova] siauderman opened a new issue, #334: No option to use MediaStore API
siauderman opened a new issue, #334:
URL: https://github.com/apache/cordova/issues/334
Hi, I was using cordova-plugin-file, but now with scoped storage it is not practical if I want to allow the user to choose where they want to save the file.
The alternative is MediaStore API, however, https://www.npmjs.com/package/cordova-plugin-android-mediastore allows only saving a single image to the gallery.
This should be part of core functionality as many apps need to download files to a location selected by the user.
--
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: commits-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova] breautek commented on issue #334: No option to use MediaStore API
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #334:
URL: https://github.com/apache/cordova/issues/334#issuecomment-1263028210
> but now with scoped storage it is not practical if I want to allow the user to choose where they want to save the file.
Why isn't it practical? Scoped storage did add some restrictions, such as making the external root directory (either sdcard or emulated) an non-writable path, but apps can still write to the predefined folders such as external Pictures, Audio, etc.
You can also read files from external storage that was written by the app. Reading files written by other apps still requires the `READ_EXTERNAL_STORAGE` permission, which cordova-plugin-file handles.
--
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: commits-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova] customautosys commented on issue #334: No option to use MediaStore API
Posted by GitBox <gi...@apache.org>.
customautosys commented on issue #334:
URL: https://github.com/apache/cordova/issues/334#issuecomment-1263814422
> > but now with scoped storage it is not practical if I want to allow the user to choose where they want to save the file.
>
> Why isn't it practical? Scoped storage did add some restrictions, such as making the external root directory (either sdcard or emulated) an non-writable path, but apps can still write to the predefined folders such as external Pictures, Audio, etc.
>
> You can also read files from external storage that was written by the app. Reading files written by other apps still requires the `READ_EXTERNAL_STORAGE` permission, which cordova-plugin-file handles.
I created a new plugin simply because that's faster to do, https://github.com/customautosys/cordova-plugin-saf-mediastore
I think we should consider making Mediastore / SAF a core part of Cordova Android. It really is the way forward for file saving on Android.
--
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: commits-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova] breautek commented on issue #334: No option to use MediaStore API
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #334:
URL: https://github.com/apache/cordova/issues/334#issuecomment-1264185873
> It really is the way forward for file saving on Android.
That's not entirely accurate. Scoped Storage (And the MediaStore APIs) are for dealing with files that uses the External storage system on android. a Media Store plugin could be used in addition to the file plugin, but it definitely won't replace the file plugin, which can interact with both the internal filesystem as well as the external filesystem. Currently the file plugin handles this through the [Direct File API](https://developer.android.com/about/versions/11/privacy/storage#media-direct-file-native). But I do understand the MediaStore is the recommended approach for interfacing with the external filesystem.
To be clear, I'm not pushing back on the MediaStore API. I'm just asking the _what_ it provides over the File plugin or _why_ it's not practical. For example, how were you providing UI to the user to choose where to save a file before and why doesn't that work now?
--
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: commits-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova] customautosys commented on issue #334: No option to use MediaStore API
Posted by GitBox <gi...@apache.org>.
customautosys commented on issue #334:
URL: https://github.com/apache/cordova/issues/334#issuecomment-1264525332
> > It really is the way forward for file saving on Android.
>
> That's not entirely accurate. Scoped Storage (And the MediaStore APIs) are for dealing with files that uses the External storage system on android. a Media Store plugin could be used in addition to the file plugin, but it definitely won't replace the file plugin, which can interact with both the internal filesystem as well as the external filesystem. Currently the file plugin handles this through the [Direct File API](https://developer.android.com/about/versions/11/privacy/storage#media-direct-file-native). But I do understand the MediaStore is the recommended approach for interfacing with the external filesystem.
>
> To be clear, I'm not pushing back on the MediaStore API. I'm just asking the _what_ it provides over the File plugin or _why_ it's not practical. For example, how were you providing UI to the user to choose where to save a file before and why doesn't that work now?
I was using https://github.com/ourcodeworld/cordova-ourcodeworld-filebrowser which does not display the files in the folders disallowed by scoped storage. When you navigate to such a folder then you can't go anywhere and you're stuck and have to close the picker. That's why I had to write the MediaStore / SAF plugin.
File plugin also fails on a scoped storage device whenever you write to something that's not the app's own folder, whether in internal or external storage. So it ends up being pretty limited.
--
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: commits-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova] breautek commented on issue #334: Feature Request(Android): MediaStore API
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #334:
URL: https://github.com/apache/cordova/issues/334#issuecomment-1355211479
To addon...
Starting with API 33, `READ_EXTERNAL_STORAGE` permission is going to change and be no-op, with 3 more specific read permissions replacing it, for audio, video and images. Which I think may further promote a need for an actual MediaStore API.
--
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: commits-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org