views:

1010

answers:

4

Hi all,

we've trying to develop a mobile web app that will provide offline capabilities, not just reading but also creating content.

Gears supports three important aspects: - local server so we can have cached static content such as html, css, js, etc - local database so that we can have data stored locally for offline access as well as store new content inside of it while offline - workerpool, used for a background process that syncs data back to the server

By the looks of the gears page and some other articles, gears is being abandoned in favour of html 5 which is understandable.

However, at this stage there are two problems:

  1. there's still a long way to have HTML 5 supported by major desktop browsers,let alone mobile ones
  2. HTML 5 does not support workers, there is a draft http://dev.w3.org/html5/workers/ but I assume real browser support is still far away.

Do what does one do today? (e.g. within the next year) Cheers Rok

+5  A: 

I think that you have slightly misinterpreted Google's position on Gears. According to an article in the LA Times:

The Google spokesman wrote to clarify in a follow-up e-mail, "We're continuing to support Gears so that nothing breaks for sites that use it. But we expect developers to use HTML5 for these features moving forward as it's a standards-based approach that will be available across all browsers."

It sounds to me like it is completely safe to continue using Gears, until and after HTML 5 is ubiquitous.

Adam Crossland
I assume, that the way to go forward is then to create some kind of wrapper/interface that we use in our app and change the underlying implementation in the future as html 5 develops. There is something similar already available (http://code.google.com/p/webstorageportabilitylayer/) but with practically no documentation and only one committed revision...What would you suggest on the worker side?
Rok
You can only plan for the future so much. Personally, I wouldn't worry about creating some kind of abstraction layer to mask the differences between Gears and HTML5. I'd code to Gears, get the app done, and watch carefully as HTML 5 matures and becomes widely available. I try to stay away from open source projects with no documentation.
Adam Crossland
+3  A: 

HTML5 support is a little better then you think.

Android has various support for HTML5 standards, with the inclusion of Google Gears into most versions and Android 2.0+ having native support for HTML5 (at least as far as audio/video, canvas, offline storage, and geolocation go). IPhone also supports offline storage along with audio/video tags. WebOS seems to have offline database support, but I don't know much beyond that.

http://www.whatwg.org/specs/web-workers/current-work/ is the web worker draft implemented in Firefox 3.5 and Safari 4, so they should wind up in IPhone's version of Safari eventually.

So if you can live without worker threads and don't mind limiting yourself to Android, WebOS, and IPhone, you can use a hybrid approach of HTML5 with a fallback to Gears.

I don't think supporting other smart-phones is going to be possible in a truly portable way, although Firefox for Mobile (which is nearing release on the Nokia N900) will support all the HTML5 as Firefox 3.6.

sargas
I tried an Android 1.6 device and it failed to do window.openDatabase js method so offline storage seems to not be supported there. I did not test Android 2.X. Majority of our customers will be running Windows Mobile devices so that is one requirement we have.IE mobile is crap, but Opera mobile+gears run fine. Of course, the more platforms we can support, the better. What do you suggest as a sync replacement for worker threads?
Rok
A: 

Appcache, Web storage & Web workers works on Firefox and newer Android devices.

Use this handy test http://dev.w3.org/2008/mobile-test/v2/ to profile browsers.

hendry
A: 

HTML 5 does not support workers, there is a draft http://dev.w3.org/html5/workers/ but I assume real browser support is still far away.

I coded a working example of web workers using the WebKit engine included in Qt 4.6.2. Looking at the code history, support was incorporated sometime in 2008.

I've been surprised by the level of HTML5 already in (desktop) browsers (excepting IE of course). Mobile lags a few years. I've found this site useful: http://caniuse.com/

james creasy