GitHub user macdonst opened a pull request:

    https://github.com/apache/cordova-plugin-file/pull/127

    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:
    
    <preference name="AndroidPersistentFileLocation" value="Internal" />
    
    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:
    
    <preference name="AndroidPersistentFileLocation" value="Compatibility" 
/>
    
    and the original behaviour will be retained.
    
    What I'm advocating for is to make internal storage the default behaviour 
for Cordova Android.

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

    $ git pull https://github.com/macdonst/cordova-plugin-file master

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

    https://github.com/apache/cordova-plugin-file/pull/127.patch

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 <[email protected]>
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to