incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse <purplecabb...@gmail.com>
Subject Re: More issue gardening discussion: app root path
Date Fri, 22 Jun 2012 20:23:05 GMT
WP7 does not restrict against writing to the www folder, as it is an
'unpacked' version of the binary assets included in the .dll

So the answer to Fil's question is, yes, on some platforms you can write ...
I do however think that because 'some' of the platforms treat the app
folder as read-only, we should enforce it for 'all'

Back to the original discussion, I think the nicest approach is the one
that was taken with the AIR File API  [0], specifically:
app://someAppFolder

The difficult part would be resolving ALL instances of file paths using the
app:// protocol.
Adobe Air supports using this EVERYWHERE, which in our case would be :
- image links ( both declaritively in html AND dynamically in JS via
setting the img.src property )
- scripts, css  ( similar to img above )
- XHR requests
- FileAPI use
- possibly more ...

[0]
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7dc7



On Fri, Jun 22, 2012 at 12:56 PM, Simon MacDonald <simon.macdonald@gmail.com
> wrote:

> To the best of my knowledge the www folder on Android, iOS and BB is write
> only as that is part of your application.
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Fri, Jun 22, 2012 at 3:53 PM, Filip Maj <fil@adobe.com> wrote:
>
> > Thanks for pointing that out.
> >
> > APIs will get revisited post-2.0, but this is something that the
> framework
> > needs to provide IMO. I don't really care _how_ it does it, that's a
> > subjective discussion / more a matter of preference.
> >
> > Simon, why would it have to be read-only? Can we not programmatically
> > write to the www folder on some platforms?
> >
> > On 6/22/12 12:46 PM, "Simon MacDonald" <simon.macdonald@gmail.com>
> wrote:
> >
> > >We floated this idea out once upon a time. The best resource I could
> find
> > >on it was:
> > >
> > >
> >
> https://groups.google.com/forum/?fromgroups#!searchin/phonegap-dev/Android
> > >$20media$20question/phonegap-dev/5_eneTcPBYg/nItMozwh8QoJ
> > >
> > >There are a number of practical concerns when it comes to implementing
> > >this
> > >however. On all of the platforms the APPLICATION file system would be
> read
> > >only which could cause some confusion among developers who want to write
> > >files into this file system. IIRC Justin did not find a way to list all
> of
> > >the assets on BB. That may have changed with the some of the more recent
> > >OS
> > >versions though.
> > >
> > >Way back in PG 1.1 I had the stubs for an APPLICATION and RESOURCE
> > >filesystem in the code but it was shot down at that point as it did not
> > >follow the W3C spec.
> > >
> > >Simon Mac Donald
> > >http://hi.im/simonmacdonald
> > >
> > >
> > >On Mon, Jun 11, 2012 at 7:54 PM, Filip Maj <fil@adobe.com> wrote:
> > >
> > >> Reference issue: https://issues.apache.org/jira/browse/CB-285
> > >>
> > >> TL;DR: how can I reference in-app (inside the www folder) resources
> in a
> > >> cross-platform way? For example, packaged .mp3 file, for use in Media.
> > >>
> > >> Some contributors recommend parsing location.href, but this is brittle
> > >>and
> > >> does not work on all platforms.
> > >>
> > >> My proposal: add a new constant to the LocalFileSystem object [1]
> > >> representing the application root (e.g. APPLICATION). Users could
> then:
> > >>
> > >> function onSuccess(fileSystem) {
> > >>    console.log(fileSystem.name);
> > >> }
> > >>
> > >> // request the file system of the app package www folder
> > >> window.requestFileSystem(LocalFileSystem.APPLICATION, 0, onSuccess,
> > >> onError);
> > >>
> > >>
> > >> Thoughts?
> > >>
> > >> [1]
> > >>
> > >>
> >
> http://docs.phonegap.com/en/1.8.0/cordova_file_file.md.html#LocalFileSyst
> > >>em
> > >>
> > >>
> >
> >
>



-- 
@purplecabbage
risingj.com

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