Getting to Know Google Gears 

Saturday, June 23, 2007 9:12:09 AM
Rate this Content 0 Votes

In mojoPortal, I'm working on a suite of features collectively titled Site Office. This will have things like Site Mail, file storage, Contact Management, etc, as well as the ability to check external pop3 email accounts like Yahoo Mail or GMail.

I'm planning to try and make some of these features have offline functionality by using google gears.

For example, in the feature to access external pop email, I don't want to store any messages in the web site database because that would end up being huge amounts of data and there is no reason to store it since its already stored on the mail server.

In order to avoid retrieving the messages from the mail server on every request I plan to store them in a client side SQLite database which is provided through google gears. The database lives on the user's computer and is secured by the file system. You access the database from the browser via javascript.

Before trying to tackle this complex feature to keep mail synced from the mail server into the local db, I figured I better learn a little about how to work with the database, so I implemented a little Database Query Tool for running queries against the google gears database api and saving queries in the database as well. I will be able to use this tool in defining and managing the schema for client side db I will use for storing data for the pop email feature.

Pretty fun! Those working with mojoPortal svn trunk can follow my work as I do nightly check ins.

Now I still need to learn how to use the LocalServer component of google gears, as this is what is used to load a page and its supporting files while offline. I expect in implementing the email feature I will also need to use the WorkerPool to do synchronization in the background without blocking the UI.

UPDATE 2007-06-24:

Anyone who would like to try out this little query tool can use the mojoPortal demo site. Follow this link, and when prompted to login use admin@admin.com and password admin.

Share This Using Popular Bookmarking Services
Copyright 2003-2010 Joe Audette
Comments are closed on this post.
Donate Money to support the mojoPortal Project. View Joe Audette's profile on LinkedIn View Joe Audette's profile on The Guild of Accessible Web Designers site