cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdonst <>
Subject [GitHub] cordova-plugin-file pull request: Make Android default persistent ...
Date Mon, 27 Jul 2015 21:18:07 GMT
GitHub user macdonst opened a pull request:

    Make Android default persistent file location internal

    **TL;DR Summary**
    We should switch the default for the Cordova Android File System to be on internal storage,
not the SD Card (or emulated SD card).
    **Long Version**
    Currently in Cordova Android when you use this code "window.requestFileSystem(PERSISTENT,
0, win, fail);" the root file system path that is returned is "/storage/emulated/0" i.e. "/sdcard".
    Why you may ask? Because back in 2010 or so Bryce Curtis and I argued that we should use
the external storage location because internal storage was not very large on Android 2.x and
we didn't want to have developers filling up the devices limited internal storage. Joe Bowser
argued against it because of issues with the SD Card on Android but was eventually out voted.
    Now, I'm prepared to admit that Bryce was wrong (see what I did there?). I feel that the
default behaviour for "window.requestFileSystem(PERSISTENT, 0, win, fail);" should be to resolve
to a location on internal storage that meets the following requirements:
    a) private to the application
    b) removed when the application is uninstalled
    c) lines up with what we have on iOS and WP
    In fact you can get this behaviour right now but setting the following preference in config.xml:
    &lt;preference name="AndroidPersistentFileLocation" value="Internal" /&gt;
    This gets you a root file path of "/data/data/{android package}/files/files/". The double
"files" is an issue but we can probably ignore it for now.
    If a user wants the old behaviour they only need to make the preference:
    &lt;preference name="AndroidPersistentFileLocation" value="Compatibility" /&gt;
    and the original behaviour will be retained.
    What I'm advocating for is to make internal storage the default behaviour for Cordova

You can merge this pull request into a Git repository by running:

    $ git pull master

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #127
commit ab83abc894fa28f110accd822c0202dbf38e60f2
Author: Simon MacDonald <>
Date:   2015-07-27T20:05:13Z

    Make Android default persistent file location internal


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message