A Quick Guide To Google Gears
What follows is a no nonsense introduction to Google Gears. It's what you need to know but maybe haven't bothered to find out and it comes with as little tech speak and buzzwords as possible.
What Does Gears Do?
You probably know already that Gears lets you take web applications offline. What you might not know is how it does it and at what cost.
How Does it Do it?
Gears gives us, the developer, two tools:
- A local database to store information in.
- A way to store HTML, JavaScript, CSS and image files on the local machine and then serve them to the browser even when there's no network connection.
When combined the above two abilities give you a way to display and edit data while offline!
The interface to both the database and the "LocalServer" is via new JavaScript methods and objects added to the browser by the Gears install.
The database Gears uses on the local machine is based on SQLite.
Install?
Before an end user can use Gears to go offline they need to install it. Foregoing any corporate rollout this means the user needs to download a .exe file (for Windows), find it, open it, install it etc and restart their browser. Something that's bound to trip up a couple of users but a necessary evil, I guess.
Gears and Domino?
I know what you're probably wondering - does Gears work with Domino? Yes, it does. Just don't expect to drop a couple of .JS files in your database and have it up and running. It's not as easy as that, by any means. Taking your Domino applications offline with Gears would involve a lot of work.
Whether it's feasible to do so or not depends on your app. One obvious restriction to Gears is that it can't mimic your server-side logic/workflow/emailing etc. What you could do instead is have all this logic run, as usual, when the user re-syncs their change back to the server.
Next week I'll show you a working demo of a simple Domino-Gears database. By simple I mean simple. A list of documents (with one field on it!) on a one-paged applications which allows you to edit the field values offline and then re-sync when online.
Things To Note:
Here are a couple of things I've noticed which I didn't necessarily expect:
- When you install Gears on a Windows machine it installs itself for both IE and Firefox, which is nice. However, if you go offline in one you won't be able to work with the data in the other. This is because they use different databases and, I guess, different stores of local files!
- The LocalServer is very URL-sensitive: If you go offline while at the following address:
http://www.codestore.net/apps/gears.nsf/
Then you won't get a cached/offline copy of the site if you try to visit any of the following without a network connection:http://www.codestore.net/apps/gears.nsf
http://www.codestore.net/apps/Gears.nsf
http://codestore.net/apps/gears.nsf/
Further Reading
Some links that may be of help:
How does Gears compare to DOLS?
I realise that Gears is a mroe general platform and can be used on a whole variety of websites/services and DOLS is obviously just for Domino. But I'd be interested in your thoughts on the comparisons.
Good question Dragon. Trouble is I know nothing about DOLS (apart from what it's meant for), so can't compare really.
I might give it a quick whirl and see how they stack up...
Why not leverage your Flex work by adding Adobe AIR for off-line support?
I had a quick read of "how DOLS works"
http://codestore.net/help/help7_admin.nsf/0/650fe263106f083d852570610054d613
and it seems similar to how Gears works in essence.
What I can't work out is if DOLS means the PC needs Notes installed. Does anybody out there know?
My interest in Gears came about as there's a potential project for me which involves offline data access on mobile devices.
Again, anybody know if DOLS works on mobiles devices?
Ed. AIR is on my list of things to look in to. For now though there's no way to use Flex/AIR on mobile devices so it's a no-go. The AIR apps I've seen do look amazing though!
Jake
Jake,
No you don't need Notes installed to run DOLS, but in essence the best way to think of DOLS is a Notes client with a browser welded on top as the UI.
After you do a DOLS install, and then nose around in file manager, you will see that it's installed a Notes client sans the UI. So you get full access to user ids and replication.
Much the same way as DAMO works. DOLS and DAMO are both Notes clients with an alternative UI bolted on top.
Given that it is in essence a Notes client, I don't think DOLS will work with mobile devices.
Too funny, I just submitted an article for the June LotusUserGroup.org newsletter about DOLS and Gears. A timely discussion...
A couple of quick notes: DOLS installs a mini Domino SERVER, not really a client. It has the Domino web engine built in. The workflow (LotusScript back-end agents? WebQueryOpen or Save, for example?) that Gears can't handle, DOLS will.
Also, setting up DOLS for your Domino application really IS as simple as dropping some design elements into your app.
And DOLS has no mobile client, though I suspect IBM would say the Expeditor does.
One point in Gears favor? It's UI is more obvious for non-Domino geeks. If I'm building a public-facing site, I'm going to try to use Gears instead of trying to support DOLS for random people. On a Domino intranet, though, DOLS would win pretty easily.
Now, if only more people knew it wasn't just an iNotes thing. I bet this blog topic does more to raise DOLS awareness than anything in the past 5 years.
"if only more people knew it wasn't just an iNotes thing"
Funny you should say that Rob, as, reading the help file earlier on, I got the impression it was just an iNotes thing. It's only because I was fairly sure it wasn't that I didn't end up thinking it was.
Thanks for the primer, Jake. Concise and useful.
In my experience the problem with DOLS is that it needs to download a replica of the database you need to work offline with before you can start. As previously stated it is basically a local notes server which creates replica copies of the changes you made and then replicates them back to the server - pretty nifty but if you have to start with a 100M+ database that can be a problem getting it set up initially over a slow connection.
It's amazing really cos DOLS has been around for nearly 10 years and yet you never really hear very much about it...
Thing is, DOLS is for Windows, and hasn't been developed in any active way for years. Contrast: Gears is Mac, Linux, Win...
And like I said, DOLS isn't developed or pushed by IBM, whereas Gears gets plenty of HTML 5 and Google love. So I think I know where I wat to spend my learnin' time :)