Getting Offline with Google Gears and Gearpad – problem solved

googleart.gifToday, in 2007, taking a Web App offline is actually a relevant topic. In a few years, we will be able to look at solutions to the offline issue as a buggy whips in a Model T world. WiMax and whatever genius solution they finally come up with will have us all connected all the time. But it is just 2007 after all and we need to go offline occasionally.

Enter Google Gears and Adobe Air and, I’m sure, some other stuff that is out there. Well, I’m working on a web application that I need to go offline. I’m no javascript ninja or anything like that, so I’m starting the Gears learning curve by working through the sample application, Gearpad (working demo).

There is a ton of stuff out there on Gears, so I won’t rehash it here. But if you want to install Gearpad on your own website to try it out for yourself, here are the solutions to a few problems I encountered:

  1. If you do not have the latest instance of the gears plugin installed, you may get a: Could not create requested object error (or some variation of that). If you install from the main gears page, you don’t get the latest version (, at least as of today. Go here and download the latest greatest: gears download list. Download it and run it. If you installing on Firefox, use File/open from the firefox app. From IE, you can double click on the downloaded file on your desktop.
  2. After you’ve got all the files copied over to your server, the db_config.php updated for you databsae, and your database table built, now you log it. When I did this, it gearpad got stuck syncing…This obviously wasn’t right.

    The Problem:

    evidently, gearpad checks the “clientid” that is inserted into your local database. The first one inserted is 0. This looks like the value FALSE to some code, so it does a check on the clientid value and thinks it’s false. Then it poops out.

    The Fix:

    • The easiest thing would be to create another login. I didn’t try that, but it should work.
    • Trouble is you may have blown your email address on the first login. If that’s the case, then you need to use the dbquery.html tool to manually update the clientid in the database. You can get the query tool from the same zip file that had the sample application (tools folder, not samples). Here’s the file.
      1. Stick the file in your gearpad folder on your webserver and call it up manually
      2. Type in sql statement: UPDATE user SET clientid = 1
      3. Now you need to update your mySQL database to reflect the change. Set last_clientid = 1 and next clientid = 2

    That should fix it!

Good luck! I anguished over that little problem. Hope to save you some headache.

Comments are closed.

Powered by WordPress. Designed by Woo Themes