Google
What is it? Google quote “Gears is an open source project that enables more powerful web applications, by adding new features to web browsers.”
Gears Application Application that passes javascript calls to the OS Written in java. http://code.google.com/p/gears/ Bsd license
Google client gears_init.js Supports: Android, chrome, firefox, safari, ie, opera 1.5 years old Wifi-based geo-location october/2008 Safari support september/2008 http://code.google.com/apis/gears/ Wordpress, zoho, gmail
Google’s self proclaimed features LocalServer LocalServer Cache and serve application resources (HTML, JavaScript, images, etc.) locally Database Database Store data locally in a fully-searchable relational database WorkerPool  WorkerPool Make your web applications more responsive by performing resource-intensive operations asynchronously
Getting started <script src=&quot;gears_init.js&quot;></script> <script> if (!window.google || !google.gears) { location.href = &quot;http://gears.google.com/?action=install&message=<your welcome message>&quot; + &quot;&return=<your website url>&quot;; } </script>
Parameters action: Enables applications to customize the Gears install page to provide context during the installation process. There are two allowed values: install or upgrade. Use the install value to prompt the user to install Gears. Use the upgrade parameter if you detect that the version of Gears the user has installed is too old for your application (but note that Gears autodates itself, so typically the vast majority of users all have the latest version). Either of these values enable the rest of the customization parameters. icon_src: Provide the URL to a 48x48 icon for your application. The icon can be any format displayable by web browsers. name: Provide the name of your application. This value can be up to 150 characters in length. message: Provide any text up to 150 characters. This message appears at the top of the installation page. For example: &quot;Install Gears to enable MyGreatApp's offline features!&quot; return: Provide your application's URL. The user will be directed back to this URL when installation is complete.
Offline mode Google gears allow the user to store copies of the website files locally. Javascript Html Pictures Even renderings of server side code.
How it works Json file Initiate localserver. Create a store. Add to the store by version. Updates are completed via version number. Discussion point - cache
Dynamic Ok, getting index is cool. But nothing is dynamic. SQLite!
No data Layer
SqlLite data layer
More options = more work.
The perfect solutions
Main supported classes beta.database  Database beta.desktop  Desktop beta.geolocation  Geolocation beta.httprequest  HttpRequest beta.localserver  LocalServer beta.timer  Timer beta.workerpool  WorkerPool
beta.database  Database var db = google.gears.factory.create('beta.database'); db.open('database-test'); db.execute('create table if not exists Test' +  ' (Phrase text, Timestamp int)');
Desktop var desktop = google.gears.factory.create('beta.desktop'); desktop.createShortcut('Test Application', 'http://example.com/index.html', {'128x128': 'http://example.com/icon128x128.png', '48x48': 'http://example.com/icon48x48.png', '32x32': 'http://example.com/icon32x32.png', '16x16': 'http://example.com/icon16x16.png'}, 'An application at  http://example.com/index.html '); Files upload
GeoLocation var geo = google.gears.factory.create('beta.geolocation'); Read only
HttpRequest var request = google.gears.factory.create('beta.httprequest'); request.open('GET', '/index.html'); request.onreadystatechange = function() { if (request.readyState == 4) { console.write(request.responseText); } }; request.send(); Basically created specifically for the worker pool because it cant use the XmlHttpRequest.
Worker pool The WorkerPool API runs operations in the background, without blocking the UI. Scripts executing in the WorkerPool will not trigger the browser's &quot;unresponsive script&quot; dialog.
Worker pool declaration var workerPool = google.gears.factory.create('beta.workerpool'); var childWorkerId = workerPool.createWorkerFromUrl('worker.js');
isolation Collection of processes, not threads. No inheritance, no variable sharing, no share namespace Interact via message objects
limitations No DOM access Document window Most other functions are supported
Usage patern create a WorkerPool (wp) Indicate where messages will go (wp.onmessage) Create worker wp.createWorkerFromUrl() Function returns immediately, parent continues too run.
State No new blog post in the last 6 months Api documentation missing. Very interesting market change ?

Google Gears

  • 1.
  • 2.
    What is it?Google quote “Gears is an open source project that enables more powerful web applications, by adding new features to web browsers.”
  • 3.
    Gears Application Applicationthat passes javascript calls to the OS Written in java. http://code.google.com/p/gears/ Bsd license
  • 4.
    Google client gears_init.jsSupports: Android, chrome, firefox, safari, ie, opera 1.5 years old Wifi-based geo-location october/2008 Safari support september/2008 http://code.google.com/apis/gears/ Wordpress, zoho, gmail
  • 5.
    Google’s self proclaimedfeatures LocalServer LocalServer Cache and serve application resources (HTML, JavaScript, images, etc.) locally Database Database Store data locally in a fully-searchable relational database WorkerPool WorkerPool Make your web applications more responsive by performing resource-intensive operations asynchronously
  • 6.
    Getting started <scriptsrc=&quot;gears_init.js&quot;></script> <script> if (!window.google || !google.gears) { location.href = &quot;http://gears.google.com/?action=install&message=<your welcome message>&quot; + &quot;&return=<your website url>&quot;; } </script>
  • 7.
    Parameters action: Enablesapplications to customize the Gears install page to provide context during the installation process. There are two allowed values: install or upgrade. Use the install value to prompt the user to install Gears. Use the upgrade parameter if you detect that the version of Gears the user has installed is too old for your application (but note that Gears autodates itself, so typically the vast majority of users all have the latest version). Either of these values enable the rest of the customization parameters. icon_src: Provide the URL to a 48x48 icon for your application. The icon can be any format displayable by web browsers. name: Provide the name of your application. This value can be up to 150 characters in length. message: Provide any text up to 150 characters. This message appears at the top of the installation page. For example: &quot;Install Gears to enable MyGreatApp's offline features!&quot; return: Provide your application's URL. The user will be directed back to this URL when installation is complete.
  • 8.
    Offline mode Googlegears allow the user to store copies of the website files locally. Javascript Html Pictures Even renderings of server side code.
  • 9.
    How it worksJson file Initiate localserver. Create a store. Add to the store by version. Updates are completed via version number. Discussion point - cache
  • 10.
    Dynamic Ok, gettingindex is cool. But nothing is dynamic. SQLite!
  • 11.
  • 12.
  • 13.
    More options =more work.
  • 14.
  • 15.
    Main supported classesbeta.database Database beta.desktop Desktop beta.geolocation Geolocation beta.httprequest HttpRequest beta.localserver LocalServer beta.timer Timer beta.workerpool WorkerPool
  • 16.
    beta.database Databasevar db = google.gears.factory.create('beta.database'); db.open('database-test'); db.execute('create table if not exists Test' + ' (Phrase text, Timestamp int)');
  • 17.
    Desktop var desktop= google.gears.factory.create('beta.desktop'); desktop.createShortcut('Test Application', 'http://example.com/index.html', {'128x128': 'http://example.com/icon128x128.png', '48x48': 'http://example.com/icon48x48.png', '32x32': 'http://example.com/icon32x32.png', '16x16': 'http://example.com/icon16x16.png'}, 'An application at http://example.com/index.html '); Files upload
  • 18.
    GeoLocation var geo= google.gears.factory.create('beta.geolocation'); Read only
  • 19.
    HttpRequest var request= google.gears.factory.create('beta.httprequest'); request.open('GET', '/index.html'); request.onreadystatechange = function() { if (request.readyState == 4) { console.write(request.responseText); } }; request.send(); Basically created specifically for the worker pool because it cant use the XmlHttpRequest.
  • 20.
    Worker pool TheWorkerPool API runs operations in the background, without blocking the UI. Scripts executing in the WorkerPool will not trigger the browser's &quot;unresponsive script&quot; dialog.
  • 21.
    Worker pool declarationvar workerPool = google.gears.factory.create('beta.workerpool'); var childWorkerId = workerPool.createWorkerFromUrl('worker.js');
  • 22.
    isolation Collection ofprocesses, not threads. No inheritance, no variable sharing, no share namespace Interact via message objects
  • 23.
    limitations No DOMaccess Document window Most other functions are supported
  • 24.
    Usage patern createa WorkerPool (wp) Indicate where messages will go (wp.onmessage) Create worker wp.createWorkerFromUrl() Function returns immediately, parent continues too run.
  • 25.
    State No newblog post in the last 6 months Api documentation missing. Very interesting market change ?

Editor's Notes