Showing posts with label Gears. Show all posts
Showing posts with label Gears. Show all posts

Sunday, 19 June 2011

Appcelerator gives you Gears functionality out of the box



Jeff Haynie announced that the latest Appcelerator SDK supports Gears.

First, for those that haven't heard of Appcelerator, it is an open source "RIA" development toolkit that focuses on rich clients talking to services on the backend. You can think of it somewhat as a Flex-like framework built with Open Web technology.

We are seeing an interesting trend. At first, frameworks would wrap Gears semantics in something that makes sense for their audience of developers, which is great.

Appcelerator though does something a little different. It uses Gears under the hood to make your existing Appcelerator based application a better user experience.

This is what they say:
With the next release of the SDK, Appcelerator's javascript servicebroker will now automagically (and transparently) switch to using a Gears-enabled servicebroker when talking to your service-backend. That means your application will perform faster because the AJAX communication between client and server (especially for apps using fast polling) will be out-of-process using Gears' worker pool.

You have to do nothing to enable this in your application. When you Appcelerator application loads, a small piece of code will check to see if Gears is enabled and will dynamically load the gears-enabled servicebroker code.
I am looking forward to seeing applications that use this in the wild.

In other news, they also wrote up a nice post on how you can use Appcelerator and App Engine in a very simple way.



Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Fly, Gears 0.3!



Well, that's it, Gears 0.3 has officially left the nest. Most users have now been updated to 0.3.24.0. If you haven't, you can update at gears.google.com.

It seemed like just yesterday we were announcing 0.2. But here we are again, with great new features like:
*Sniff* ... They grow up so fast.

As always, please let us know what you think of the new APIs, and what you think still needs work. Or better yet, join the project and send us a patch.

And don't worry about us, we'll be fine. We've got to focus on 0.4. Soon enough, it too will spread its wings.



Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Gears Sessions from Google I/O are now available to watch





We had a great time at Google I/O at the end of May, and there were plenty of Gears-related content. Fortunately, video cameras were at the ready, and all of the sessions have been published on YouTube.

I put together a playlist (embedded player above) of the Gears content which includes:Also, you may be interested in other Ajax related content such as:

GWT

General Ajax



Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Flexi-ng your muscles with Gears



When a lot of developers think about Flex, they often tie it to Flash and AIR, but you can of course integrate Flex applications with many other front-end services.

Mrinal Wadhwa has seen value in building Flex applications, and also likes functionality available in Gears.

He wrote up an article on enhancing Flex applications with Gears which had him create a sample application the uses the Desktop API in Gears.

It is interesting to take a look at the source to see how Flex applications tie back to plain old JavaScript.

For example, the following shows you how you put JavaScript into your Flex application, and then call back to the Flex code via thisMovie(APP_NAME).methodToCall:

// tells the swf if gears is installed
function isGearsInstalled() {
if (window.google && google.gears) { //gears is installed
thisMovie("FlexGears").testForGears(true);
return;
}
//gears is not installed
thisMovie("FlexGears").testForGears(false);
}


function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
// ....
Thanks to Mrinal Wadhwa for taking the time to try this all out. We enjoy seeing how people take Gears into many corners of the Web!

Also, you may not have seen QuickFix, an example application that shows how you can use Flex to talk to Google App Engine. The example is created by Dick Wall from App Engine, and James Ward from Adobe.



Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Speeding Up WordPress With Gears



WordPress.com just recently went live with Gears support for accelerating the user-interface, and the upcoming WordPress 2.6 release will also bundle Gears.

Andrew Ozz, a member of the WordPress team and the person responsible for the Gears integration wrote the following guest post on his experience working with Gears:

I thoroughly enjoyed working with Gears. After checking the excellent API documentation and examples, the test implementation of a ManagedResourceStore in WordPress was ready to go in about an hour.

After that I only had to refine the various status messages and user prompts and the first step of implementing Gears support in WordPress was ready for public testing. That was the fastest and easiest integration with another open source software I've had the opportunity to contribute to.

Currently WordPress implements Gears support in a somewhat "non-traditional" way. It uses only the local storage to cache all static files from the admin interface on the user's computer, eliminating needless requests to the server and improving page load speed, quite significantly in some cases.

Some of the limitations of this are that Gears prompts for permission on each sub-domain, so when a user has several blogs on WordPress.com, it will have to be enabled for each separately. Another is that although all files are served from the local storage in SSL mode, the browser reports that the web page is partially encrypted.

The Gears support is already live on WordPress.com, and is included in the next version of the self-hosted WordPress, that is due in a few days.


In my opinion Gears is more than an easy way to enable online applications to work offline. It extends the web browser into an OS independent application development platform. I won't be surprised to see some very different web enabled desktop applications built with it.




Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Creating a Client-Side Search Engine With Gears



I've posted an in-depth article and tutorial on creating a client-side search engine with Gears. Here's a short snippet from the article:

Did you know that you can use Gears to do fast, client-side searching of data, similar to a client-side search engine? Gears bundles Full-Text Search (FTS) abilities right into its local, SQLite database. MySpace, for example, uses this feature with their MySpace Mail application, downloading all of a user's messages for fast, client-side search. Because all of the data is local, you can do nifty things like search over the data in real-time as the user types, something that is much harder if you have to query over the network to a server to do the searching.

Would you like to add the same kind of fast, local searching to your own web page and web applications? This article introduces you to PubTools Search and the Gears features that power it, namely Full-Text Search and Workers. PubTools Search is an open source JavaScript library that drops a client-side search engine right into your page. You configure it with basic HTML plus a list of URLs to index. Once loaded, a search form that uses the local Gears full-text search abilities will appear in your page to quickly and locally search over the documents in real time as a user types into the search field.

Please note that PubTools Search is not an official Google project or Gears API; it is a project I created on my own to teach and help developers. The Gears team does not support this project.

The article covers the following:

  • An introduction to Gears' Full-Text Search and Worker features
  • How to drop PubTools Search into your page to quickly get going
  • Deep walkthrough and dissection of how PubTools Search works internally with source code and snippets so you can use these Gears features in your own applications
  • An introduction to parts of the Dojo toolkit used in PubTools Search, using actual source from PubTools Search including a discussion on some of the techniques used in modern JavaScript development
  • Tips and tricks when working with Gears

Read the full article and try the demo yourself!




Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Gears Best Practices

Have fun!



Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Gears 0.4 is here!



But where exactly is 'here'? Well, that's a question that takes on a whole new meaning with this new release of Gears: 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.

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.

Other major changes in Gears 0.4 include:

For the full list of changes, you can check out the Gears API history.

If you are a developer anxious to try these new APIs, first check gears.google.com to make sure you have Gears 0.4 installed (your browser should be updated automatically) and then browse the Gears documentation pages. If you are a mobile developer, please make sure you also read our Google Mobile blog post to learn more details about what devices support the Geolocation API.

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 work with the community on new Web standards.



Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU

Gears For Safari



We're really excited to announce the official release of Gears for Safari on OS X (minimum requirements are Leopard 10.5.3 or Tiger 10.4.11).

You can download it today from http://gears.google.com.

This means that you can now access all the Gears-enabled sites (such as Zoho office, WordPress, the new YouTube uploader and Google Docs offline) in Safari.

Since launch, we've increased the number of APIs available in Gears. The 0.3 release added the ability to create desktop shortcuts for websites, and the 0.4 release added Geolocation and Blobs (useful for resumable uploads of large files). All of these are now available in Safari and work exactly the same as on the other browsers Gears supports.

We thought it might be interesting to talk about some of the technical aspects of Gears peculiar to Safari and OS X. If you aren't a developer you can safely skip the following paragraphs and go straight to the download page.

When you install Gears, you'll notice that it's composed of 2 components: an NPAPI plugin which lives in "/Library/Internet Plugins" and an InputManager. Gears needs to load first thing upon browser startup, for cases in which the first page loaded into the browser is from the Gears offline cache. NPAPI provides no mechanism for loading that early (it only provides support for loading plugins the first time a page specifically includes them) so we needed a small InputManager to do the work for us.

For browsers other than Safari that use the WebKit engine, we've provided a really simple mechanism to allow them to load Gears into their program without using the InputManager. Fluid is one example of a 3rd party browser that supports Gears this way.

On the Mac, Gears desktop shortcuts are actually small applications that are designed to open the website in the same browser they were originally created from. This means that if you created them from a Fluid app they'll open in that same place and if you've got multiple versions of Firefox installed on your machine the shortcut will open in the right one.

We hope you've found this post interesting. If you have any feedback we'd love to hear from you on our mailing list.



Generated by BlogIt

BlogIt - Auto Blogging Software for YOU!

BlogIt - autoblogging software for YOU

BlogIt - autoblogging software for YOU