You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Simon MacDonald <si...@gmail.com> on 2012/02/22 18:40:09 UTC
Changes to requesting a PERSISTENT file system in Cordova-Android
Hey,
I've been reading up on all the code changes as it seems like everything is
different after four days without internet. One of the things that I
noticed is that the command:
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess,
onError);
Now returns the path "/data/data/{app package name}". In the previous
release it returned "/sdcard" or whatever the path of the mounted external
storage is. So I was just wondering what the rational behind the change was
and are we worried that everyone who's written an Android app
using window.requestFileSystem() will suddenly find their root path has
changed?
Simon Mac Donald
http://hi.im/simonmacdonald
Re: Changes to requesting a PERSISTENT file system in
Cordova-Android
Posted by Filip Maj <fi...@adobe.com>.
>Remember that. Maybe we throw this to a vote?
+1
>
>On Tue, Mar 6, 2012 at 9:19 PM, Bryce Curtis <cu...@gmail.com>
>wrote:
>> We can discuss how these protocols translate to various platforms, but I
>> think it makes sense. We had a discussion similar to this back when we
>> were looking at the File APIs. See the wiki for some of what we
>> discussed...
>> http://wiki.phonegap.com/w/page/35605874/Planning%3A%20File%20API
>>
>>
>> On Tue, Mar 6, 2012 at 6:54 PM, Brian LeRoux <b...@brian.io> wrote:
>>
>>> bump. my $0.02. we have two choices: relative or protocol handler.
>>>
>>> rel means devs have to construct paths from (brittle) strings and
>>> concatenating ... using app ids, etc. less extensible.
>>>
>>> i'd like to push we gun for protocol handlers for app level and root to
>>> start:
>>>
>>> app://
>>> root://
>>>
>>> in the future we could add discovery for things like:
>>>
>>> sdcard://
>>>
>>>
>>>
>>> On Mon, Feb 27, 2012 at 11:39 AM, Filip Maj <fi...@adobe.com> wrote:
>>> > I'm not sure if it needs to go to vote... Maybe if there is enough
>>> > contention on the topic?
>>> >
>>> > How about let's revert the temp/persistent resolution on android to
>>>what
>>> > it was before (if it hasn't already been done) so we don't freak
>>>users
>>> > out. Then let's use this thread to figure out the details of how it
>>> > *should* be done on Android. Once we have it figured out, document on
>>> wiki
>>> > and put it in the roadmap (is that the place to document these sorts
>>>of
>>> > api changes?)
>>> >
>>> > On 12-02-27 6:06 AM, "Simon MacDonald" <si...@gmail.com>
>>> wrote:
>>> >
>>> >>But I guess the immediate question is do we want to make this change
>>>for
>>> >>1.5 or publicize we are making the change for a future release? Does
>>>this
>>> >>need to go with a vote?
>>> >>
>>> >>Simon Mac Donald
>>> >>http://hi.im/simonmacdonald
>>> >>
>>> >>
>>> >>On Wed, Feb 22, 2012 at 5:27 PM, Filip Maj <fi...@adobe.com> wrote:
>>> >>
>>> >>> This is a good discussion to have. Blindly following a spec never
>>>gets
>>> >>>you
>>> >>> 100% where you want to go.
>>> >>>
>>> >>> Instead: what are reasonable storage options that as a developer
>>>using
>>> >>> cordova you would like to see? Once that is decided on, define a
>>>simple
>>> >>> spec for each of the options.
>>> >>>
>>> >>> So for the first question, in my mind having an idea of a
>>>"temporary"
>>> >>> storage space - like Joe said, volatile memory - and "persistent"
>>>seem
>>> >>> like two good options.
>>> >>>
>>> >>> Then, for simple constraints around the two options:
>>> >>>
>>> >>> To me, persistent is: data that I write to a persistent location is
>>> >>> available across device restarts and will not be removed unless my
>>> >>> application explicitly removes it (barring exceptional
>>>circumstances
>>> >>>such
>>> >>> as a device factory reset). The Android "Jail" is, for me, a good
>>> >>> candidate to be considered the persistent storage location. A
>>>removable
>>> >>> storage type such as an SD or media card is, in my mind, not a
>>> candidate
>>> >>> to "persistent" storage.
>>> >>>
>>> >>> For temporary storage, the restrictions are much less. Figuring
>>>out any
>>> >>> minimum time frames for how long a temporary storage location
>>>exists
>>> >>>seems
>>> >>> important. Should temporary storage be guaranteed across device
>>> >>>restarts?
>>> >>> Probably not. What about across application restarts? I'm not sure
>>>- I
>>> >>> would say no, not guaranteed. Within an application session? I
>>>think
>>> so.
>>> >>>
>>> >>> Etc. etc. :)
>>> >>>
>>> >>>
>>> >
>>>
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Brian LeRoux <b...@brian.io>.
Remember that. Maybe we throw this to a vote?
On Tue, Mar 6, 2012 at 9:19 PM, Bryce Curtis <cu...@gmail.com> wrote:
> We can discuss how these protocols translate to various platforms, but I
> think it makes sense. We had a discussion similar to this back when we
> were looking at the File APIs. See the wiki for some of what we
> discussed...
> http://wiki.phonegap.com/w/page/35605874/Planning%3A%20File%20API
>
>
> On Tue, Mar 6, 2012 at 6:54 PM, Brian LeRoux <b...@brian.io> wrote:
>
>> bump. my $0.02. we have two choices: relative or protocol handler.
>>
>> rel means devs have to construct paths from (brittle) strings and
>> concatenating ... using app ids, etc. less extensible.
>>
>> i'd like to push we gun for protocol handlers for app level and root to
>> start:
>>
>> app://
>> root://
>>
>> in the future we could add discovery for things like:
>>
>> sdcard://
>>
>>
>>
>> On Mon, Feb 27, 2012 at 11:39 AM, Filip Maj <fi...@adobe.com> wrote:
>> > I'm not sure if it needs to go to vote... Maybe if there is enough
>> > contention on the topic?
>> >
>> > How about let's revert the temp/persistent resolution on android to what
>> > it was before (if it hasn't already been done) so we don't freak users
>> > out. Then let's use this thread to figure out the details of how it
>> > *should* be done on Android. Once we have it figured out, document on
>> wiki
>> > and put it in the roadmap (is that the place to document these sorts of
>> > api changes?)
>> >
>> > On 12-02-27 6:06 AM, "Simon MacDonald" <si...@gmail.com>
>> wrote:
>> >
>> >>But I guess the immediate question is do we want to make this change for
>> >>1.5 or publicize we are making the change for a future release? Does this
>> >>need to go with a vote?
>> >>
>> >>Simon Mac Donald
>> >>http://hi.im/simonmacdonald
>> >>
>> >>
>> >>On Wed, Feb 22, 2012 at 5:27 PM, Filip Maj <fi...@adobe.com> wrote:
>> >>
>> >>> This is a good discussion to have. Blindly following a spec never gets
>> >>>you
>> >>> 100% where you want to go.
>> >>>
>> >>> Instead: what are reasonable storage options that as a developer using
>> >>> cordova you would like to see? Once that is decided on, define a simple
>> >>> spec for each of the options.
>> >>>
>> >>> So for the first question, in my mind having an idea of a "temporary"
>> >>> storage space - like Joe said, volatile memory - and "persistent" seem
>> >>> like two good options.
>> >>>
>> >>> Then, for simple constraints around the two options:
>> >>>
>> >>> To me, persistent is: data that I write to a persistent location is
>> >>> available across device restarts and will not be removed unless my
>> >>> application explicitly removes it (barring exceptional circumstances
>> >>>such
>> >>> as a device factory reset). The Android "Jail" is, for me, a good
>> >>> candidate to be considered the persistent storage location. A removable
>> >>> storage type such as an SD or media card is, in my mind, not a
>> candidate
>> >>> to "persistent" storage.
>> >>>
>> >>> For temporary storage, the restrictions are much less. Figuring out any
>> >>> minimum time frames for how long a temporary storage location exists
>> >>>seems
>> >>> important. Should temporary storage be guaranteed across device
>> >>>restarts?
>> >>> Probably not. What about across application restarts? I'm not sure - I
>> >>> would say no, not guaranteed. Within an application session? I think
>> so.
>> >>>
>> >>> Etc. etc. :)
>> >>>
>> >>>
>> >
>>
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Bryce Curtis <cu...@gmail.com>.
We can discuss how these protocols translate to various platforms, but I
think it makes sense. We had a discussion similar to this back when we
were looking at the File APIs. See the wiki for some of what we
discussed...
http://wiki.phonegap.com/w/page/35605874/Planning%3A%20File%20API
On Tue, Mar 6, 2012 at 6:54 PM, Brian LeRoux <b...@brian.io> wrote:
> bump. my $0.02. we have two choices: relative or protocol handler.
>
> rel means devs have to construct paths from (brittle) strings and
> concatenating ... using app ids, etc. less extensible.
>
> i'd like to push we gun for protocol handlers for app level and root to
> start:
>
> app://
> root://
>
> in the future we could add discovery for things like:
>
> sdcard://
>
>
>
> On Mon, Feb 27, 2012 at 11:39 AM, Filip Maj <fi...@adobe.com> wrote:
> > I'm not sure if it needs to go to vote... Maybe if there is enough
> > contention on the topic?
> >
> > How about let's revert the temp/persistent resolution on android to what
> > it was before (if it hasn't already been done) so we don't freak users
> > out. Then let's use this thread to figure out the details of how it
> > *should* be done on Android. Once we have it figured out, document on
> wiki
> > and put it in the roadmap (is that the place to document these sorts of
> > api changes?)
> >
> > On 12-02-27 6:06 AM, "Simon MacDonald" <si...@gmail.com>
> wrote:
> >
> >>But I guess the immediate question is do we want to make this change for
> >>1.5 or publicize we are making the change for a future release? Does this
> >>need to go with a vote?
> >>
> >>Simon Mac Donald
> >>http://hi.im/simonmacdonald
> >>
> >>
> >>On Wed, Feb 22, 2012 at 5:27 PM, Filip Maj <fi...@adobe.com> wrote:
> >>
> >>> This is a good discussion to have. Blindly following a spec never gets
> >>>you
> >>> 100% where you want to go.
> >>>
> >>> Instead: what are reasonable storage options that as a developer using
> >>> cordova you would like to see? Once that is decided on, define a simple
> >>> spec for each of the options.
> >>>
> >>> So for the first question, in my mind having an idea of a "temporary"
> >>> storage space - like Joe said, volatile memory - and "persistent" seem
> >>> like two good options.
> >>>
> >>> Then, for simple constraints around the two options:
> >>>
> >>> To me, persistent is: data that I write to a persistent location is
> >>> available across device restarts and will not be removed unless my
> >>> application explicitly removes it (barring exceptional circumstances
> >>>such
> >>> as a device factory reset). The Android "Jail" is, for me, a good
> >>> candidate to be considered the persistent storage location. A removable
> >>> storage type such as an SD or media card is, in my mind, not a
> candidate
> >>> to "persistent" storage.
> >>>
> >>> For temporary storage, the restrictions are much less. Figuring out any
> >>> minimum time frames for how long a temporary storage location exists
> >>>seems
> >>> important. Should temporary storage be guaranteed across device
> >>>restarts?
> >>> Probably not. What about across application restarts? I'm not sure - I
> >>> would say no, not guaranteed. Within an application session? I think
> so.
> >>>
> >>> Etc. etc. :)
> >>>
> >>>
> >
>
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Brian LeRoux <b...@brian.io>.
bump. my $0.02. we have two choices: relative or protocol handler.
rel means devs have to construct paths from (brittle) strings and
concatenating ... using app ids, etc. less extensible.
i'd like to push we gun for protocol handlers for app level and root to start:
app://
root://
in the future we could add discovery for things like:
sdcard://
On Mon, Feb 27, 2012 at 11:39 AM, Filip Maj <fi...@adobe.com> wrote:
> I'm not sure if it needs to go to vote... Maybe if there is enough
> contention on the topic?
>
> How about let's revert the temp/persistent resolution on android to what
> it was before (if it hasn't already been done) so we don't freak users
> out. Then let's use this thread to figure out the details of how it
> *should* be done on Android. Once we have it figured out, document on wiki
> and put it in the roadmap (is that the place to document these sorts of
> api changes?)
>
> On 12-02-27 6:06 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>
>>But I guess the immediate question is do we want to make this change for
>>1.5 or publicize we are making the change for a future release? Does this
>>need to go with a vote?
>>
>>Simon Mac Donald
>>http://hi.im/simonmacdonald
>>
>>
>>On Wed, Feb 22, 2012 at 5:27 PM, Filip Maj <fi...@adobe.com> wrote:
>>
>>> This is a good discussion to have. Blindly following a spec never gets
>>>you
>>> 100% where you want to go.
>>>
>>> Instead: what are reasonable storage options that as a developer using
>>> cordova you would like to see? Once that is decided on, define a simple
>>> spec for each of the options.
>>>
>>> So for the first question, in my mind having an idea of a "temporary"
>>> storage space - like Joe said, volatile memory - and "persistent" seem
>>> like two good options.
>>>
>>> Then, for simple constraints around the two options:
>>>
>>> To me, persistent is: data that I write to a persistent location is
>>> available across device restarts and will not be removed unless my
>>> application explicitly removes it (barring exceptional circumstances
>>>such
>>> as a device factory reset). The Android "Jail" is, for me, a good
>>> candidate to be considered the persistent storage location. A removable
>>> storage type such as an SD or media card is, in my mind, not a candidate
>>> to "persistent" storage.
>>>
>>> For temporary storage, the restrictions are much less. Figuring out any
>>> minimum time frames for how long a temporary storage location exists
>>>seems
>>> important. Should temporary storage be guaranteed across device
>>>restarts?
>>> Probably not. What about across application restarts? I'm not sure - I
>>> would say no, not guaranteed. Within an application session? I think so.
>>>
>>> Etc. etc. :)
>>>
>>>
>
Re: Changes to requesting a PERSISTENT file system in
Cordova-Android
Posted by Filip Maj <fi...@adobe.com>.
I'm not sure if it needs to go to vote... Maybe if there is enough
contention on the topic?
How about let's revert the temp/persistent resolution on android to what
it was before (if it hasn't already been done) so we don't freak users
out. Then let's use this thread to figure out the details of how it
*should* be done on Android. Once we have it figured out, document on wiki
and put it in the roadmap (is that the place to document these sorts of
api changes?)
On 12-02-27 6:06 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>But I guess the immediate question is do we want to make this change for
>1.5 or publicize we are making the change for a future release? Does this
>need to go with a vote?
>
>Simon Mac Donald
>http://hi.im/simonmacdonald
>
>
>On Wed, Feb 22, 2012 at 5:27 PM, Filip Maj <fi...@adobe.com> wrote:
>
>> This is a good discussion to have. Blindly following a spec never gets
>>you
>> 100% where you want to go.
>>
>> Instead: what are reasonable storage options that as a developer using
>> cordova you would like to see? Once that is decided on, define a simple
>> spec for each of the options.
>>
>> So for the first question, in my mind having an idea of a "temporary"
>> storage space - like Joe said, volatile memory - and "persistent" seem
>> like two good options.
>>
>> Then, for simple constraints around the two options:
>>
>> To me, persistent is: data that I write to a persistent location is
>> available across device restarts and will not be removed unless my
>> application explicitly removes it (barring exceptional circumstances
>>such
>> as a device factory reset). The Android "Jail" is, for me, a good
>> candidate to be considered the persistent storage location. A removable
>> storage type such as an SD or media card is, in my mind, not a candidate
>> to "persistent" storage.
>>
>> For temporary storage, the restrictions are much less. Figuring out any
>> minimum time frames for how long a temporary storage location exists
>>seems
>> important. Should temporary storage be guaranteed across device
>>restarts?
>> Probably not. What about across application restarts? I'm not sure - I
>> would say no, not guaranteed. Within an application session? I think so.
>>
>> Etc. etc. :)
>>
>>
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Simon MacDonald <si...@gmail.com>.
But I guess the immediate question is do we want to make this change for
1.5 or publicize we are making the change for a future release? Does this
need to go with a vote?
Simon Mac Donald
http://hi.im/simonmacdonald
On Wed, Feb 22, 2012 at 5:27 PM, Filip Maj <fi...@adobe.com> wrote:
> This is a good discussion to have. Blindly following a spec never gets you
> 100% where you want to go.
>
> Instead: what are reasonable storage options that as a developer using
> cordova you would like to see? Once that is decided on, define a simple
> spec for each of the options.
>
> So for the first question, in my mind having an idea of a "temporary"
> storage space - like Joe said, volatile memory - and "persistent" seem
> like two good options.
>
> Then, for simple constraints around the two options:
>
> To me, persistent is: data that I write to a persistent location is
> available across device restarts and will not be removed unless my
> application explicitly removes it (barring exceptional circumstances such
> as a device factory reset). The Android "Jail" is, for me, a good
> candidate to be considered the persistent storage location. A removable
> storage type such as an SD or media card is, in my mind, not a candidate
> to "persistent" storage.
>
> For temporary storage, the restrictions are much less. Figuring out any
> minimum time frames for how long a temporary storage location exists seems
> important. Should temporary storage be guaranteed across device restarts?
> Probably not. What about across application restarts? I'm not sure - I
> would say no, not guaranteed. Within an application session? I think so.
>
> Etc. etc. :)
>
>
Re: Changes to requesting a PERSISTENT file system in
Cordova-Android
Posted by Filip Maj <fi...@adobe.com>.
This is a good discussion to have. Blindly following a spec never gets you
100% where you want to go.
Instead: what are reasonable storage options that as a developer using
cordova you would like to see? Once that is decided on, define a simple
spec for each of the options.
So for the first question, in my mind having an idea of a "temporary"
storage space - like Joe said, volatile memory - and "persistent" seem
like two good options.
Then, for simple constraints around the two options:
To me, persistent is: data that I write to a persistent location is
available across device restarts and will not be removed unless my
application explicitly removes it (barring exceptional circumstances such
as a device factory reset). The Android "Jail" is, for me, a good
candidate to be considered the persistent storage location. A removable
storage type such as an SD or media card is, in my mind, not a candidate
to "persistent" storage.
For temporary storage, the restrictions are much less. Figuring out any
minimum time frames for how long a temporary storage location exists seems
important. Should temporary storage be guaranteed across device restarts?
Probably not. What about across application restarts? I'm not sure - I
would say no, not guaranteed. Within an application session? I think so.
Etc. etc. :)
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Simon MacDonald <si...@gmail.com>.
On Wed, Feb 22, 2012 at 3:29 PM, Joe Bowser <bo...@gmail.com> wrote:
>
> The main argument was that "Persistent" and "Temporary" are completely
> meaningless when your data always persists unless you have user
> intervention. Therefore, I'm using the definition of temporary as anything
> that we can't guarantee will exist later because other processes can access
> it/storage can be removed/etc. Namely that this is volatile storage.
> Since the data in /data/data/<namespace> is protected by UNIX permissions,
> only the user and the app can modify this, therefore this is more
> persistent than anything on the /sdcard. This is also inline with what
> Blackberry when I asked Fil "What do the other platforms do?"
>
Yes, I agree with you. Back when we were planning on implementing the File
System and Directory Specification I suggested that Android have a public,
private and temporary file system but it was shot down.
http://groups.google.com/group/phonegap-dev/browse_thread/thread/e7f7a779370f0588/e15f347c8e25252f?lnk=gst&q=Android+media+question#e15f347c8e25252f
Actually, I believe both Android and BlackBerry use the /sdcard if it is
mounted and default to internal storage if there is no /sdcard.
> Honestly, there needs to be something more descriptive than "Persistent"
> and "Temporary" in the spec, since this isn't clear.
I would love to see an "Application" level file system that only your app
would have access to but the spec that we are implementing is geared
towards web apps and not mobile apps.
> > >IIRC the internal storage directory is protected via the UNIX
> filesystem
> > >permissions so if I wanted to store a image/audio/video file and call an
> > >intent to view/play the file it wouldn't work.
> > >
> >
>
> That's true. But if I had something that wiped my SD Card, whatever data I
> have there is saved and that it'll still be there if I remove the SD Card
> out of an HTC phone, for example.
Do people really wipe and/or remove their SD Cards a lot?
> Is this behaviour documented anywhere? I've seen literally hundreds of
> apps that pollute the /sdcard space with crap.
Yup, it is right here:
http://developer.android.com/guide/topics/data/data-storage.html#ExternalCache
> Do we know how widely this feature is used? Can we need to get more info on
> the API in general and weigh which parts we can easily break and which
> parts are verboten. I'm definitely open to suggestions on how to do it,
> since that'd be better than the "People use this" argument, since I'm sure
> there's people who use ALL of the APIs.
>
I can't point to exact numbers but I've answered multiple questions on the
mailing list about getting the root file system.
Simon Mac Donald
http://hi.im/simonmacdonald
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Drew Walters <de...@gmail.com>.
I'm curious about the statement of this being inline with what
BlackBerry does. Is this referring to the File API as implemented in
Cordova on BlackBerry or something. Reason I ask is that currently
the Cordova implementation returns an SDCard location for both
temporary and persistent requests when an SDCard is available.
Speaking as someone who has an Android device with limited on phone
storage, I would prefer apps to store data on the micro sd card :)
On Wed, Feb 22, 2012 at 2:29 PM, Joe Bowser <bo...@gmail.com> wrote:
> On Feb 22, 2012 11:56 AM, "Filip Maj" <fi...@adobe.com> wrote:
>
>>
>> The arguments Joe presented to me on changing the location of the storage
>> were compelling. Joe, can you reiterate them on the list so we all know
>> what's up?
>>
>>
> The main argument was that "Persistent" and "Temporary" are completely
> meaningless when your data always persists unless you have user
> intervention. Therefore, I'm using the definition of temporary as anything
> that we can't guarantee will exist later because other processes can access
> it/storage can be removed/etc. Namely that this is volatile storage.
> Since the data in /data/data/<namespace> is protected by UNIX permissions,
> only the user and the app can modify this, therefore this is more
> persistent than anything on the /sdcard. This is also inline with what
> Blackberry when I asked Fil "What do the other platforms do?"
>
> Honestly, there needs to be something more descriptive than "Persistent"
> and "Temporary" in the spec, since this isn't clear.
>
>
>> I believe we need to change them eventually. Now how do we go about doing
>> this? A deprecation-style message and a clear roadmap / delivery with a
>> specific release?
>>
>> On 12-02-22 11:50 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>>
>> >I agree with your points but I'm worried that we are making a change for
>> >current PhoneGap Android developers. They are assuming their data is on
>> >the
>> >/sdcard and now we are moving the location of their root filesystem. That
>> >means they'll need to write code to move any files from the /sdcard to the
>> >internal storage directory as they update their app from PhoneGap 1.4.1 to
>> >Apache Cordova 1.5.0. Alternatively, we could put a check into Cordova to
>> >do this work for them.
>> >
>> >IIRC the internal storage directory is protected via the UNIX filesystem
>> >permissions so if I wanted to store a image/audio/video file and call an
>> >intent to view/play the file it wouldn't work.
>> >
>>
>
> That's true. But if I had something that wiped my SD Card, whatever data I
> have there is saved and that it'll still be there if I remove the SD Card
> out of an HTC phone, for example.
>
>
>> >Also, with the temporary storage on
>> >/sdcard/Android/data/<package_name>/cache/ it will be cleaned up when the
>> >user uninstalls the application.
>>
>
> Is this behaviour documented anywhere? I've seen literally hundreds of
> apps that pollute the /sdcard space with crap.
>
>
>> >
>> >Anyway, I'm not adverse to making the move I just want to make sure we
>> >think through all the ramifications of the change.
>>
>>
> Do we know how widely this feature is used? Can we need to get more info on
> the API in general and weigh which parts we can easily break and which
> parts are verboten. I'm definitely open to suggestions on how to do it,
> since that'd be better than the "People use this" argument, since I'm sure
> there's people who use ALL of the APIs.
>
> Joe
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Joe Bowser <bo...@gmail.com>.
On Feb 22, 2012 11:56 AM, "Filip Maj" <fi...@adobe.com> wrote:
>
> The arguments Joe presented to me on changing the location of the storage
> were compelling. Joe, can you reiterate them on the list so we all know
> what's up?
>
>
The main argument was that "Persistent" and "Temporary" are completely
meaningless when your data always persists unless you have user
intervention. Therefore, I'm using the definition of temporary as anything
that we can't guarantee will exist later because other processes can access
it/storage can be removed/etc. Namely that this is volatile storage.
Since the data in /data/data/<namespace> is protected by UNIX permissions,
only the user and the app can modify this, therefore this is more
persistent than anything on the /sdcard. This is also inline with what
Blackberry when I asked Fil "What do the other platforms do?"
Honestly, there needs to be something more descriptive than "Persistent"
and "Temporary" in the spec, since this isn't clear.
> I believe we need to change them eventually. Now how do we go about doing
> this? A deprecation-style message and a clear roadmap / delivery with a
> specific release?
>
> On 12-02-22 11:50 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>
> >I agree with your points but I'm worried that we are making a change for
> >current PhoneGap Android developers. They are assuming their data is on
> >the
> >/sdcard and now we are moving the location of their root filesystem. That
> >means they'll need to write code to move any files from the /sdcard to the
> >internal storage directory as they update their app from PhoneGap 1.4.1 to
> >Apache Cordova 1.5.0. Alternatively, we could put a check into Cordova to
> >do this work for them.
> >
> >IIRC the internal storage directory is protected via the UNIX filesystem
> >permissions so if I wanted to store a image/audio/video file and call an
> >intent to view/play the file it wouldn't work.
> >
>
That's true. But if I had something that wiped my SD Card, whatever data I
have there is saved and that it'll still be there if I remove the SD Card
out of an HTC phone, for example.
> >Also, with the temporary storage on
> >/sdcard/Android/data/<package_name>/cache/ it will be cleaned up when the
> >user uninstalls the application.
>
Is this behaviour documented anywhere? I've seen literally hundreds of
apps that pollute the /sdcard space with crap.
> >
> >Anyway, I'm not adverse to making the move I just want to make sure we
> >think through all the ramifications of the change.
>
>
Do we know how widely this feature is used? Can we need to get more info on
the API in general and weigh which parts we can easily break and which
parts are verboten. I'm definitely open to suggestions on how to do it,
since that'd be better than the "People use this" argument, since I'm sure
there's people who use ALL of the APIs.
Joe
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Simon MacDonald <si...@gmail.com>.
Yeah, I'm in favour of deprecating things as we go along and making the big
change for the 2.0 release as Michael suggested in a previous thread.
Simon Mac Donald
http://hi.im/simonmacdonald
On Wed, Feb 22, 2012 at 2:56 PM, Filip Maj <fi...@adobe.com> wrote:
> Agreed that "this will break what users have been doing before" is a bad
> thing.
>
> Seems like that is a common issue coming up recently (toURI vs toURL on
> Entry objects, now this).
>
> The arguments Joe presented to me on changing the location of the storage
> were compelling. Joe, can you reiterate them on the list so we all know
> what's up?
>
> I believe we need to change them eventually. Now how do we go about doing
> this? A deprecation-style message and a clear roadmap / delivery with a
> specific release?
>
> On 12-02-22 11:50 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>
> >I agree with your points but I'm worried that we are making a change for
> >current PhoneGap Android developers. They are assuming their data is on
> >the
> >/sdcard and now we are moving the location of their root filesystem. That
> >means they'll need to write code to move any files from the /sdcard to the
> >internal storage directory as they update their app from PhoneGap 1.4.1 to
> >Apache Cordova 1.5.0. Alternatively, we could put a check into Cordova to
> >do this work for them.
> >
> >IIRC the internal storage directory is protected via the UNIX filesystem
> >permissions so if I wanted to store a image/audio/video file and call an
> >intent to view/play the file it wouldn't work.
> >
> >Also, with the temporary storage on
> >/sdcard/Android/data/<package_name>/cache/ it will be cleaned up when the
> >user uninstalls the application.
> >
> >Anyway, I'm not adverse to making the move I just want to make sure we
> >think through all the ramifications of the change.
> >
> >Simon Mac Donald
> >http://hi.im/simonmacdonald
> >
> >
> >On Wed, Feb 22, 2012 at 1:09 PM, Filip Maj <fi...@adobe.com> wrote:
> >>
> >> Joe and I had a discussion about this as I was getting cordova-js
> >>shimmed
> >> into the Android implementation. The /sdcard location is not persistent
> >>on
> >> Android - you can take the SD card out at any time.
> >>
> >> We ended up using internal storage as the way to go -
> >> /data/data/<package>/ as the persistent storage (can't get wiped) and
> >> /data/data/<package>/cache as the temporary storage. The ../cache path
> >>can
> >> be cleared out by going into Settings -> Applications -> Your App ->
> >>Clear
> >> Data.
> >>
> >> In hindsight I really should have posted about this switch on the
> >>mailing
> >> list - my apologies for that.
> >>
> >> I guess it's as good a time as any to discuss the switch and where each
> >>of
> >> TEMPORARY and PERSISTENT locations should go to?
> >>
> >> On 12-02-22 9:40 AM, "Simon MacDonald" <si...@gmail.com>
> >>wrote:
> >>
> >> >Hey,
> >> >
> >> >I've been reading up on all the code changes as it seems like
> >>everything
> >> >is
> >> >different after four days without internet. One of the things that I
> >> >noticed is that the command:
> >> >
> >> > window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess,
> >> >onError);
> >> >
> >> >Now returns the path "/data/data/{app package name}". In the previous
> >> >release it returned "/sdcard" or whatever the path of the mounted
> >external
> >> >storage is. So I was just wondering what the rational behind the change
> >> >was
> >> >and are we worried that everyone who's written an Android app
> >> >using window.requestFileSystem() will suddenly find their root path has
> >> >changed?
> >> >
> >> >Simon Mac Donald
> >> >http://hi.im/simonmacdonald
> >>
>
>
Re: Changes to requesting a PERSISTENT file system in
Cordova-Android
Posted by Filip Maj <fi...@adobe.com>.
Agreed that "this will break what users have been doing before" is a bad
thing.
Seems like that is a common issue coming up recently (toURI vs toURL on
Entry objects, now this).
The arguments Joe presented to me on changing the location of the storage
were compelling. Joe, can you reiterate them on the list so we all know
what's up?
I believe we need to change them eventually. Now how do we go about doing
this? A deprecation-style message and a clear roadmap / delivery with a
specific release?
On 12-02-22 11:50 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>I agree with your points but I'm worried that we are making a change for
>current PhoneGap Android developers. They are assuming their data is on
>the
>/sdcard and now we are moving the location of their root filesystem. That
>means they'll need to write code to move any files from the /sdcard to the
>internal storage directory as they update their app from PhoneGap 1.4.1 to
>Apache Cordova 1.5.0. Alternatively, we could put a check into Cordova to
>do this work for them.
>
>IIRC the internal storage directory is protected via the UNIX filesystem
>permissions so if I wanted to store a image/audio/video file and call an
>intent to view/play the file it wouldn't work.
>
>Also, with the temporary storage on
>/sdcard/Android/data/<package_name>/cache/ it will be cleaned up when the
>user uninstalls the application.
>
>Anyway, I'm not adverse to making the move I just want to make sure we
>think through all the ramifications of the change.
>
>Simon Mac Donald
>http://hi.im/simonmacdonald
>
>
>On Wed, Feb 22, 2012 at 1:09 PM, Filip Maj <fi...@adobe.com> wrote:
>>
>> Joe and I had a discussion about this as I was getting cordova-js
>>shimmed
>> into the Android implementation. The /sdcard location is not persistent
>>on
>> Android - you can take the SD card out at any time.
>>
>> We ended up using internal storage as the way to go -
>> /data/data/<package>/ as the persistent storage (can't get wiped) and
>> /data/data/<package>/cache as the temporary storage. The ../cache path
>>can
>> be cleared out by going into Settings -> Applications -> Your App ->
>>Clear
>> Data.
>>
>> In hindsight I really should have posted about this switch on the
>>mailing
>> list - my apologies for that.
>>
>> I guess it's as good a time as any to discuss the switch and where each
>>of
>> TEMPORARY and PERSISTENT locations should go to?
>>
>> On 12-02-22 9:40 AM, "Simon MacDonald" <si...@gmail.com>
>>wrote:
>>
>> >Hey,
>> >
>> >I've been reading up on all the code changes as it seems like
>>everything
>> >is
>> >different after four days without internet. One of the things that I
>> >noticed is that the command:
>> >
>> > window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess,
>> >onError);
>> >
>> >Now returns the path "/data/data/{app package name}". In the previous
>> >release it returned "/sdcard" or whatever the path of the mounted
>external
>> >storage is. So I was just wondering what the rational behind the change
>> >was
>> >and are we worried that everyone who's written an Android app
>> >using window.requestFileSystem() will suddenly find their root path has
>> >changed?
>> >
>> >Simon Mac Donald
>> >http://hi.im/simonmacdonald
>>
Re: Changes to requesting a PERSISTENT file system in Cordova-Android
Posted by Simon MacDonald <si...@gmail.com>.
I agree with your points but I'm worried that we are making a change for
current PhoneGap Android developers. They are assuming their data is on the
/sdcard and now we are moving the location of their root filesystem. That
means they'll need to write code to move any files from the /sdcard to the
internal storage directory as they update their app from PhoneGap 1.4.1 to
Apache Cordova 1.5.0. Alternatively, we could put a check into Cordova to
do this work for them.
IIRC the internal storage directory is protected via the UNIX filesystem
permissions so if I wanted to store a image/audio/video file and call an
intent to view/play the file it wouldn't work.
Also, with the temporary storage on
/sdcard/Android/data/<package_name>/cache/ it will be cleaned up when the
user uninstalls the application.
Anyway, I'm not adverse to making the move I just want to make sure we
think through all the ramifications of the change.
Simon Mac Donald
http://hi.im/simonmacdonald
On Wed, Feb 22, 2012 at 1:09 PM, Filip Maj <fi...@adobe.com> wrote:
>
> Joe and I had a discussion about this as I was getting cordova-js shimmed
> into the Android implementation. The /sdcard location is not persistent on
> Android - you can take the SD card out at any time.
>
> We ended up using internal storage as the way to go -
> /data/data/<package>/ as the persistent storage (can't get wiped) and
> /data/data/<package>/cache as the temporary storage. The ../cache path can
> be cleared out by going into Settings -> Applications -> Your App -> Clear
> Data.
>
> In hindsight I really should have posted about this switch on the mailing
> list - my apologies for that.
>
> I guess it's as good a time as any to discuss the switch and where each of
> TEMPORARY and PERSISTENT locations should go to?
>
> On 12-02-22 9:40 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>
> >Hey,
> >
> >I've been reading up on all the code changes as it seems like everything
> >is
> >different after four days without internet. One of the things that I
> >noticed is that the command:
> >
> > window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess,
> >onError);
> >
> >Now returns the path "/data/data/{app package name}". In the previous
> >release it returned "/sdcard" or whatever the path of the mounted
external
> >storage is. So I was just wondering what the rational behind the change
> >was
> >and are we worried that everyone who's written an Android app
> >using window.requestFileSystem() will suddenly find their root path has
> >changed?
> >
> >Simon Mac Donald
> >http://hi.im/simonmacdonald
>
Re: Changes to requesting a PERSISTENT file system in
Cordova-Android
Posted by Filip Maj <fi...@adobe.com>.
Joe and I had a discussion about this as I was getting cordova-js shimmed
into the Android implementation. The /sdcard location is not persistent on
Android - you can take the SD card out at any time.
We ended up using internal storage as the way to go -
/data/data/<package>/ as the persistent storage (can't get wiped) and
/data/data/<package>/cache as the temporary storage. The ../cache path can
be cleared out by going into Settings -> Applications -> Your App -> Clear
Data.
In hindsight I really should have posted about this switch on the mailing
list - my apologies for that.
I guess it's as good a time as any to discuss the switch and where each of
TEMPORARY and PERSISTENT locations should go to?
On 12-02-22 9:40 AM, "Simon MacDonald" <si...@gmail.com> wrote:
>Hey,
>
>I've been reading up on all the code changes as it seems like everything
>is
>different after four days without internet. One of the things that I
>noticed is that the command:
>
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess,
>onError);
>
>Now returns the path "/data/data/{app package name}". In the previous
>release it returned "/sdcard" or whatever the path of the mounted external
>storage is. So I was just wondering what the rational behind the change
>was
>and are we worried that everyone who's written an Android app
>using window.requestFileSystem() will suddenly find their root path has
>changed?
>
>Simon Mac Donald
>http://hi.im/simonmacdonald