• Save
Google Gears
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Google Gears

on

  • 2,847 views

Summary seminar of the possible functions and present state of google gears.

Summary seminar of the possible functions and present state of google gears.
For more useful information on similar topics visit www.silenceit.ca

Statistics

Views

Total Views
2,847
Views on SlideShare
2,835
Embed Views
12

Actions

Likes
0
Downloads
13
Comments
0

2 Embeds 12

http://www.slideshare.net 7
http://www.silenceit.ca 5

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Show sample

Google Gears Presentation Transcript

  • 1. Google
  • 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
    • Application that passes javascript calls to the OS
    • Written in java.
    • http://code.google.com/p/gears/
    • Bsd license
  • 4. 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
  • 5. 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
  • 6. 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>
  • 7. 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.
  • 8. Offline mode
    • Google gears allow the user to store copies of the website files locally.
      • Javascript
      • Html
      • Pictures
      • Even renderings of server side code.
  • 9. 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
  • 10. Dynamic
    • Ok, getting index is cool. But nothing is dynamic.
    • SQLite!
  • 11. No data Layer
  • 12. SqlLite data layer
  • 13. More options = more work.
  • 14. The perfect solutions
  • 15. Main supported classes
    • beta.database Database
    • beta.desktop Desktop
    • beta.geolocation Geolocation
    • beta.httprequest HttpRequest
    • beta.localserver LocalServer
    • beta.timer Timer
    • beta.workerpool WorkerPool
  • 16. 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)');
  • 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
    • 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.
  • 21. Worker pool declaration
    • var workerPool = google.gears.factory.create('beta.workerpool');
    • var childWorkerId = workerPool.createWorkerFromUrl('worker.js');
  • 22. isolation
    • Collection of processes, not threads.
    • No inheritance, no variable sharing, no share namespace
    • Interact via message objects
  • 23. limitations
    • No DOM access
      • Document
      • window
    • Most other functions are supported
  • 24. Usage patern
    • create a WorkerPool (wp)
    • Indicate where messages will go (wp.onmessage)
    • Create worker wp.createWorkerFromUrl()
    • Function returns immediately, parent continues too run.
  • 25. State
    • No new blog post in the last 6 months
    • Api documentation missing.
    • Very interesting market change
    • ?