Thursday, February 05, 2009

Google Gear Offline Access to your Gmail interface

Google Gears is a free open-source project that adds desktop capabilities to the Internet Explorer, Firefox, Safari, and Chrome browsers on the Windows, Windows Mobile, Mac OS X, Linux and Android operating systems. (Chrome has Gears built in and does not need a separate installation.) Currently at Beta Version 0.5 (but ready for prime time now), Gears lets Web applications interact naturally with your desktop; cache and store application resources and blobs ( binary large objects ) locally; store data locally in a fully searchable SQLite database; run JavaScript in the background to improve performance; and perform geolocation both by IP address and by Wi-Fi antenna data.

Basically, Google Gears is a way to take Web applications offline in a browser.

Google Gears exposes a JavaScript API to supported browsers. Google hosts the Gears runtime engine, which users must install before running any Gears applications. Developers need to copy gears_init.js into their application directories and call it in order to initialize the Gears factory and APIs; this script will offer to launch the Gears installer if it cannot initialize successfully.

The online Gears developer documentation discusses Version 0.5, released a month ago. It includes nine samples that illustrate the use of the APIs. You can download the source to all of these samples, plus some articles, a couple of tools and an Apache mod implementing the resumable HTTP request proposal. One of the articles is a tutorial on taking Web applications offline with Gears, written by Omar Kilani of Remember The Milk . Kilani and his team implemented offline functionality for their application in "four caffeine-fueled days."

Google Gears is free. Adding Gears functionality to a Web page is a simple exercise in JavaScript programming, which can be accomplished using any HTML or text editor. The effort of taking a Web application fully offline with Gears is commensurate with the complexity of the application. Note that using a local database to synchronize large amounts of data can introduce performance issues; this is the reason for the asynchronous JavaScript WorkerPool API .