cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Santana <csantan...@gmail.com>
Subject Re: Make internal storage default on Android
Date Wed, 22 Jul 2015 22:50:55 GMT
That's what I meant the plugin cordova-plugin-file@2.1.0 bump up to 3.x

On Wed, Jul 22, 2015 at 5:38 PM Joe Bowser <bowserj@gmail.com> wrote:

> This would change the major version of the plugin, not the platform, since
> this is a plugin API change and isn't actually a core-platform change.
>
> On Wed, Jul 22, 2015 at 2:33 PM Carlos Santana <csantana23@gmail.com>
> wrote:
>
> > I think cross platform web developers would expect all platforms to have
> > same default. What the default for windows?
> >
> > +1 make default internal at least will have iOS and android with same
> > expectations
> >
> > We need to change the Major number (sever) for the version, it feels like
> > is changing an API
> >
> > I like the explicit even if it's not needed because the default is
> > internal. But if they see it there it reminds them that internal is being
> > used.
> > On Wed, Jul 22, 2015 at 4:02 PM Darryl Pogue <darryl@dpogue.ca> wrote:
> >
> > > +1 because saving to the SD Card has added problems with other apps
> (such
> > > as photo and music apps) picking up files that they shouldn't.
> > >
> > > Nothing more annoying than accidentally unleashing 200 logos and icons
> > into
> > > the photos app of unsuspecting users.
> > >
> > > On 22 July 2015 at 12:47, Simon MacDonald <simon.macdonald@gmail.com>
> > > wrote:
> > >
> > > > *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.
> > > >
> > > >
> > > > *Code Changes*
> > > >
> > > > I've already taken a brief look into this and I feel the change is
> > > > extremely minor. We need only change the default return value from
> > > > "compatibility" to "internal" at line 156 of FileUtils.java (
> > > > https://github
> > > >
> > >
> >
> .com/apache/cordova-plugin-file/blob/master/src/android/FileUtils.java#L156
> > > > ).
> > > >
> > > > If we wanted to make the change explicit to the user we could change
> > > > plugin.
> > > > xml to add the preference to config.xml as well.
> > > >
> > > > Thoughts, comments, applause?
> > > > Simon Mac Donald
> > > > http://hi.im/simonmacdonald
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message