Skip to content

How will saving media files be handled in the new Scoped Storage paradigm being enforced by Android 11+? #468

@CodeWithOz

Description

@CodeWithOz

Feature Request

Motivation Behind Feature

This feature solves the problem of saving files to a shared storage volume on Android 11, which is desirable for media files because the user would not expect media files to be locked away to only the app that created the media file. VOLUME_EXTERNAL_PRIMARY is the new way to do this but I can't find a way to access it the using this plugin. This example shows how to use VOLUME_EXTERNAL_PRIMARY to save files to shared storage, but on this page it seems there's no exposure to that storage volume via this plugin.

Feature Description

Ideally I'd like to be able to write code like this:

window.resolveLocalFileSystemURL(
                    cordova.file.volumeExternalPrimary,
                    dirEntry => {...}
)

Please see the links above for the example from the official Android docs.

Alternatives or Workarounds

The alternative is to use the app-specific storage space on the external drive, but the Android docs state that this would not be ideal for media because the files will not be available to other apps and would be wiped if the app is uninstalled, both of which a user is unlikely to desire for pics and vids.

I know that there are conversations about Android 11 changes in #426 and #456, but no mention has been made of this particular use-case, which is an important one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions