Archive for the ‘Google Gears’ Category

Building Google Gears 0.3.2.0

Thursday, January 3rd, 2008

The google gears team recently announced the features that will be added in gears 0.3

One of them particularly caught my eyes: the Desktop API. It provides a simple method that lets you create a shortcut icon on the user desktop, to launch your web application. Is’s particularly interesting for an offline-enabled web application, and improves the user experience while making web applications one step closer to Rich Desktop Applications.

However, google doesn’t provide the 0.3.2.0 version yet. If you want to try it, you’ll have to compile it yourself from the gears svn version. (There’s a tutorial to build it under windows, for MacOS, a simple “make” will work)

As the compilation procedure was not so straightforward under windows, here are the xpi files (firefox only) from the latest svn revision (revision 638) :

Once you’ve installed it, you can try this snippet : (it won’t work unless you change the icon urls to REAL icon files)

var desktop = google.gears.factory.create('beta.desktop');
desktop.createShortcut("Test Application",
       "An application at http://www.test.com/index.html",
       "http://www.test.com/index.html",
      {"16x16": "http://www.test.com/icon16x16.png",
       "32x32": "http://www.test.com/icon32x32.png",
       "48x48": "http://www.test.com/icon48x48.png",
       "128x128": "http://www.test.com/icon128x128.png"});

I’m now impatient to be able to launch firefox without the browser chrome (like Prism) ! I think I’ll have to wait for Firefox 3 :)

Google Gears performances issue

Monday, December 3rd, 2007

I’ve been using Google Gears rather intensively (see Gears In Motion) during the last few months.

I started building an interface that uses all the components of Google Gears (Local Database, Local Server and WorkerPool), and implemented a synchronization engine. The result was a much more responsive offline application with many features that couldn’t have been easily implemented without the local database, and that works great !

Until… one of my coworker tried to import 20.000 records: It took 40 minutes to execute the SQL INSERT statements ! (approx. 120ms/insertion)

We then decided to write this 100 insertions test, which revealed to have surprising results :

  • On MacOS 10.4.11: 2.6ms by insertion (approx. 385 insertions/second)
  • On Windows XP and Vista: 107ms by insertion (approx. 9 insertions/second)

Please run the test and post your results as a comment indicating your OS/Browser version/Google Gears version.

Any idea why it is so slow on Windows ?

WebRunner/XulRunner and Google Gears

Friday, October 12th, 2007

I get very excited by the recent release of WebRunner 0.7 : WebRunner is a simple XULRunner based browser that hosts web applications without the normal web browser user interface.”

It lets you use your favorite web applications in a separate process/window with better OS-integration (alt-tab, desktop icon …). Many applications such as Gmail, Google Reader, Facebook and others are already packed. And it is very simple to create your own.

I get even more excited when I found out that Alex Sirota added Google Gears support on WebRunner.

His method is a bit out-of-date (I think he used WebRunner 0.5), so here is the way to do it in 2 steps under Windows (and with WebRunner 0.7) :

  • Tell WebRunner to load the Google Gears extension: open regedit, and add the following key : [HKEY_LOCAL_MACHINE\SOFTWARE\WebRunner\Extensions]
    {000a9d1c-beef-4f90-9363-039d445309b8}=C:\\Program Files\\Google\\Google Gears\\Firefox\\
  • Make Gears compatible with WebRunner : Open C:\Program Files\Google\Google Gears\Firefox\install.rdf and add those lines after the “em:version” tag :
    
    <em:targetApplication>
     <Description>
      <em:id>webrunner@developer.mozilla.org</em:id>
      <em:minVersion>0.4</em:minVersion>
      <em:maxVersion>1.0.0.*</em:maxVersion>
     </Description>
    </em:targetApplication>
  • The third step Alex describes on his blog is NOT necessary with WebRunner 0.7 (the extension manager is already on)

The Web Applications schould now be able to use Google Gears (Gears doesn’t tell anymore that the browser is not compatible, and the google javascript object is now available).

Unfortunately, WebRunner crashes as soon as the webapp uses Gears: “Error while loading gears.dll”. After some investigation, I found out that XulRunner wasn’t able to find some dlls (which are under the WebRunner\xulrunner directory). I copied them all into windows\system32, tried again, and now WebRunner crashes without error…

I told myself: “Hey, it’s Windows, it’s not the first time an app crashes without reason…”, and hurried to MacOS X. Since we cannot use the registry to tell WebRunner to load Gears, I put the gears extension directory into /Applications/WebRunner.app/Contents/Resources/extensions, and did the second step. However, WebRunner doesn’t seem to load the extension and gears tells us that our browser is not compatible. I also tried to put it in the profile/extensions directory of WebRunner, without success.

Conclusion: After one day of relentlessness work, I wasn’t able to make it work on Windows, neither on MacOS. I even tried with Gears v0.1.54.0 and v0.1.56.0 with the same results. Did it work for you ?

Gears in motion v0.1 released

Thursday, August 23rd, 2007

Gears In Motion is a user interface that allows you to manage easily your Google Gears databases for all your Google Gears projects.

It is distributed under BSD license.

Gears in Motion is written in javascript and uses Google Gears and the YAHOO! UI 2.2.0 library.

It is very easy to use and the functionalities implemented permits you to modify your database as you could do it on a spreadsheet :

  • inline editing : just click in a cell to modify it
  • add dynamically a new row
  • add dynamically a new column
  • right-click an element to display a context menu which allows you to :
    • delete dynamically an element of a table
    • view element details such as linked elements

You can also display in a table the result of a query you entered or export your database in the sql format to use your data in another database.