do i initialize localserver & set manifest on EVERY page session?

12 views
Skip to first unread message

bcamp1973

unread,
Feb 3, 2011, 12:56:25 PM2/3/11
to Gears Users
Assuming a client with offline support, my assumption is to do the
following on EVERY page of the application?

// Check for gears of course
if (!window.google || !google.gears) {
location.href = "http://gears.google.com/?
action=install&message=<your welcome message>&return=<your website
url>";
}

// Initialize local server and check for manifest update
var localServer = google.gears.factory.create('beta.localserver');
var store = localServer.createManagedStore('myManagedStoreName');
store.manifestUrl = 'myManifestFileName.json';
store.checkForUpdate();

// Optionally initialize DB if needed on per page basis
var db = google.gears.factory.create('beta.database');
db.open('myDatabaseName');
// do db stuff
rs.close();

Is this correct? The documentation seems pretty thorough, but wasn't
sure what's a one-time thing and what needs to be addressed on every
page session. This is my first attempt at an offline client so I'm not
used to dealing with persistence without pulling from the server ;)

Michael Nordman

unread,
Feb 3, 2011, 4:38:07 PM2/3/11
to brian.c...@nursinghomequality.com, gears...@googlegroups.com
Gears has been deprecated. I'd recommend looking into the
offline/storage related features in HTML5 instead of Gears.

Brian Campbell

unread,
Feb 3, 2011, 4:42:40 PM2/3/11
to Michael Nordman, gears...@googlegroups.com
It's not an option. I have to support IE browsers and of course there's no appcache support in IE prior to V9.0...and it will probably be another decade before our clients upgrade...

Kevin Layman

unread,
Feb 3, 2011, 5:22:51 PM2/3/11
to gears...@googlegroups.com
I believe that Gears is going to want to install once for your domain and after that anything under that domain should be good to go.

Kevin Layman

unread,
Feb 3, 2011, 6:17:27 PM2/3/11
to gears...@googlegroups.com
On second thought though, if you do not have a single entry point to your multipage app (like a sign on page?) you will have to include the Gears init code on any page that a user may be able to access directly via an url.

Brian Campbell

unread,
Feb 3, 2011, 11:22:39 PM2/3/11
to gears...@googlegroups.com
Well, i think i figured it out. You have to initialize the local server on every page and initialize the managed store...beyond that I think it's set?

MarkS

unread,
Feb 5, 2011, 10:41:13 PM2/5/11
to Gears Users, Michael Nordman, brian.c...@nursinghomequality.com
I think Gears was deprecated too soon. Hopefully Google will continue
to support it and keep it working for a while longer until the similar
features in HTML5 get sorted out, fully implemented and established.

For example, the need is for a local database and an offline app
cache.

The HTML5 Web SQL Database spec appears to be dead. [
http://dev.w3.org/html5/webdatabase/ ]
This was implemented in Chrome and Safari I think, will it continue to
be supported in future versions or will it end up being deprecated
since it is not part of the html5 spec? It likely won't be implemented
in Firefox or IE.

IndexedDB is not fully implemented yet. [
http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML_5)#Related_specifications
]
This appears to be the HTML5 database spec going forward. This is
probably the one to use for a local db, but not quite yet? It looks
like IE9/Firefox,/Chrome will support it.

For offline app cache, IE/Trident is a 'no' on the Wikipedia chart.
That's a problem if your customers use IE. You'd need to use Google
Chrome Frame in IE to get offline app functionality.

Will Google Chrome Frame continue to be supported for IE9, or only for
IE6,7,8?



On Feb 3, 4:38 pm, Michael Nordman <gears.tea...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages