Posted by Ben Lisbakken, Gears TeamUsing 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!
Posted by Dion Almaer, Gears TeamMalte Ubl, who brought us xssinterface, has a new project that has Gears support.Joose is a self-hosting meta object system for JavaScript inspired by the Perl Moose. Joose supports inheritance, traits, mixins, method wrappers and more.Where Gears comes into the mix is through the Joose.Gears meta class which enables automatic delegation of methods to be executed as a Gears worker. If Gears is not present, the worker is executed in the main thread. The workers result will be sent to a method called "on".ucfirst($worker_name) if available:Class("HardWork", { meta: Joose.Gears, has: { data: {is: rw, init: {}} }, methods: { onDoWork: function (result) { ok(result == 1001, "Gear Worker returns correct result") } }, workers: { doWork: function (start) { var counter = start; for(var i = 0; i < 1000; i++) { counter++ } return counter } }})var hw = new HardWork();hw.doWork(1)You can take a peak at the innards to see another interesting use of Gears.
Posted by Dan Holevoet, Google Gadgets TeamI thought I'd let you all know about Google I/O, a developer event upcoming on the 28th and 29th of May at Moscone West in San Francisco. There are a lot of exciting opportunities at the event, including: breakout sessions, code labs, fireside chats, tech talks, and sessions that you, the developers, can hold yourselves.The talks will cover a variety of topics, many of which focus on gadget-related technology. Be sure not to miss "Apache Shindig: Make Your Social Site an OpenSocial Container" and the related code lab. The two discussions will focus on deploying OpenSocial applications, but Shindig can be used to serve gadgets on your site, social or not.For more information, check out the website: http://code.google.com/events/io.
Jadon reports:
A while back, I wrote-up a "Collaborative GreaseMonkey" patent disclosure. It was a defensive measure to make sure no one else patented the idea and prevented the rest of us from using it. The disclosure never made it past our patent committee, and I think that is fine, since it is at least documented as prior art in some way. The code never got to the point where it was worth sharing, but I do plan to revive it at some point.
I'm seeing that more and more people are starting to get ideas that are more and more similar to what I had in mind. Today, I read about someone dreaming up thoughts on using Google Gears to perform OpenID and OAuth. I like the thought pattern.
Gears, GreaseMonkey, OpenID, and P2PSockets (JXTA) have the potential to re-invent the web and to establish a real web operating system. Gears enables the JavaScript written into web pages to become part of a real, persistent application with persistent data storage and threads. GreaseMonkey provides a solution to edit existing web applications with user-controled, local customizations and to create applications fully local, without needing to learn how to write a web server application. OpenID gives a single solution for authenticating yourself across those web applications. P2PSockets allows the applications and data you host locally to be discovered on the web without needing to own a web server.
The result is an application building environment that is an incremental step from simple HTML+JavaScript editing and allows everyone to invent their own web, rather than just rely on the web that the social networking sites control today.
The success of this web is, of course, controlled by the economy it creates. An a-la-carte business model, like the one provided by Amazon's web services, is a great way to ensure that the bandwidth and data storage necessary for the locally-hosted services to scale.
Thoughts?
Posted by Nir Bar-Lev, Product Management Visualizations have always been a great way to display data and get insights. The sales graph always needs to go up, right? I’ve yet to see a boardroom with a table of data instead of interesting graphs. And of-course it’s not just about businesses and boardrooms, we all like to visualize our information. The problem is that many times it is hard to integrate the visual components with the data and application. It’s long and frustrating. Is this familiar? Well, today we've launched the Google Visualization API, which has a gadget extension that lets gadget developers develop amazing visual gadgets over an open API to structured data sources, the first of which being Google Spreadsheets. We’ve also added a discussion group just for this type of Visual Gadgets and the API extensions. We look forward to seeing great things from you using this new API.
Louis found a great Firefox add-on yesterday: gDocsBar, Google Docs Companion for Firefox. As soon as I read his message, I went straight to the gDocsBar website, browsed through for a few seconds and installed this extension.
gDocsBar comes into Firefox as an additional sidebar that allows you to manage your Docs but also gives you some functions that don't exist in the native web interface.
Now I've got one tab less and one more powerful set of functions. As you can guess, gDocsBar was not developed nor released by Google (who offers Google Docs) or Mozilla (Firefox's publishing foundation). It is indeed yet another example that third parties rapidly come as smart complements to global user-friendly platforms. As a matter of fact, it's the way Firefox is developed: a light, easy-to-use browser with minimal functions that you can customize without any other limit than... your screen's size and computer's resources! It aims at fitting the needs of 80% of its users without bugging them with unwanted complex tools.
So here is a short list of why I already love gDocsBar (which has already changed the way I work):
- Much quicker interaction than when using the web interface: you get anything you need in a snap!
- Exclusive functions:
- Templates (to make a couple of our clients happy!)
- Smart Folders
- Drag-and-Drop local files or even file groups to upload them directly to Google Docs
- Easy webclips (webpage parts) saving
Also see gDocsBar's blog and subscribe to its RSS feed to get the latest news about it! I just posted a comment to ask gDocsBar's developer(s) for a link to Google Apps Docs Home, not personal Docs Home.
Pay attention to the button that comes on the left of your address bar, which allows you to expand and collapse gDocsBar as often as you want. (or you can use the dedicated shortcut: see Display > Sidebar to get the right one).
Of course, this only works with Firefox, as this browser allows anyone to develop new integrated functions.
Thank you, gDocsBar !
Posted by Dion Almaer, Gears TeamMalte Ubl has written a small abstraction library called xssinterface that enables cross domain callbacks. The site specifies which methods may be called as well as which domains are allowed to call the methods.The library wraps the postMessage interface and our own cross domain workers. If those options aren't enough, there is a way to use a cookie trick to still get access.There is a generic Gears worker that Malte uses to wrap his API. If you haven't played with workers yet, you may find it interesting to see a full example.In it you will see usage of the database and even a timer:var timer = google.gears.factory.create('beta.timer');timer.setInterval(function() { // get a new db handle on each iteration var db = google.gears.factory.create('beta.database'); db.open('database-xssinterface'); db.execute("BEGIN TRANSACTION"); // find new messages for meps var rs = db.execute('select id, message from XSSMessageQueue where recipient_domain = ? and channel_id = ?', [recipient, channelId]); // there are new messages for the recipient while(rs.isValidRow()) { var id = rs.field(0); var text = rs.field(1); wp.sendMessage(text, message.sender); db.execute("DELETE from XSSMessageQueue where id = ?", [id]); // unqueue message rs.next() } rs.close(); db.execute("COMMIT") db.close();}, 300);xssinterface is a fairly alarming name, so I asked Malte why he would put "XSS" in the name of his product. It turns out he is trying to be lighthearted. Each to their own!
Posted by Brian Shih, Google Gadgets TeamOnce again, our very own Dann Lee stars in a great tutorial on building gadgets. In this video, you'll learn how to write a gadget step-by-step. We'll take one of our popular gadgets and show you how to build your own version from scratch. The gadget example uses various API features such as tabs, dynamic-height, and analytics. By the end of the video, you'll have a better understanding on how to create your own successful gadget in addition to learning key points about distribution. Have fun!As always, if you've got further questions, please drop by the group.
Posted by Dion Almaer, Gears TeamAptana Jaxer is a new product that allows you to write server side Ajax applications, and one of the features is a server side database API.As soon as I saw this, I started to play with an unofficial wrapper that would enable me to use the Gears Database API and have it work on the server.The Aptana team liked this idea, so they decided to implement the same result API as Gears uses, which enabled me to chop up my shim.I find this interesting as it can allow:
Converging on APIs makes me feel good in the same way that deleting code does. I hope to see more of this in the future. The fewer the APIs that a developer has to learn, the better.
We on the Reader team are delighted to have a guest post today from Google usability expert T.V. Raman, who has announced on the Google Blog that Reader now supports ARIA-powered screenreading. Our thanks go out to T.V. and to Charles Chen, fellow Googler and creator of FireVox, for their work in enabling more people than ever to benefit from Reader. Here's T.V.'s post on how to get started:
ARIA For Google Reader: In Praise Of Timely Information Access!
Here are instructions on how to set up fluent spoken feedback from screenreaders and self-voicing browsers when using Google Reader.
Spoken output support in Google Reader is implemented using Accessible Rich Internet Applications (WAI-ARIA), an evolving standard for enhancing the accessibility of Web-2.0 applications. WAI-ARIA is supported at present by Firefox --- with future support forthcoming in other browsers. ARIA support in Google Reader has been tested in the following environments:
Note that Firefox 3 is still in Beta and that ARIA support like the underlying standard is still in development. ARIA support in Google Reader is designed to help end-users experience the benefits of a powerful Web-2.0 application, while giving browser implementors and adaptive technology vendors a real-world application on which to test their implementations.
Activating ARIA Support In Google Reader
When you first open Google Reader using a screenreader, you will hear an invisible link labeled click here for ARIA enhanced Google Reader. Follow this link to activate ARIA support. You can bookmark the resulting page for future use.
Once on the ARIA-enabled Google Reader, press ? to hear a list of available keyboard commands. Power users note: most of these keyboard commands are available in the default version of Google Reader.
Please send all feedback to Google Group Accessible.