Google Gears - The new runtime in town

31 May 2007 in Programming & WebDev

Google finally entered Microsoft and Adobe competition in the RIA (Rich Internet Application) by introducing Google Gears.

Google Gears is nothing more that a small (700K) runtime that allows any website to benefit from its offline capabilities, local isolated storage and faster Javascript (asynchronous).

The runtime is available for Windows Vista, Linux and Mac. Also, the code is available via the new BSD Licence.

Some of Google’s applications are already supporting this technology, mainly Google Reader, and there notable increase of speed in them.

The picture on the right shows the dialog that pops up to let you know that Google gears is going to be storing data locally.

The data is stored in a SQLite database, and the web application can use Javascript to CRUD (Create, Read, Update, Delete) the data.

You can easily use SQLite tools to browse the database.

Here’s a snippet of Javascript that is used to detect if Google Gears in installed. There are three (currently) different ways to do this, one for each of the supported browsers: Firefox, IE and Safari.

  var factory = null;

  // Firefox
  if (typeof GearsFactory != ‘undefined’) {
    factory = new GearsFactory();
  } else {
    // IE
    try {
      factory = new ActiveXObject(‘Gears.Factory’);
    } catch (e) {
      // Safari
      if (navigator.mimeTypes[“application/x-googlegears”]) {
        factory = document.createElement(“object”);
        factory.style.display = “none”;
        factory.width = 0;
        factory.height = 0;
        factory.type = “application/x-googlegears”;
        document.documentElement.appendChild(factory);
      }
    }
  }

Here are some websites with more information:

A Gears Tutorial is available that illustrates the basic concepts. You may also find the Google Gears sample applications useful. Source code for these samples can be downloaded in a zip file found on the same page.

The runtime looks pretty good. I will try to explore more soon.

Let’s see how this will fit in the current Silverlight vs Apollo vs Flash space.

2 comments. Add your own comment.

John Dowdell says 1 June 2007 @ 06:57

“Let’s see how this will fit in the current Silverlight vs Apollo vs Flash space.”

Those are actually different spaces:

o Browser plugin for enhanced presentational layer: Adobe Flash Player; Microsoft Silverlight.

o Desktop application: Adobe Apollo, using normal webpage content for UI and logic.

o Local relational client database: Google Gears, invocable by Ajax, Flash, or Apollo.

jd/adobe

fabiopedrosa says 1 June 2007 @ 16:02

Hi jd.

Yes, that’s true. They actually are not the same. But I don’t believe they are all that different…

Although Google Gears is more a tool than a platform, which can be used by Flash/Apollo/Ajax, like you said,
I don’t really think a lot of developers will work simultaneously with Silverlight/Flash or Apollo/WPF.

Silverlight, even if only a browser plugin for enhanced presentation layer, shares a lot with WPF, that is a direct alternative to Apollo. There’s very little work to migrate code from one to the other.

Leave a Comment

Name (required)

E-mail (required - not published)

Website

Your comment:


Search


Pages


Top Posts


Categories


Advertising