Persistence in Hybrid iPhone applications?

1 view
Skip to first unread message

Sean Gilligan

unread,
Nov 23, 2009, 4:04:32 PM11/23/09
to iphone...@googlegroups.com
I've done a little bit of research about persistent data in hybrid
iPhone. I've blogged my list of possible options and their pros/cons here:
http://code.msgilligan.com/2009/11/storing-persistent-data-in-hybrid.html

Does anyone have anything to add to the discussion? Suggestions,
warnings, best practices, and/or sample code would all be nice :)

Thanks,

Sean

Remi Grumeau

unread,
Nov 23, 2009, 7:18:33 PM11/23/09
to iphone...@googlegroups.com
Since the basic of persistent data is to be totally plateform specifics free, i would religiously not go for any iPhone specific bridges or key values (not to mention that key values and cocoa bridges would certainly be broken while using a Palm Pre or an Android phone, and Nokia Maemo with Mozilla Fennec).
Cookies is ok for simple datas like a date, an integer or a username ... but pretty limited and like you mention, the browser stores its whole content in the document header which can slow down the responsiveness of the webapp.

HTML5 web storage seems the best way to explore to me, and the more reliable due to its standard state.

Remi
> --
>
> You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
> To post to this group, send email to iphone...@googlegroups.com.
> To unsubscribe from this group, send email to iphonewebdev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=.
>
>


Remi Grumeau
(+33) 663 687 206
http://www.remi-grumeau.com

Sean Gilligan

unread,
Nov 23, 2009, 7:48:32 PM11/23/09
to iphone...@googlegroups.com
Remi Grumeau wrote:
> Since the basic of persistent data is to be totally plateform specifics free, i would religiously not go for any iPhone specific bridges or key values

Key-Value storage and Web Storage are the same thing by two different names:
http://www.w3.org/TR/webstorage/
http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Name-ValueStorage/Name-ValueStorage.html

It is part of HTML 5, but is not widely implemented yet (even in the
Webkit world)

Quirks Mode testing is here:
http://www.quirksmode.org/dom/html5.html#localstorage (Desktop)
http://www.quirksmode.org/webkit.html#t016 (Webkit implementations)


> Cookies is ok for simple datas like a date, an integer or a username ... but pretty limited and like you mention, the browser stores its whole content in the document header which can slow down the responsiveness of the webapp.
>

And I don't know how to make them work for hybrid webapps (haven't tried
very hard)

> HTML5 web storage seems the best way to explore to me, and the more reliable due to its standard state.
>

localStorage (the persistent case of Web Storage) seems to be working
fairly well for me with a fallback case for iPhone OS 2.2 (which will
just loose the new feature)


-- Sean

Reply all
Reply to author
Forward
0 new messages