Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Gears Screencast: An Introductory Tutorial




Using a JavaScript API to cache web pages offline, interact with a client side database and introduce threading into your application isn't immediately intuitive because it's such a foreign concept for a web API. I remember when I was doing my first work with Gears -- I was a bit disoriented and in need of a walk through of how things work and why.

To help potential Gears users that feel like my 7-month-ago-self, I wrote a tutorial application that uses a minimal amount of non-Gears code. This application is a simple stock ticker that makes use of 5 of the Gears modules; LocalServer, Database, WorkerPool, Timer, and HTTPRequest.

But a standalone application can't teach someone -- it needs some explaining. Long articles generally lose my attention, so my media of choice was video. I made a screen cast where I walk through the code in three steps, which you can find here. There's also a zip file that contains the three steps of code so you can take a look at the code on your own. Please note that there is a PHP file that is required for the application to work, so you will need a server that runs PHP in order to use this code on your own!

Blog.gears: An offline Blogger client




I tend to write a fair share of blog posts, and whenever I am writing them while offline I tend to open up Textmate to do the write-up. Wouldn't it be nice if I could open up my blog editor and do it all while I am offline?

We thought that this would be a useful example to tie together Blogger and the newly released Blogger GData JavaScript library to create an offline Blog editor, Blog.gears.

The architecture behind the editor follows the pattern of:

  • The UI looks to the local DB for data
  • When an event happens it gets queued
  • When an event happens the UI tries to send it to the cloud
  • Events have status flags to let the system know what is happening




We interviewed Pamela Fox about the application, and she went through the architecture at a high level, and also did a screencast of the application itself.