Activate your free membership today | Log-in

Tuesday, January 8th, 2008

Buxfer: Another Personal Finance 2.0 Site

Category: Gears, Prototype, Showcase

Buxfer is another personal finance site, a la Mint.

Todd Ritter reports:

Buxfer has a few interesting features that differentiate it from the others. While it offers auto-syncing of transaction information with your banks and credit cards, budgeting, and expense analysis, Buxfer also has three key characteristics:

  1. Shared Finances - Buxfer allows you to create groups and assign specific finances to those groups to monitor who owes or receives money. For example, you could create a “Cable Bill” group and assign yourself and your roommates to the group to track who has forked over the cash for the Super Deluxe Sports Package.
  2. Google Gears - By using Buxfer’s Google Gears support, you can keep all of your private financial data on your own computer, instead of Buxfer’s servers. The other personal finance sites store your information on their servers, thus out of your control.
  3. Mobile Access - Buxfer has a mobile phone interface and an iPhone-specific interface for accessing your account remotely. You can also use Twitter or SMS to get account balances or to be notified of low balances, large withdrawals, etc.

Buxfer uses a perverted Prototype, and looks fairly Gmail-y with the top right red ‘Loading…’ and such. It looks nice.

Buxfer

Posted by Dion Almaer at 8:04 am
8 Comments

+++--
3.7 rating from 22 votes

Wednesday, January 2nd, 2008

Google Gears Future APIs

Category: Editorial, Gears, Google, JavaScript

Gears Monster

Over on my personal blog I kicked off a series of articles on some future APIs that are on the table for Gears, and how in my opinion, Gears is mistakenly seen to be about "offline", when that is just the surface.

I started off by discussing the Image Manipulation API, "is a module to give Javascript a way to resize, crop and compose images together on the client side. This will allow, for example, images to be resized into a web-friendly format before being uploaded to a photo album. Another use is for composition of images together as an efficient alternative to server-side composition or CSS layering. Yet another use is for basic photo editing - a user can edit a photo with instantly applied changes before uploading it to the server."

Then I went on to the Desktop Shortcut API where you can:

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

The Location API provides a means to fetch the location of a device running a Web browser with Gears:

The Location API is an abstraction for the various LBS APIs that currently exist on mobile platforms (GPS-based, network/cellid-based). The API consists of the Location class, which encapsulates various location attributes (latitude, longitude, etc), and also provides the means to query the platform for a location fix. This API also adds a new event type that is fired every time the location changes. Location implementations can be straightforward mappings to native LBS APIs (e.g the S60 Location Acquisition API) or have a more complex design that combines several location providers (e.g a GPS-based provider and a cell id-based provider) and returns the location from the most accurate provider at any given time.

The Messaging API fits in with the current WorkerPool API to give you cross domain rich messaging:

JAVASCRIPT:
  1.  
  2. var port = google.gears.factory.create('beta.messageport', '1.0');
  3. port.onmessage = function(port, msg, sender) {
  4.   alert("message: " + msg);
  5. };
  6. port.listen("name");   // Omit for anonymous listener.
  7.  
  8. // and having a way to send it a message:
  9.  
  10. var port = google.gears.factory.create('beta.messageport', '1.0');
  11. port.open("name");
  12. port.sendMessage("hello there");
  13.  

There there were smaller fry such as a Logging API, the Blob API, and Factory API updates.

To finish off we have the issue of developer tools. We need to make sure developers have the tools they need to enable successful app development using the APIs, so we want to first add:

  • Database
  • List databases per origin
  • Create new
  • Delete
  • Interactive DB command line (can just use existing /sdk/tools/dbquery.html)
  • LocalServer
    • List ResourceStores (and ManagedResourceStores) per origin
    • ResourceStore and ManagedResourceStore status (last error, update history, etc)
    • command line (like db command line, but pointed at localserver DBs)
  • WorkerPool
    • Show running workers
    • Interactive JS prompt to run JS inside a worker
    • Interactive prompt to send messages to a worker
  • Logging (requires LoggingModule)
    • Show logging in real time as it happens
    • Show historical logging
    • Sort/filter by origin/page of source page

    I would love to see what you would like to see, and these thoughts will be the subject of future posts.

    Posted by Dion Almaer at 8:32 am
    Comment here

    +++--
    3.4 rating from 32 votes

    Thursday, December 27th, 2007

    Interviewed on GWT, Gears, Java, and JavaScript

    Category: Ajax, GWT, Gears, Google, Interview, Java, JavaScript

    Reposted from my blog.

    I had the pleasure of finally meeting Didier Girard. I seem to run across Didier's work every week or so, but for some reason we haven't had a chance to meet face to face, until JavaPolis.

    Didier sat down with me to talk about GWT, Gears, Java, and JavaScript, and I gave my honest opinions.

    You can listen to my ramblings below. Let me know if you have any thoughts on opinions!

    Posted by Dion Almaer at 7:48 am
    Comment here

    +++--
    3.9 rating from 26 votes

    Monday, November 26th, 2007

    Zoho Writer Offline with Editing

    Category: Gears, Offline, Showcase

    Zoho Writer was quick to release offline support using Gears, which allows you to carry read-only views of your data around when you were offline.

    This was just the first step in their offline support, and now they have announced the next step. This new version allows you to edit on the road with a synchronization system that keeps you sane:

    Zoho Writer Offline Editing

    Posted by Dion Almaer at 8:00 am
    3 Comments

    +++--
    3.4 rating from 18 votes

    Wednesday, November 21st, 2007

    Wikipedia Offline with GearsMonkey

    Category: Articles, Gears, Google, Offline, Showcase

    Working on the Gears team we also run across applications that we would love to take offline. A lot of these applications aren't Google's so we thought it would be nice to be able to take third party apps offline. This also makes sense since Aaron Boodman (Mr. Greasemonkey) is co-tech lead on Gears itself!

    Ben Lisbakken has written up his work taking Gears and Greasemonkey to make this happen. He details the real example of taking Wikipedia offline which has once piece of narly code to do with iframe injection to be able to store data on third party sites (e.g. media site vs. wikipedia main site):

    1. Initialize Gears on page
      • Check if site has been allowed, if not, trigger allow dialog
    2. Insert iFrame
    3. Initialize Gears on iFrame
      • Check if site has been allowed, if not, trigger allow dialog
    4. If Gears is initialized on both, insert Cache Page link (unless page is cached)
    5. When user clicks Cache Page:
      • Capture the HTML and CSS of the Main Page
      • Store the URLs of all links to HTML, CSS, and media files in the Gears database (so we can remove them from the ResourceStore later, if needed)
      • Create an iFrame whose src is in the domain of upload.wikimedia.org. Pass all media file URLs to the iFrame in the src URL after the hash, e.g. src="http://upload.wikimedia.org/#thisimgloc.jpg||anotherimgloc.jpg||lastimgloc.jpg"
      • Initialize Gears in iFrame
      • Capture all URLs from the iFrame's href hash.
    6. When user clicks [x] to remove an article from cache:
      • Grab all URLs from the Gears database that correspond to that article
      • Remove all URLs from the ResourceStore of the Main Page that contain the string "en.wikipedia.org"
      • Remove all URLs from the Gears database that correspond to that article
      • Create an iFrame whose src is in the domain of upload.wikimedia.org. Pass all media file URLs to the iFrame in the src URL after the hash, e.g. src="http://upload.wikimedia.org/#thisimgloc.jpg||anotherimgloc.jpg||lastimgloc.jpg||remove||"
      • Initialize Gears in iFrame
      • Remove all URLs from the ResourceStore that are listed in the iFrame's href hash.

    Here's the script in action as I save pages away. This is just the beginning. Ideally we would have the code automatically save content that you have been too, and do smart spidering to get more on the subject too. We will also work on making GearsMonkey scripts even easier to write.

    Posted by Dion Almaer at 9:24 am
    12 Comments

    +++--
    3.4 rating from 264 votes

    Wednesday, November 7th, 2007

    Mindmeister: Take your mind map offline

    Category: Gears, Offline, Showcase

    Mindmeister has taken their mind map tool and now allow you to map offline.

    The tool itself is a nice Ruby on Rails application (includes pink fade effects! yellow is so 2006) that gives you a visual canvas to play with your mind.

    Mindmeister Tool

    Their approach to offline is similar to Google Reader in that the user has to say "hey, take me offline". The interface to that is a nice little slider widget. At the point your maps are sync'd down to the local store.

    Mindmeister Sync

    I would love to see it auto sync, and I noticed a couple of issues when I actually went offline but didn't tell the tool first (would be nice to have the tool grok that) but the mind map tool in general is a nice app to use. It feels like Geni.

    Posted by Dion Almaer at 12:52 pm
    5 Comments

    ++++-
    4 rating from 21 votes

    Friday, October 26th, 2007

    Running CPU Intensive JavaScript Computations in a Web Browser

    Category: Gears, JavaScript

    Julien Lecomte has written up the pattern where you use setTimeout() to keep yielding control back to the main thread so that it can handle browser events.

    Completion Callback

    JAVASCRIPT:
    1.  
    2. function doSomething (callbackFn [, additional arguments]) {
    3.     // Initialize a few things here...
    4.     (function () {
    5.         // Do a little bit of work here...
    6.         if (termination condition) {
    7.             // We are done
    8.             callbackFn();
    9.         } else {
    10.             // Process next chunk
    11.             setTimeout(arguments.callee, 0);
    12.         }
    13.     })();
    14. }
    15.  

    Progress Callback

    JAVASCRIPT:
    1.  
    2. function doSomething (progressFn [, additional arguments]) {
    3.     // Initialize a few things here...
    4.     (function () {
    5.         // Do a little bit of work here...
    6.         if (continuation condition) {
    7.             // Inform the application of the progress
    8.             progressFn(value, total);
    9.             // Process next chunk
    10.             setTimeout(arguments.callee, 0);
    11.         }
    12.     })();
    13. }
    14.  

    Of course, the Gears Workerpool does this the right way, giving you the ability to pass messages to another process to get the work done in a secure sandbox.

    As a band-aid it could be nice to have an abstraction library that uses WorkerPool if Gears is installed, if not, try to use setTimeout (which is harder to do as you need to cut up the work differently).

    Posted by Dion Almaer at 7:21 am
    10 Comments

    ++++-
    4.4 rating from 66 votes

    Wednesday, October 24th, 2007

    HTML5 Wrapper for Gears Database Component

    Category: Gears, HTML

    Dimitri Glazkov took a look at the HTML 5 SQL Storage API which WebKit just implemented and put together a Gears wrapper.

    As an example he has Stickies running on Firefox with Gears.

    The bridge is very simple indeed. Just take a peek at the code.

    The major note here is that the current draft HTML 5 spec has the SQL API as an asynchronous one, whereas Gears has a synchronous API. In my experience, people prefer synchronous here, and Adobe AIR has a new synchronous API that they just released with the latest beta. I would love to see the HTML 5 spec contain a synchronous version too.

    Posted by Dion Almaer at 8:49 am
    3 Comments

    +++--
    3 rating from 14 votes

    Friday, October 19th, 2007

    Blog.gears: An offline Blogger client using the new GData Blogger JavaScript Client

    Category: Examples, Gears, Google, JavaScript, Screencast, Showcase

    I was excited when Google announced their first JavaScript API that allows you to write back to a service.

    Now, they have released a Blogger client that does the same, which means that you can now manipulate your blog posts directly from JavaScript.

    Along with the release there are a few examples such as:

    • A tool that takes your upcoming Calendar entries and creates blog posts of the events
    • A code snippet that you can add to your website that enables visitors to your site to click on a link to comment on your content on their own blog
    • Code that allows you to search blogs on various topics, find entries, and again allow users to comment on their own blog

    And finally, Blog.gears, an offline blog editor:

    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?

    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.

    Posted by Dion Almaer at 5:37 pm
    2 Comments

    ++++-
    4.3 rating from 18 votes

    Gears in Motion: Database Tool

    Category: Gears, Utility

    Eric Abouaf has released Gears in Motion, a tool that allows you to quickly and easily look at your local SQLite database, and make edits on the fly.

    You can make schema changes, data chances, and see the entire flow of relationships. It even groks URLs so if you put a JPG in the database, it will just show it to you as you look at the data.

    See a running example.

    Gears in Motion

    Posted by Dion Almaer at 1:34 pm
    4 Comments

    +----
    1.7 rating from 378 votes

    Thursday, September 27th, 2007

    Vortex: A new offline abstraction on top of Google Gears

    Category: Gears, Google, JavaScript, Library, Offline

    Brian Dunnington liked what he saw with the Dojo Offline Toolkit, and wanted to abstract it out so you could use functionality with any JavaScript library.

    He ended up with a new library called Vortex, a 10k JavaScript file that features:

    • Ability to automatically detect referenced resources such as images, scripts, and stylesheets (including nested @imported stylesheets)
    • Automatic detection of network state with corresponding UI/feature changes (also implements .isOnline() and .isOffline() methods)
    • Auto syncing of events. it essentially records any user-defined actions and automatically plays them back when the network comes back online
    • A generic storage provider to quickly and easily save javascript objects (JSON-encoded)
    • Graceful fallback if no offline support is available (google gears not installed or not allowed to run)
    • Library-independent (does not require dojo, prototype, Ext, YUI, etc) and cross-browser compatible

    He has a simple RSS demo that shows the library at work.

    I took it for a spin and went online and offline to see how it automatically detects. Also in the video below I take a peek at the code and we see what the definition of "online" means (able to XHR a particular file).

    Posted by Dion Almaer at 12:06 pm
    9 Comments

    +++--
    3.9 rating from 16 votes

    Friday, September 14th, 2007

    The Digg Oracle: Data mining on the client

    Category: Gears, JavaScript, Showcase

    Brian Shaler noticed that almost a year ago, Digg removed the "search your own
    Diggs" feature, to the dismay of thousands of Digg users. To explain
    why the feature had not yet returned, they cited hardware and software
    solutions as being very complicated and expensive.

    Brian decided to re-implement the feature himself using the Digg APIs, and we end up with The Digg Oracle:

    Because the dataset is relatively small and user-specific, performing
    tasks like searching/filtering and sorting can easily be done on the
    client, using Google Gears. The tool downloads the selected user's
    entire voting history, indexes the stories in the local DB, then does
    all the sorting/searching without connecting to Digg's servers.

    Here we see an original query, and the application starts to download the users usage data:

    Digg Oracle Loading

    When the data is loaded, searching and filtering the data is extremely fast, even if you use Kevin Rose as your sample :) This is a great non-offline example of using the database and workerpool components.

    Posted by Dion Almaer at 8:48 am
    2 Comments

    +++--
    3.2 rating from 14 votes

    Tuesday, September 11th, 2007

    Sybase Shows Auto Change Tracking and Syncing with Google Gears and iAnywhere

    Category: Gears, Google, Offline

    Eric Farrar of Sybase iAnywhere has been developing a prototype that allows direct database-to-database synchronization of a Gears application to Oracle, SQL Server, DB2 and Sybase databases. We asked Eric about his work and he told us:

    At Sybase iAnywhere we provide a data sync infrastructure for mobile and remote apps. The Background Sync architecture mentioned on the Gears site is a lot like mobile application architectures we see all the time. As a result, it seems as though the same mobile sync technology can be used to solve the offline sync problem for Google Gears.

    This prototype uses a local lightweight database (based on the iAnywhere UltraLite database) with built-in synchronization
    capabilities, meaning:

    • Built in change tracking, so that changes (including deletes and updates) can be sent to the server,
    • Built in state tracking, so that the local database knows when synchronizations succeed and can take appropriate clean-up operations automatically,
    • Built in synchronization over TCP/IP or HTTP.
    • Optional encryption of the data store and of the sync stream
    • Somewhat stricter data management model than SQLite.

    The other piece is the sync server that manages synchronization to Oracle, SQL Server, IBM DB2 and Sybase databases. The sync technology is fully transactional, meaning data does not get partially changed at either end. It also has automatic mechanisms to detect conflicts and hooks that allow users to programmatically handle the conflicts using SQL, .NET, or Java.

    As far as scalability, these technologies are currently being used in projects that involve nearly half a million mobile devices.

    Eric also recorded some videos show this all in action:

    Google Gears Prototype with Auto Change Tracking and Syncing (3 min 13 sec)

    Prototype of Google Gears Database Syncing with Oracle (3 min 16 sec):

    Posted by Dion Almaer at 7:38 am
    2 Comments

    ++++-
    4.3 rating from 11 votes

    Wednesday, September 5th, 2007

    Gears Case Study: What we learned from Remember The Milk

    Category: Articles, Gears, Google, Offline, Showcase

    As I posted on the Google Gears Blog:

    Omar Kilani of Remember The Milk took the time to write up his teams experience in Taking web applications offline with Google Gears.

    The article moves past an introduction to delve into the design decisions around an offline-capable architecture, and user messaging and presentation of state. We learn why Omar decided to go with the explicit offline mode, and then the five steps to offline conversion:

    • Ensuring resources are available offline
    • Decoupling the application from the network
    • Persisting data on the client
    • Re-creating application state from persisted data
    • Developing a synchronization strategy.
    • There is a lot to learn here.

      From their architecture considerations:

      RTM was designed as a client-side application from inception. The server-side portion of RTM is mainly used as a "dumb" data store, and the application periodically synchronizes with the server. In this case, using Gears to provide offline access was a natural fit, and was relatively quick to implement as we had some prior experience with data synchronization protocols.

      There were some features of the online experience that could not be carried over to the offline mode. One of these was the Google Maps integration, in which users can geolocate their tasks and quickly visualize where their tasks are occurring in the real world. As Google Maps requires access to Google servers to fetch map tiles and data, and such a data set is quite large and thus hard to cache, this functionality is disabled once the user enters offline mode.

      The undo feature of RTM is also unavailable in the offline version as this is a complex server-side operation (due to the multi-user nature of RTM and the ability to share tasks and lists). Instead, the user is presented with a dialog box asking for confirmation if they execute a destructive action such as delete. Undo functionality in offline mode is on the RTM roadmap, however.

      To the decisions they made on showing the user information on whether they are online or offline:

      A fundamental design decision is whether to implement offline support as "modal" or "modeless." Choosing which style to implement will, in most cases, be dictated by the type of data the application works with and how much of that data will be available offline. One style is not necessarily superior to the other, and, for example, it's much easier to implement a modeless style for tasks (in RTM) than it is for feed items (in Google Reader) based on the size of data items and the total data set alone.

      Finally, we learn some tips and caveats from the RTM Gears implementation, including dealing with the LocalServer, the different types of offline, defensive coding, debugging, and coding with upgrades in mind.

      Omar Kilani wraps it up in his conclusion:

      By now, you should be itching to add offline support to your web application (we hope!). If you should take anything away from this article, it's that taking your application offline isn't as hard or complex as it may first seem, and that Gears is a joy to work with (and it'll become even easier and more fun as the project matures and is used by more applications).

      As for us at RTM, we couldn't be happier with Gears. The speed at which we were able to provide offline functionality (four days from reading the documentation to a launchable implementation) is a testament to the quality, ease of use, and production-readiness of Gears. Many thanks to the Google Gears engineers for their foresight and for making this an open source project to which members of the Internet community can contribute.

      Thanks to the Remember The Milk team for taking their application offline in record speed, and for taking the time to share their experience.

    Posted by Dion Almaer at 9:15 am
    5 Comments

    ++++-
    4.5 rating from 15 votes

    Friday, August 31st, 2007

    TrimPath Junction: A walk through

    Category: Articles, Gears, JavaScript

    Jack Herrington and Steve Yen have put together a nice little article introducing TrimPath Junction:

    Junction is an all JavaScript framework that closely models the Ruby on Rails model-view-controller design pattern and implementation. And with the help of the Helma JavaScript web server, it runs the same code both on the client and on the server. Exactly the same code, in fact.

    The framework not only handles the basics of rendering pages (using JavaScript templating), but it also handles data and code synchronization with the server, local client caching using Google Gears, model versioning, and much more. It's an amazingly complete solution for an entirely new model of web development.

    The article walks through the building of a very simple contact management system, and shows that ONLamp doesn't believe in Long Pages ;)

    Posted by Dion Almaer at 5:45 am
    4 Comments

    ++++-
    4.3 rating from 9 votes

    Thursday, August 30th, 2007

    Google Gears 0.2 Developer Release

    Category: Gears, Google

    The Gears team has rev'd a new version aimed at developers. This release isn't going to propagate to end-user machines yet, as we want to time to hear from the community on the new features and APIs. Speaking of which...

    What's new?

    Cross Origin API

    Until now, there was no way to talk past the strict same-origin security model (same protocol, same exact domain, same port). Sometimes in the real world you need to mashup data, or even talk from www.foo.com to static.foo.com. Now you can do this with a simple API that adds to WorkerPool:

    JAVASCRIPT:
    1.  
    2. int  createWorker(fullScript)
    3. int  createWorkerFromUrl(scriptUrl) // NEW METHOD
    4. void allowCrossOrigin()             // NEW METHOD
    5. void sendMessage(messageString, destWorkerId)
    6. [write] callback onmessage(messageText, senderId, [object:{text,sender,origin}]) // NEW 3RD PARAM
    7.  

    Example

    Assume mash-up.com wants to read and write tasks managed by task-list.com.

    1. task-list.com hosts workerpool-service.js, which it expects to be loaded by another origin. That .js code uses:
      • LocalServer to make itself and any required resources available offline.
      • WorkerPool to respond to sendMessage() commands like "getAllTasks"
    2. mash-up.com calls createWorkerFromUrl() with the workerpool-service.js URL.
    3. The worker can access tast-list.com resources, as it runs in that origin.
    4. When mash-up.com calls sendMessage('getAllTasks'), task-list.com reads the database associated with task-list.com and returns the tasks.
      • Note that because only task-list.com directly accesses the database, the schema can change without requiring changes to mash-up.com.

    Read more of the details.

    New HttpRequest API

    Workers live in their own world (by design) but what if you need a worker to grab some content. You don't have access to XHR, but now you can use the new HttpRequest module that mimics XHR with a couple of differences.

    New Timer API

    The Timer module implements the WhatWG Timer specification, and makes it available in both workers and the main HTML page. This is the same timer API that is traditionally available in browsers on the window object.

    HTML:
    1.  
    2. <script type="text/javascript" src="gears_init.js"></script>
    3. <script type="text/javascript">
    4. var timer = google.gears.factory.create("beta.timer", "1.0");
    5. timer.setTimeout(function() { alert("Hello, from the future!"); }, 1000);
    6. </script>
    7.  

    I got to chat with Chris Prince, an engineer on Gears, about the new release:

    Let us know your thoughts. What would you like to see? If you could create a mythical Gear, what would it do? :)

    Posted by Dion Almaer at 8:40 am
    2 Comments

    ++++-
    4.7 rating from 88 votes

    « Previous PageNext Page »