Googling with Gears

August 18, 2007

Just been having a quick look at Google Gears, a very nice piece of software that will let you use web-based applications when not connected to the Internet.

My initial enthusiasm was fired by wondering if they were getting around to Gears-enabling Gmail and Google Docs, two applications that would be very nice to have access to when I’m up at Koitiata without an Internet connection.

After having a bit of a scout around, I’ve discovered a few interesting things about Google Gears:

  • It makes use of Sqlite databases to store information locally
  • It makes use of JSON for communicating datatypes

After installing Gears and installing a couple of sample apps on my local Apache webserver, I discovered that in Firefox Google Gears is stored at:

C:\\Documents and Settings\\Owner\\Local Settings\\Application Data\\Mozilla\\Firefox\\
Profiles\\t6djva97.default\\Google Gears for Firefox

The details of each URI are stored relative to this path; for example, installing the Google Gears Database Demo (by dropping it into the Apache htdocs/gears/hello_world_database folder) and running it (http://localhost/gears/hello_world_database/), a sqlite database database-demo#database is created at localhost\http_80.

This database can be interrogated as any other Sqlite database:

> sqlite3 database-demo#database
SQLite version 3.4.1
Enter ".help" for instructions
sqlite> select * from sqlite_master;
table|Demo|Demo|3|CREATE TABLE Demo (Phrase varchar(255), Timestamp int) 
sqlite> select * from Demo;
Jason|1187427561593
Charles|1187427567562
Monkey|1187427570765

There’s a very nice flash-based Google Gears sql admin application which provides a nice way of administering the Google Gears databases (which I’ve downloaded and installed locally at http://localhost/gears/gearsadmin/sqladmin.html).

Leave a comment