Understanding Google Gears – The Basics

Understand Google Gears

Google Gears was released in mid 2007 and, as described by the big G themselves, “enables more powerful web applications, by adding new features to your web browser.”. This is a slightly generic explanation and the aim of this post is to show exactly what Google Gears does and how you can benefit from it.

Essentially Gears (the official name, to reflect the open source nature) extends your web browser. You perform an install at http://gears.google.com/ which is available for most modern browsers. A website can then use the following features via Gears:

  • A local server, to cache and serve application resources (HTML, JavaScript, images, etc.) without needing to contact a server
  • A database, to store and access data from within the browser
  • A worker thread pool, to make web applications more responsive by performing expensive operations in the background

But what does this actually mean and what makes it good?

Offline Functionality – By using Gears, the application and data can be stored offline and the user can perform tasks without an internet connection. Data can then be synchronised once an internet connection is available. A great example of this is Google Mail – with gears you can view your emails, reply, send new, access your address book etc. and everything is performed once you get an internet connection. See also the todo list application Remember the Milk.

Faster Sites – Gears can store files, data and code on a local web server, meaning your machine shares the processing power and reduces the need for data transfer. WordPress implements this well in the admin area, speeding up many tasks.

Quicker Searches – Full text searching can be performed locally, meaning less server resources are used and quicker results for the user. MySpace takes advantage of this feature.

Threading JavaScript Code – On a more technical level, the WorkerPool functionality allows Javascript to be run in the background without affecting the browser. This essentially means that script execution is not stopped on the website while this Javascript is running, meaning a more user friendly experience and hopefully the disappearance of the “A script is taking a long time to run…” dialog boxes.

GeoLocation access – Google Gears can request the geographic location from the client (if there is a GPS device such as on an iPhone) or from the network information (IP address etc.). This is made simple for the coder and allows the web application to know with accuracy and efficiency where the client is located.

What else can Gears do?

Gears is still in Beta and is not recommended for public use yet (despite many Google Applications using the technology). Gears provides an interface between the website and the clients machine, meaning that in future websites will for example be able to:

  • Encode video/audio locally
  • Send notifications to the users desktop (e.g. Windows XP bubbles or OS X Growl style notifications)
  • Access files locally
  • Ability to resume file uploads
  • Use the clients camera

Some important information

Google Gears needs to be implemented so this is an extra strain on lower budget websites and applications. Also, the client needs to install an extension to their browser meaning your typical user won’t have the software available. This means that at the moment only hugely popular technical/professional style sites are implementing gears.

The popular Firefox plugin Grease Monkey, which basically allows you to use scripts (or your own code) to modify websites on the fly, can be used to implement Gears features even when the website hasn’t implemented it. See the Google article Gears Monkey for more information and a script for Wikipedia.

The actual name of this technology is Gears. Google renamed it from Google Gears in order to reflect the open source direction of this project. Many people still refer to the technology as Google Gears, including myself, due to the ambiguity of Gears.

What other web applications are currently using Google Gears?

Here are a few I know about:

Do you have any Google Gears tips, tricks, advice or questions? Get involved and comment below!

About the author

Carey

View all posts