Friday, August 22nd, 2008

Gears 0.4 + Mashup of Gears and Google App Engine

Category: Announcements, Gears, Screencast

Hi folks, this is my first guest blog post here on Ajaxian. It’s great to join the team.

Gears, the open source browser plugin that teaches web browsers new tricks, has pushed out a new 0.4 release

Andrei Popescu from the Gears team lets us in on some of the nifty new features:

We have added a new Geolocation API, which allows you to build applications that can do new and exciting things based on your users’ location. You can query Gears for the user’s current location using the getCurrentPosition() method or you can ask Gears to notify you every time the location changes, using the watchPosition() method. Of course, we take privacy issues very seriously, which is why we have a special permission dialog that allows users to decide which Web sites should have access to their location information. If you want to learn more about how the Geolocation API works, please see the Google Code blog post.

In addition, Gears now makes uploading large and multiple files on the web much easier, giving you the primitives to roll a resumable uploader, which means hopefully we can see custom desktop uploaders go away soon. In addition, Gears 0.4 introduces a new thing called Blobs:

Another cool new feature is the Blob API. Unlike strings, blobs let you reference arbitrary binary data — a first for JavaScript! Therefore, blobs can more naturally represent things like files and images, and they can be passed around efficiently. We have updated several existing APIs to work with blobs, such as WorkerPool sendMessage() and HttpRequest send(). And that’s not all! We have also extended the Desktop API with a new method, openFiles(), which allows users to select multiple files of a particular content type, and then returns them as blobs for easy uploading or worker processing.

As a final note, Gears is continuing to push new features and experiments like the Geolocation API into the standards process:

Finally, an update on how we are doing on Web standards: in line with our earlier promises, the Geolocation API is a W3C Editor’s draft and its current design is a result of open collaboration with many other people and organizations. We plan to continue to drive this standardization effort, as well as work with the community on new Web standards.

I decided to give the new Gears 0.4 APIs a roll to illustrate how powerful they are when put together, mashing them up to create a sample application. In addition, I needed a server-side implementation, so I created a Python server-side that runs on Google App Engine. This mashup is named Upload Movie Tool (not the most creative name, I know ;)

This demo allows you to select multiple movies, and then upload them in a resumable way with feedback using the Gears Blob and File System API. We also use the Geolocation API to figure out what your location is for tagging the video, and the Google App Engine to store everything on the back-end.

Give the demo a try yourself, or check out its source code (see the client JavaScript and the Google App Engine Python). This code is open source so you can feel free to use it as the basis of your own Gears-based resumable uploader/geolocation app.

I put together a screencast where I run through the application. There is a bonus if you make it all the way to the end, with videos showing Dion and I using the new slide that was installed last week in the Google San Francisco office!

Disclosure: I work for Google

Posted by Brad Neuberg at 9:50 am
Comment here

4.2 rating from 18 votes

Comments Here »

Comments feed TrackBack URI

Leave a comment

You must be logged in to post a comment.