SlideShare une entreprise Scribd logo
1  sur  77
An Introduction
   to webOS
        Josh Marinacci
 Developer Relations Engineer
         April 23, 2010
Overview

•   webOS Architecture
•   Application Architecture
•   Building an App
•   Emulator and Ares
•   Advanced APIs
•   App Catalog
About Me

• Java Programmer @ Sun
  •   Swing Hacks
  •   JavaFX
  •   Java Store
  •   Swing Windows L&F
Web Tech Then

•   Slow execution
•   Page refreshes
•   No access to local resources
•   Text Heavy documents
Web Tech Now

•   AJAX
•   V8 and Squirrel Fish
•   Canvas, SVG, & WebGL
•   HTML 5 Storage
•   Web Workers
The Web Is Open

• That’s why I joined Palm
What Is the
 webOS?
Devices and Market
Decisions

•   Built from the DNA of the web
•   HTML CSS widgets
•   JavaScript APIs
•   Tracking HTML 5 standards
webOS Architecture
                                            Applications


             App Services
               Services                 UI System Manager
                Cloud


                              Window Manager         Mojo Framework

                               Window Server             Application
                                                          Manager
                                                              NPAPI



                                                                       Browser
  Palm Bus




                     Wireless                  Media
                                                                    DocViewers
                   OS Services            OS Middleware

                                     Kernel/User Space
                                         Boundary
                    Linux Kernel                FileSystem          TCP/IP
                            Bootie                        Drivers
Application Architecture

•   Everything local
•   Application
•   Stages
•   Scenes
•   Widgets
Stages & Scenes
Scene Lifecycle
      initialize      Find Scene
                                   Push This Scene
    (constructor


       setup             Start
                      Transition
        ready
    readytoactivate


      activate           End
                      Transition
                                   Push New Scene
     deactivate          Start     Pop This Scene
                      Transition

      cleanup

       Scene          Framework
Widgets

• Model View Controller
  • View (HTML)
  • Assistant (JavaScript)
  • Model (optional)
View / Markup
 <div id="myActivateButton"
      class="palm-button">
      Activate
 </div>

 <div id="myDestroyButton"
         class="palm-button negative">
         Destroy!
 </div>
JavaScript
ActivateAssistant.prototype.setup = function() {

	      //turn destroyPlanet function into an event handler
	      this.destroyPlanetHandler =
	      this.destroyPlanet.bindAsEventListener(this);

	      //attach handler to the button with tap events
	      this.controller.listen("myDestroyButton",
	      	       	      Mojo.Event.tap,
this.destroyPlanetHandler);
}

ActivateAssistant.prototype.destroyPlanet = function(event) {
	       console.log("destroying the planet with event " +
event);
};
Cleaning Up

• Clean up your references
APIs

• Addressbook and calendar
• Network services (upload and download)
• Hardware: Camera, GPS, and accelerometer
Send an Email
this.controller.serviceRequest(
    "palm://com.palm.applicationManager", {
        method: 'open',
        parameters: {
            id: "com.palm.app.email",
            params: {
                summary: "test subject",
                text: "Test email text.",
                recipients: [{
                    type:"email",
                    role:1,
                    value:"marvin@planet.org",
                    contactDisplay:"Marvin the Martian"
                }]
            }
        }
    }
);
Threading & Network
this.controller.serviceRequest('palm://com.palm.downloadmanager/', {
    method: 'upload',
    parameters: {
        'fileName': filename,
        'fileLabel':'media',
        'url': 'http://twitpic.com/api/uploadAndPost',
        'contentType': 'image/jpg',
        "postParameters": [
            {"key":"username" , "data": username},
            {"key":"password" , "data": password},
        ],
        "subscribe": true
    },
    onSuccess : function (resp){
        Mojo.Log.info('Success : ' + Object.toJSON(resp));
    },
    onFailure : function (e){
        Mojo.Log.info('Failure : ' + Object.toJSON(e));
    }.bind(this)
});
Hardware Access
this.controller.stageController.pushScene(
    {
        appId : 'com.palm.app.camera',
        name: 'capture'
    },
    {
        sublaunch : true,
        filename : '/media/internal/testpicture.jpg'
    }
);
PDK: Plug-in Development Kit

•   C/C++
•   Posix, OpenGL, SDL, PDL
•   When you need speed and low level access
•   Full screen or hybrid
•   Come back tomorrow!
Break!
Building Your
  First App
Generate App




palm-generate -t new_app DestroyWorld
Directory Structure
appinfo.json
{
	   "id": "com.palm.dts.destroyworld",
	   "version": "1.0.0",
	   "vendor": "World Destroyer, Inc.",
	   "type": "web",
	   "main": "index.html",
	   "title": "DestroyWorld",
	   "icon": "icon.png"
}
Initial HTML
<!DOCTYPE html>
<html>
<head>
      <title>DestroyWorld</title>
      <script src="/usr/palm/frameworks/mojo/mojo.js" type="text/javascript" x-mojo-
version="1"></script>


      <!-- application stylesheet should come in after the one loaded by the framework -->
      <link href="stylesheets/destroyworld.css" media="screen" rel="stylesheet" type="text/
css">
</head>
</html>
First Scene
palm-generate -t new_scene -p "name=Activate" DestroyWorld
StageAssistant.js
StageAssistant.prototype.setup = function() {
	      this.controller.pushScene("Activate");
};
Activate-scene.html
<div class="palm-body-text">
	
	      <div id="myActivateButton"
          class="palm-button">Activate</div>

  <div id="myDestroyButton"
          class="palm-button negative">Destroy!</div>

</div>
Package & Run
palm-package DestroyWorld

palm-install com.palm.dts.destroyworld_1.0.0_all.ipk
Activate-assistant.js
ActivateAssistant.prototype.setup = function() {

	      //turn destroyPlanet function into an event handler
	      this.destroyPlanetHandler =
	      this.destroyPlanet.bindAsEventListener(this);

	      //attach handler to the button with tap events
	      this.controller.listen("myDestroyButton",
	      	      	       Mojo.Event.tap, this.destroyPlanetHandler);

};

ActivateAssistant.prototype.destroyPlanet = function(event) {
	      console.log("destroying the planet with event " + event);
};
The webOS Emulator

• VirtualBox (version xxx required)
• x86 build of webOS
• Most things identical
• Not all hardware features supported (camera,
  multitouch)
• Simulate events
Navigating the Emulator

•   Esc = back gesture
•   Left / Right = flip between apps
•   Home = minimize / maximize card
•   End = bring up launcher
•   Mouse = single touch events
•   F5 – F9 = accelerometer event simulation
Simulating Events




luna-send -n 1 luna://com.palm.pmradiosimulator/set_incomingcall {"number":"14086177431"}

luna-send -n 1 luna://com.palm.pmradiosimulator/set_position {"lat":"37.3","long":"-122"}
Emulator Host Mode

• Embedded web server
• Use your desktop browser
• Good for inspecting HTML
• ssh -p 5522 -L 5581:localhost:8080 root@localhost
• http://localhost:5581/Apps
Logging




palm-log -f com.palm.dts.destroyworld
Ares
Ares

•   Visual IDE and GUI builder: WYSIWYG
•   Runs in the browser
•   Makes the same apps as the command-line SDK
•   Works with local emulator, debugging, logging
•   Works with real devices
•   Makes most coding tasks much faster
Ares vs. Mojo

•   Slightly different style of coding
•   Mojo widgets contained in lightweight wrappers
•   Not all widgets are supported (more coming)
•   Code is more concise
Saving

• Project stored on Palm’s servers
• Export source bundle
• Export packaged app
Demo
 Ares
Break
Advanced APIs

•   Overview
•   Network Web Services
•   Camera
•   Storage
•   Accelerometer
Comprehensive APIs

• Hardware
  • Accelerometer, GPS, Display
• Platform Services
  • Camera, Audio, Video, Power, Connection Manager
• Application Services
  • Alarms, Contacts, Calendar, Photos, Storage
• Application Actions
  • Email, Maps, Phone, YouTube, Browser, Document Viewers,
    Messaging
Access an XML Webservice
var url = "http://myserver.com/webservice?results=all";
var request = new Ajax.Request(url, {
   method: 'get',
   evalJSON: 'false',
   onCreate: function(){console.info('******* onCreate happened')},
   onLoading: function(){console.info('******* onLoading happened')},
   onLoaded: function(){console.info('******* onLoaded happened')},
   onSuccess: function(){console.info('******* onComplete happened')},
   onComplete: this.gotResults.bind(this),
   onFailure: this.failure.bind(this)
});
Parse Response with DOM & XPath
StartAssistant.prototype.gotResults = function(event){
   var xmlstring = event.responseText;	
	
   var doc = (new DOMParser()).parseFromString(xmlstring, "text/xml");
   // Use xpath to parse xml object
   var items = document.evaluate("/root/item", doc, null,
	       	       XPathResult.ANY_TYPE, null);
   var item = nodes.iterateNext();
   while (section) 	    {
      console.log("id = " + item.attributes['id'].nodeValue);
      item = items.iterateNext();
   }
}
Use the Camera
//launch the camera view	
this.controller.stageController.pushScene(
     {
       appId : 'com.palm.app.camera',
         name: 'capture'
     },
   {
       sublaunch : true,
       filename : '/media/internal/testpicture.jpg'
   }
);

//the activate function on your scene
activate: function(event) {
    if(event != undefined) {
        //the camera returned
        console.log("json = " + Object.toJSON(event));
        console.log("filename of the photo = " + event.filename);
    }
}
Use the Accelerometer (Tilt Sensor)

• Orientation events
• Shake Events
• Raw events
Orientation Events

• Pitch & roll in degrees
• Numeric codes for different orientations
  •   0   =   face up
  •   1   =   face down
  •   2   =   up / normal portrait
  •   3   =   down / reverse portrait
  •   4   =   left / landscape, left side down
  •   5   =   right / landscape, right side down
'orientationchange' property
this.controller.listen(document, 'orientationchange',
      this.handleOrientation.bindAsEventListener(this));
...
StartAssistant.prototype.handleOrientation =
function(event) {
   console.log("position = " + event.position
      + " pitch = " + event.pitch
      + " roll = " + event.roll);
};
Shake Events

• 'shakestart'
• 'shaking'
• 'shakeend'
'shaking' property

this.controller.listen(document, 'shaking',
   this.handleShaking.bindAsEventListener(this));
...
StartAssistant.prototype.handleShaking = function(event) {
    console.log("Shaking with magnitude: " + event.magnitude);
};
Raw Accelerometer Events

•   Raw x/y/z acceleration values
•   Default 4Hz (four times per second)
•   Option for 30Hz (good for games)
•   'acceleration' property
'acceleration' property

 this.controller.listen(document, 'acceleration',
    this.handleAcceleration.bindAsEventListener(this));
 ...
 StartAssistant.prototype.handleAcceleration = function(event) {
     console.log("X: "+ event.accelX
       + " Y:"+ event.accelY
       + " Z:"+ event.accelZ
       + " time: "+ event.time);
 };
Storage APIs

• Mojo Cookies
• Mojo Depot
• HTML 5
Mojo Cookies

•   Store simple values
•   4k of storage
•   Good for preferences, version numbers, etc.
•   Stored as a single JSON value in the Depot
Cookies

var SCROLL_MODE_KEY = “SCROLL_MODE_KEY”;
...
//set the current mode
var scrollModeCookie = new Mojo.Model.Cookie(SCROLL_MODE_KEY);
scrollModeCookie.put(scrollMode);

//retrieve it later
var scrollModeCookie = new Mojo.Model.Cookie(SCROLL_MODE_KEY);
console.log(“mode = “ + scrollModeCookie.get());
Mojo Depot

•   Simple object store for JSON
•   No schemas or SQL queries
•   Up to 1MB of storage
•   > 1MB available in media storage
•   Object -> SQL translation underneath
•   Not as efficient as true HTML database
•   Uses callbacks extensively
Create

var db = new Mojo.Depot(
   {'name':‘DestroyWorldDB'},
   function(code) {
      console.log(“open db succeed”);
   },
   function(code) {
      console.log("open db failed");
   }
);
console.log("created db : " + db);
Store

var db = new Mojo.Depot(
   { 'name' : 'DestroyWorldDB' },
   function(code) {
      console.log("open db succeeded " + db);
      var value = { 'target':"world", 'action':"destroy"};
      db.add("object1", value,
	       function(){console.log("saved okay");},
	       function(){console.log("save failed");}
         );
   },
   function(code) {console.log("open db failed");}
);
Retrieve
var db = new Mojo.Depot(
   { 'name' : 'DestroyWorldDB' },
var db = new Mojo.Depot(
   function(code) {
   { 'name' : 'DestroyWorldDB' },
      console.log("open db succeeded " + db);
   function(code) { 'target':"world", 'action':"destroy"};
      var value = {
      console.log("open db succeeded " + db);
      db.add("object1", value,
	     db.get("object1",
         function(){console.log("saved okay");},
	        function(obj){
         function(){console.log("save failed");}
         ); console.log("got object. target = " + obj.target);
	 },     },
	 function(code) {console.log("open db failed");}
         function(){console.log("get failed");}
);    );
   },
   function(code) {console.log("open db failed");}
);
HTML 5 Database

• Database object from HTML 5
  spec, but not storage object
• True SQL database
• Transactional
• Databases associated with
  applications
• Private, no inter-app sharing
• Up to 1MB of storage
• > 1MB available in media storage
• Work is ongoing to match the
  spec
Execute SQL Statements

var myDB = openDatabase(name:"thisDB");

myDB.transaction( (function (transaction) {
   transaction.executeSql('SOME SQL', []
       , this.successHandler.bind(this)
       , this.failureHandler.bind(this));
  }).bind(this);
Debugging

• [break for Steve Lemke]
App Catalog

•   App Catalog built into all devices
•   70/30 revenue split (Developer/Palm)
•   Multiple Catalogs
•   Multiple Countries
Catalog Options

•   On Device Catalog
•   Web Feed
•   Beta Feed
•   Open Source Apps
App Submission
International Apps

• Translating is strongly encouraged, not required
• Set prices for each country
• Metadata for each language (title, description,
  screenshots, etc.)
• Auto-generate prices for each currency zone
Palm Hot Apps Promotion
Palm Hot Apps Promotion

• Total payout: One Million Dollars
• Earn a bonus based on
  • Free: downloads
  • Paid: total revenue
• Feb 1 – June 30
  • Still plenty of time to win!
• Leader board updated daily
  • http://PalmHotApps.com/
Break
Roadmap


      Now           Soon       End of Summer
  Mojo SDK apps   Fullscreen    OS update
                  PDK apps     with new APIs
Links




 developer.palm.com   palmhotapps.com
Intro To webOS

Contenu connexe

Tendances

Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleyn_adam_stanley
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...Uniface
 
Developing Series 40 web apps with Nokia Web Tools 2.0
Developing Series 40 web apps with Nokia Web Tools 2.0Developing Series 40 web apps with Nokia Web Tools 2.0
Developing Series 40 web apps with Nokia Web Tools 2.0Microsoft Mobile Developer
 
Mozilla, Firefox OS and the Open Web
Mozilla, Firefox OS and the Open WebMozilla, Firefox OS and the Open Web
Mozilla, Firefox OS and the Open WebRobert Nyman
 
Html5 features: location, history and offline apps
Html5 features: location, history and offline appsHtml5 features: location, history and offline apps
Html5 features: location, history and offline appsKonstantin Delchev
 
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfHTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfJAX London
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - MozillaRobert Nyman
 
uMobile Preconference Seminar
uMobile Preconference SeminaruMobile Preconference Seminar
uMobile Preconference SeminarJennifer Bourey
 
Web versus Native: round 1!
Web versus Native: round 1!Web versus Native: round 1!
Web versus Native: round 1!Chris Mills
 
Empowering the "mobile web"
Empowering the "mobile web"Empowering the "mobile web"
Empowering the "mobile web"Chris Mills
 
WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleRobert Nyman
 
APIs, now and in the future
APIs, now and in the futureAPIs, now and in the future
APIs, now and in the futureChris Mills
 
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile appAndrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile appJohn Zozzaro
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...Uniface
 
APIs for modern web apps
APIs for modern web appsAPIs for modern web apps
APIs for modern web appsChris Mills
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences with ElectronBen Gotow
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Webphilogb
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortalJennifer Bourey
 
Firefox OS Introduction at Bontouch
Firefox OS Introduction at BontouchFirefox OS Introduction at Bontouch
Firefox OS Introduction at BontouchRobert Nyman
 

Tendances (20)

Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanley
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...
 
Developing Series 40 web apps with Nokia Web Tools 2.0
Developing Series 40 web apps with Nokia Web Tools 2.0Developing Series 40 web apps with Nokia Web Tools 2.0
Developing Series 40 web apps with Nokia Web Tools 2.0
 
Mozilla, Firefox OS and the Open Web
Mozilla, Firefox OS and the Open WebMozilla, Firefox OS and the Open Web
Mozilla, Firefox OS and the Open Web
 
Html5 features: location, history and offline apps
Html5 features: location, history and offline appsHtml5 features: location, history and offline apps
Html5 features: location, history and offline apps
 
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfHTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
 
uMobile Preconference Seminar
uMobile Preconference SeminaruMobile Preconference Seminar
uMobile Preconference Seminar
 
Web versus Native: round 1!
Web versus Native: round 1!Web versus Native: round 1!
Web versus Native: round 1!
 
Empowering the "mobile web"
Empowering the "mobile web"Empowering the "mobile web"
Empowering the "mobile web"
 
WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at Google
 
HTML5 WebWorks
HTML5 WebWorksHTML5 WebWorks
HTML5 WebWorks
 
APIs, now and in the future
APIs, now and in the futureAPIs, now and in the future
APIs, now and in the future
 
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile appAndrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dep...
 
APIs for modern web apps
APIs for modern web appsAPIs for modern web apps
APIs for modern web apps
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences with Electron
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
 
Firefox OS Introduction at Bontouch
Firefox OS Introduction at BontouchFirefox OS Introduction at Bontouch
Firefox OS Introduction at Bontouch
 

En vedette

LG Smart tv
LG Smart tvLG Smart tv
LG Smart tvPrince A
 
JavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.jsJavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.jsBen Combee
 
webOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtswebOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtsHendrik Ebel
 
Capable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappCapable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappFred Lin
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applicationsfpatton
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptfpatton
 
Digital spectacle by using cloud computing
Digital spectacle by using cloud computingDigital spectacle by using cloud computing
Digital spectacle by using cloud computingMandar Pathrikar
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaMarakana Inc.
 

En vedette (20)

Web OS
Web OSWeb OS
Web OS
 
webOS Introduction
webOS IntroductionwebOS Introduction
webOS Introduction
 
LG Smart tv
LG Smart tvLG Smart tv
LG Smart tv
 
You Know WebOS
You Know WebOSYou Know WebOS
You Know WebOS
 
Cloud operating systems
Cloud operating systemsCloud operating systems
Cloud operating systems
 
Eye Os(Cloud Opearating System)
Eye Os(Cloud Opearating System)Eye Os(Cloud Opearating System)
Eye Os(Cloud Opearating System)
 
Smart tv
Smart tvSmart tv
Smart tv
 
Smart TV
Smart TVSmart TV
Smart TV
 
JavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.jsJavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.js
 
webOS App by Example: Sorting Thoughts
webOS App by Example: Sorting ThoughtswebOS App by Example: Sorting Thoughts
webOS App by Example: Sorting Thoughts
 
WebOS - iCloud
WebOS - iCloud WebOS - iCloud
WebOS - iCloud
 
Presentation
PresentationPresentation
Presentation
 
Capable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappCapable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox Webapp
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applications
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScript
 
What is a shell script
What is a shell scriptWhat is a shell script
What is a shell script
 
Eyeos
EyeosEyeos
Eyeos
 
Digital spectacle by using cloud computing
Digital spectacle by using cloud computingDigital spectacle by using cloud computing
Digital spectacle by using cloud computing
 
Chrome extensions
Chrome extensionsChrome extensions
Chrome extensions
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
 

Similaire à Intro To webOS

WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonRobert Nyman
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
Empowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris MillsEmpowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris MillsFITC
 
Empowering the Mobile Web - Mills
Empowering the Mobile Web - MillsEmpowering the Mobile Web - Mills
Empowering the Mobile Web - MillsCodemotion
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...Robert Nyman
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on MobileAdam Lu
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with ExpressAaron Stannard
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyonddion
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOSKevin Decker
 
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...Sencha
 
HTML5 for Rich User Experience
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User ExperienceMahbubur Rahman
 
amis-adf-enterprise-mobility
amis-adf-enterprise-mobilityamis-adf-enterprise-mobility
amis-adf-enterprise-mobilityLuc Bors
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application developmentEngin Hatay
 
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Frédéric Harper
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKBrendan Lim
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1Mohammad Qureshi
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
Mobile Device APIs
Mobile Device APIsMobile Device APIs
Mobile Device APIsJames Pearce
 

Similaire à Intro To webOS (20)

WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Empowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris MillsEmpowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris Mills
 
Empowering the Mobile Web - Mills
Empowering the Mobile Web - MillsEmpowering the Mobile Web - Mills
Empowering the Mobile Web - Mills
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOS
 
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
 
HTML5 for Rich User Experience
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User Experience
 
amis-adf-enterprise-mobility
amis-adf-enterprise-mobilityamis-adf-enterprise-mobility
amis-adf-enterprise-mobility
 
Dancing with websocket
Dancing with websocketDancing with websocket
Dancing with websocket
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application development
 
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
Mobile Device APIs
Mobile Device APIsMobile Device APIs
Mobile Device APIs
 

Dernier

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Dernier (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Intro To webOS

  • 1. An Introduction to webOS Josh Marinacci Developer Relations Engineer April 23, 2010
  • 2. Overview • webOS Architecture • Application Architecture • Building an App • Emulator and Ares • Advanced APIs • App Catalog
  • 3. About Me • Java Programmer @ Sun • Swing Hacks • JavaFX • Java Store • Swing Windows L&F
  • 4. Web Tech Then • Slow execution • Page refreshes • No access to local resources • Text Heavy documents
  • 5. Web Tech Now • AJAX • V8 and Squirrel Fish • Canvas, SVG, & WebGL • HTML 5 Storage • Web Workers
  • 6. The Web Is Open • That’s why I joined Palm
  • 7. What Is the webOS?
  • 9. Decisions • Built from the DNA of the web • HTML CSS widgets • JavaScript APIs • Tracking HTML 5 standards
  • 10. webOS Architecture Applications App Services Services UI System Manager Cloud Window Manager Mojo Framework Window Server Application Manager NPAPI Browser Palm Bus Wireless Media DocViewers OS Services OS Middleware Kernel/User Space Boundary Linux Kernel FileSystem TCP/IP Bootie Drivers
  • 11. Application Architecture • Everything local • Application • Stages • Scenes • Widgets
  • 13. Scene Lifecycle initialize Find Scene Push This Scene (constructor setup Start Transition ready readytoactivate activate End Transition Push New Scene deactivate Start Pop This Scene Transition cleanup Scene Framework
  • 14. Widgets • Model View Controller • View (HTML) • Assistant (JavaScript) • Model (optional)
  • 15. View / Markup <div id="myActivateButton" class="palm-button"> Activate </div> <div id="myDestroyButton" class="palm-button negative"> Destroy! </div>
  • 16.
  • 17. JavaScript ActivateAssistant.prototype.setup = function() { //turn destroyPlanet function into an event handler this.destroyPlanetHandler = this.destroyPlanet.bindAsEventListener(this); //attach handler to the button with tap events this.controller.listen("myDestroyButton", Mojo.Event.tap, this.destroyPlanetHandler); } ActivateAssistant.prototype.destroyPlanet = function(event) { console.log("destroying the planet with event " + event); };
  • 18. Cleaning Up • Clean up your references
  • 19. APIs • Addressbook and calendar • Network services (upload and download) • Hardware: Camera, GPS, and accelerometer
  • 20. Send an Email this.controller.serviceRequest( "palm://com.palm.applicationManager", { method: 'open', parameters: { id: "com.palm.app.email", params: { summary: "test subject", text: "Test email text.", recipients: [{ type:"email", role:1, value:"marvin@planet.org", contactDisplay:"Marvin the Martian" }] } } } );
  • 21. Threading & Network this.controller.serviceRequest('palm://com.palm.downloadmanager/', { method: 'upload', parameters: { 'fileName': filename, 'fileLabel':'media', 'url': 'http://twitpic.com/api/uploadAndPost', 'contentType': 'image/jpg', "postParameters": [ {"key":"username" , "data": username}, {"key":"password" , "data": password}, ], "subscribe": true }, onSuccess : function (resp){ Mojo.Log.info('Success : ' + Object.toJSON(resp)); }, onFailure : function (e){ Mojo.Log.info('Failure : ' + Object.toJSON(e)); }.bind(this) });
  • 22. Hardware Access this.controller.stageController.pushScene( { appId : 'com.palm.app.camera', name: 'capture' }, { sublaunch : true, filename : '/media/internal/testpicture.jpg' } );
  • 23. PDK: Plug-in Development Kit • C/C++ • Posix, OpenGL, SDL, PDL • When you need speed and low level access • Full screen or hybrid • Come back tomorrow!
  • 25. Building Your First App
  • 26. Generate App palm-generate -t new_app DestroyWorld
  • 28. appinfo.json { "id": "com.palm.dts.destroyworld", "version": "1.0.0", "vendor": "World Destroyer, Inc.", "type": "web", "main": "index.html", "title": "DestroyWorld", "icon": "icon.png" }
  • 29. Initial HTML <!DOCTYPE html> <html> <head> <title>DestroyWorld</title> <script src="/usr/palm/frameworks/mojo/mojo.js" type="text/javascript" x-mojo- version="1"></script> <!-- application stylesheet should come in after the one loaded by the framework --> <link href="stylesheets/destroyworld.css" media="screen" rel="stylesheet" type="text/ css"> </head> </html>
  • 30. First Scene palm-generate -t new_scene -p "name=Activate" DestroyWorld
  • 31. StageAssistant.js StageAssistant.prototype.setup = function() { this.controller.pushScene("Activate"); };
  • 32. Activate-scene.html <div class="palm-body-text"> <div id="myActivateButton" class="palm-button">Activate</div> <div id="myDestroyButton" class="palm-button negative">Destroy!</div> </div>
  • 33. Package & Run palm-package DestroyWorld palm-install com.palm.dts.destroyworld_1.0.0_all.ipk
  • 34. Activate-assistant.js ActivateAssistant.prototype.setup = function() { //turn destroyPlanet function into an event handler this.destroyPlanetHandler = this.destroyPlanet.bindAsEventListener(this); //attach handler to the button with tap events this.controller.listen("myDestroyButton", Mojo.Event.tap, this.destroyPlanetHandler); }; ActivateAssistant.prototype.destroyPlanet = function(event) { console.log("destroying the planet with event " + event); };
  • 35. The webOS Emulator • VirtualBox (version xxx required) • x86 build of webOS • Most things identical • Not all hardware features supported (camera, multitouch) • Simulate events
  • 36. Navigating the Emulator • Esc = back gesture • Left / Right = flip between apps • Home = minimize / maximize card • End = bring up launcher • Mouse = single touch events • F5 – F9 = accelerometer event simulation
  • 37. Simulating Events luna-send -n 1 luna://com.palm.pmradiosimulator/set_incomingcall {"number":"14086177431"} luna-send -n 1 luna://com.palm.pmradiosimulator/set_position {"lat":"37.3","long":"-122"}
  • 38. Emulator Host Mode • Embedded web server • Use your desktop browser • Good for inspecting HTML • ssh -p 5522 -L 5581:localhost:8080 root@localhost • http://localhost:5581/Apps
  • 40. Ares
  • 41. Ares • Visual IDE and GUI builder: WYSIWYG • Runs in the browser • Makes the same apps as the command-line SDK • Works with local emulator, debugging, logging • Works with real devices • Makes most coding tasks much faster
  • 42. Ares vs. Mojo • Slightly different style of coding • Mojo widgets contained in lightweight wrappers • Not all widgets are supported (more coming) • Code is more concise
  • 43. Saving • Project stored on Palm’s servers • Export source bundle • Export packaged app
  • 45. Break
  • 46. Advanced APIs • Overview • Network Web Services • Camera • Storage • Accelerometer
  • 47. Comprehensive APIs • Hardware • Accelerometer, GPS, Display • Platform Services • Camera, Audio, Video, Power, Connection Manager • Application Services • Alarms, Contacts, Calendar, Photos, Storage • Application Actions • Email, Maps, Phone, YouTube, Browser, Document Viewers, Messaging
  • 48. Access an XML Webservice var url = "http://myserver.com/webservice?results=all"; var request = new Ajax.Request(url, { method: 'get', evalJSON: 'false', onCreate: function(){console.info('******* onCreate happened')}, onLoading: function(){console.info('******* onLoading happened')}, onLoaded: function(){console.info('******* onLoaded happened')}, onSuccess: function(){console.info('******* onComplete happened')}, onComplete: this.gotResults.bind(this), onFailure: this.failure.bind(this) });
  • 49. Parse Response with DOM & XPath StartAssistant.prototype.gotResults = function(event){ var xmlstring = event.responseText; var doc = (new DOMParser()).parseFromString(xmlstring, "text/xml"); // Use xpath to parse xml object var items = document.evaluate("/root/item", doc, null, XPathResult.ANY_TYPE, null); var item = nodes.iterateNext(); while (section) { console.log("id = " + item.attributes['id'].nodeValue); item = items.iterateNext(); } }
  • 50. Use the Camera //launch the camera view this.controller.stageController.pushScene( { appId : 'com.palm.app.camera', name: 'capture' }, { sublaunch : true, filename : '/media/internal/testpicture.jpg' } ); //the activate function on your scene activate: function(event) { if(event != undefined) { //the camera returned console.log("json = " + Object.toJSON(event)); console.log("filename of the photo = " + event.filename); } }
  • 51. Use the Accelerometer (Tilt Sensor) • Orientation events • Shake Events • Raw events
  • 52. Orientation Events • Pitch & roll in degrees • Numeric codes for different orientations • 0 = face up • 1 = face down • 2 = up / normal portrait • 3 = down / reverse portrait • 4 = left / landscape, left side down • 5 = right / landscape, right side down
  • 53. 'orientationchange' property this.controller.listen(document, 'orientationchange', this.handleOrientation.bindAsEventListener(this)); ... StartAssistant.prototype.handleOrientation = function(event) { console.log("position = " + event.position + " pitch = " + event.pitch + " roll = " + event.roll); };
  • 54. Shake Events • 'shakestart' • 'shaking' • 'shakeend'
  • 55. 'shaking' property this.controller.listen(document, 'shaking', this.handleShaking.bindAsEventListener(this)); ... StartAssistant.prototype.handleShaking = function(event) { console.log("Shaking with magnitude: " + event.magnitude); };
  • 56. Raw Accelerometer Events • Raw x/y/z acceleration values • Default 4Hz (four times per second) • Option for 30Hz (good for games) • 'acceleration' property
  • 57. 'acceleration' property this.controller.listen(document, 'acceleration', this.handleAcceleration.bindAsEventListener(this)); ... StartAssistant.prototype.handleAcceleration = function(event) { console.log("X: "+ event.accelX + " Y:"+ event.accelY + " Z:"+ event.accelZ + " time: "+ event.time); };
  • 58. Storage APIs • Mojo Cookies • Mojo Depot • HTML 5
  • 59. Mojo Cookies • Store simple values • 4k of storage • Good for preferences, version numbers, etc. • Stored as a single JSON value in the Depot
  • 60. Cookies var SCROLL_MODE_KEY = “SCROLL_MODE_KEY”; ... //set the current mode var scrollModeCookie = new Mojo.Model.Cookie(SCROLL_MODE_KEY); scrollModeCookie.put(scrollMode); //retrieve it later var scrollModeCookie = new Mojo.Model.Cookie(SCROLL_MODE_KEY); console.log(“mode = “ + scrollModeCookie.get());
  • 61. Mojo Depot • Simple object store for JSON • No schemas or SQL queries • Up to 1MB of storage • > 1MB available in media storage • Object -> SQL translation underneath • Not as efficient as true HTML database • Uses callbacks extensively
  • 62. Create var db = new Mojo.Depot( {'name':‘DestroyWorldDB'}, function(code) { console.log(“open db succeed”); }, function(code) { console.log("open db failed"); } ); console.log("created db : " + db);
  • 63. Store var db = new Mojo.Depot( { 'name' : 'DestroyWorldDB' }, function(code) { console.log("open db succeeded " + db); var value = { 'target':"world", 'action':"destroy"}; db.add("object1", value, function(){console.log("saved okay");}, function(){console.log("save failed");} ); }, function(code) {console.log("open db failed");} );
  • 64. Retrieve var db = new Mojo.Depot( { 'name' : 'DestroyWorldDB' }, var db = new Mojo.Depot( function(code) { { 'name' : 'DestroyWorldDB' }, console.log("open db succeeded " + db); function(code) { 'target':"world", 'action':"destroy"}; var value = { console.log("open db succeeded " + db); db.add("object1", value, db.get("object1", function(){console.log("saved okay");}, function(obj){ function(){console.log("save failed");} ); console.log("got object. target = " + obj.target); }, }, function(code) {console.log("open db failed");} function(){console.log("get failed");} ); ); }, function(code) {console.log("open db failed");} );
  • 65. HTML 5 Database • Database object from HTML 5 spec, but not storage object • True SQL database • Transactional • Databases associated with applications • Private, no inter-app sharing • Up to 1MB of storage • > 1MB available in media storage • Work is ongoing to match the spec
  • 66. Execute SQL Statements var myDB = openDatabase(name:"thisDB"); myDB.transaction( (function (transaction) { transaction.executeSql('SOME SQL', [] , this.successHandler.bind(this) , this.failureHandler.bind(this)); }).bind(this);
  • 67. Debugging • [break for Steve Lemke]
  • 68. App Catalog • App Catalog built into all devices • 70/30 revenue split (Developer/Palm) • Multiple Catalogs • Multiple Countries
  • 69. Catalog Options • On Device Catalog • Web Feed • Beta Feed • Open Source Apps
  • 71. International Apps • Translating is strongly encouraged, not required • Set prices for each country • Metadata for each language (title, description, screenshots, etc.) • Auto-generate prices for each currency zone
  • 72. Palm Hot Apps Promotion
  • 73. Palm Hot Apps Promotion • Total payout: One Million Dollars • Earn a bonus based on • Free: downloads • Paid: total revenue • Feb 1 – June 30 • Still plenty of time to win! • Leader board updated daily • http://PalmHotApps.com/
  • 74. Break
  • 75. Roadmap Now Soon End of Summer Mojo SDK apps Fullscreen OS update PDK apps with new APIs
  • 76. Links developer.palm.com palmhotapps.com

Notes de l'éditeur

  1. goal: by the end of this class you will be able to make a webos application and be ready to submit it to the store prereqs: nothing beyond basic programming skills and knowledge of HTML. If you can build an interactive website you can build a webOS app.
  2. first a quick bit about myself and how i came to palm. i&apos;ve been a java programmer for close to 15 years, ever since the first betas in 95. i wrote swing hacks for oreilly and worked on the javafx and java store projects at Sun. I really care about user interfaces.
  3. For a long time I was negative about the web as a user interface technology. And when I say &amp;#x2018;web&amp;#x2019; I really mean HTML, JavaScript, and CSS. They are slow and extremely limited. They are great for text but not much else. Anything interesting in the web space has to be done on the server side.
  4. Well I was wrong.. or rather, the web technology stack has advanced tremendously since I had last looked at it. Last november I happen to meet my friends Ben and Dion at the OreDev conference in Sweden. Yes, it&amp;#x2019;s true, I had to travel to Sweden to meet up with people from my own timezone. So I went to their presentation and was amazed by how far web technology has come in just a few years. AJAX was the beginning of making the web truly interactive and expressive. New javascript engines are making it almost as fast as the Java Virtual Machine and native code. New APIs are arriving to fill in the gaps. Things like real 2D bitmap canvas. Animated SVG for vector graphics. WebGL for 3D. HTML 5 storage. Web Workers for threads.
  5. The platform is really moving forward, and best of all it&apos;s open. Not controlled by any one vendor with an agenda. That really spoke to me. finally it is possible to create great user experiences with completely open technology... and on mobile devices, no less. So that&apos;s why I joined Palm... to be a part of the open mobile revolution.
  6. What is the webOS? The webOS is Palm&apos;s mobile operating system. It was designed from the ground up to be a mobile operating system for devices with a touch screen and a physical keyboard. It can scale to different screen sizes and hardware capabilities while presenting a uniform platform to you, the software developer.
  7. devices and market We currently have the Pre and the Pixi. Their hardware is roughly equivalent, with the Pre having a larger screen, more storage, and slightly faster CPU &amp; GPU. They both support the exact same software, however, and it&apos;s very easy to adjust to the screen sizes.
  8. technology decisions and direction The webOS was designed from the beginning to be built from the DNA of the web. The SDK is HTML, CSS, and JavaScript, which are the core languages of the web. You can use any Javascript libraries that you want, such as Prototype, JQuery, or MooTools. We provide Javascript apis for the core operating system functions like access to the camera, address book, location, and storage. We are tracking the HTML 5 standard and plan to support more of it as the standard becomes complete.
  9. webos architecture linux base The core of the webOS is a linux kernel with a posix filesystem and the typical posix APIs. It is linux underneath so we a true multi-threading, power management, unix filesystem, etc. All of the things you expect from a real linux OS. Generally these are hidden from the app developer, though you can access many of the posix APIs with the PDK, subject to access restrictions. window manager Above the Linux core is the window manager, called Luna, which controls access to the screen and provides the core drawing functions through OpenGL and WebKit. javascript apis Above Luna are javascript apis for all of the device features. Things like camera and location are hardware services written in C and exported to the javascript layer through simple apis. The actual applications are written in HTML, JavaScript, and CSS. Javascript manipulates the underlying webpage DOM to create the graphics you see on screen. All of the apps you see in the OS are written like this. In fact, the SDK actually provides the source to much of the built in apps so you can see how they are constructed. All of the widgets are provided by the Mojo APIs, which are javascript as well. In the SDK you can see all of the core css and images used to draw the wigets on screen. Use of Mojo is not required, but it is recommended because it lets you use a common look and feel, and implements all of the mobile specific features like touch events and infinite scrolling lists.
  10. application architecture difference between a webos app and a web app. no webserver. everything is local. you implement state changes and program logic in javascript locally. you don&apos;t call back to a server somewhere.
  11. cards, stages, and scenes the webos uses the &apos;card&apos; as the core ui metaphor. with a few exceptions, every app is shown as a card. the user switches between apps much as you would deal a deck of cards, flipping from one card to another. this is a very tangable metaphor that everyone can grasp very quickly. from an application point of view you have stages and scenes. a stage is a card. a scene is a view within that card. you only see one scene at a time. if this was a webpage then the stage would be the browser window or tab, and the scene would be a page on your site. the user can navigate from scene to scene, or page to page. some apps actually have more than one stage, meaning they have more than one card visible. a good example of this is the email app. there is one card for viewing your mail. it has multiple scenes: one for the list of inboxes, one for the list of mails in your inbox, and one for the mail you are currently useing. the mail app also has secondary stages for when you compose an email. in this case it shows a full separate card so that you can write an email but still switch back to the inbox to read another email before you are done. I&amp;#x2019;m not going to cover it in this session, but there is also another kind of stage called a dashboard. This is a little indicator at the bottom of the screen that lets you know you have a message or alert or some other notification. This can be expanded into a full dashboard, which is a wide but short window across the bottom that gives the user more info and the ability to take action. Usually this will open up the full app that created the notification, or it may provide the user with other controls, such as the music player which lets you pause or switch tracks.
  12. MVC design for widgets and structure apis and widgets the mojo toolkit provides all of the standard widgets for things like menus, buttons, text input, and of course the all important scrolling list control. most apps will reuse these existing widgets.
  13. The widgets are represented as DIVs in your markup. You can also customize the look of the widget using CSS. There are a bunch of prefab CSS classes for the standard widgets with different variations. You can override these styles with your own CSS, of course. here&apos;s an example of some buttons. Notice how they both have the css class &amp;#x2018;palm-button&amp;#x2019; but the second one also has the class &amp;#x2018;negative&amp;#x2019;.
  14. Here&amp;#x2019;s what that view looks like without adding any more code or CSS.
  15. You then wire up the widgets using JavaScript. This code will turn the &amp;#x2018;destroyPlanet&amp;#x2019; function into an event listener with the bindAsEventListener function. Then it attaches the listener to the button using the &amp;#x2018;listen&amp;#x2019; function on the scene controller.
  16. The stage has a full lifecycle for a reason. This lets you know when resources are needed and when they are no longer need. This lets you clean up resources at the right time and avoid memory leaks. always, always remove event listeners in the &amp;#x2018;cleanup&amp;#x2019; function
  17. there are mojo apis for various services provided by the OS. this includes access to device features like the camera, and application services like the address book and calendar.
  18. Here&amp;#x2019;s a simple API request. We ask the application manager service (as shown here in red) to open the application &amp;#x2018;com.palm.app.email&amp;#x2019; and send it this block of parameters. This will open a new email message with the specified recipient.
  19. Threading: there is no programmer accessible threading. everything happens in the gui thread. However, there are apis to handle things that would typically be done in a background thread, such as downloading and uploading files. For example, here&apos;s how to upload a file to twitpic.com. This code calls the downloadManager service with the upload method (yes, I know it&amp;#x2019;s confusing to call it the download manager in this case). You pass in the parameters for the url you want to post to, the file to upload, and the extra http parameters. You can also pass in some callback functions for when the post succeeds or fails. This is how you can do something that would normally require a thread. The API does it for you and calls you back when it&amp;#x2019;s done. You can also use this API to download a file and process XML &amp; JSON. We are monitoring the HTML 5 standard and are looking at the WebWorkers spec for true background processing. However, for a lot of the tasks you&amp;#x2019;d want to do our APIs eliminate the need for direct threading.
  20. Most device access is handled through a similar APIs. You call a service with some parameters and a callback function. Some APIs have their own GUI, such as the camera. So instead of making a service request you simply tell the stage to navigate to the scene for that GUI. This is called pushing. Here&amp;#x2019;s an example of opening up the camera scene. We push to the com.palm.app.camera service with a parameter to say the name of the photo we want to write to.
  21. I&amp;#x2019;m not going to cover the PDK today, but I thought I would mention it. When designing websites sometimes there are things you can&amp;#x2019;t do using pure web technologies. These are usually things that require maximum speed or direct hardware access, such as 3D graphics. On the web you would use browser plugins for these things. We have the same thing in the webOS called the plugin development kit, or PDK. This lets you write plugins for your apps which use native C and C++ code. We give you a standard linux/posix environment with access to OpenGL, SDL for input, and our PDL API to access Palm specific APIs. PDK apps can be either pure PDK running as full screen, such as most of our 3D games, or hybrid apps where you mix some native code with an HTML based Mojo app. I&amp;#x2019;m not going to cover the PDK here today because this is an intro day, but come back tomorrow for some great indepth sessions on the PDK.
  22. We do have an eclipse plugin [right?] and our Ares visual tool, but I&apos;m going to just use the core SDK with command line tools to show you what&apos;s really going on. It&apos;s sort of like in math class where your teacher taught you how to add and subtract before showing you how to use the calculator to do it faster. The command line tools also make it very easy to automate your development workflow using ant files, hudson, and other build systems. commandline tools our command line tools are written in [java? python? bash?] so they should run everywhere. The whole SDK is designed to be platform independent and usable from open source tools, which is why we chose VirtualBox as our emulator.
  23. First run the command line tool palm-generate. It uses templates. The &amp;#x2018;new_app&amp;#x2019; template will create the full directory structure needed for a basic app. Let&apos;s make an app. I&amp;#x2019;m tired of &amp;#x2018;Hello World&amp;#x2019; apps so let&amp;#x2019;s make the most epic app ever: &amp;#x2018;Destroy World&amp;#x2019; It will let you destroy the planet with the click of a button. palm-generate -t new_app DestroyWorld
  24. let&apos;s take a look at the dir structure [open a file browser window showing the dir structure] Everything is laid out in a nice clean directory structure. there&apos;s a place for images, stylesheets, html, and your javascript.
  25. [show the contents of the appinfo.json file] appinfo.json is the metadata about your project. you&apos;ll want to edit it first to change the title and package id of your app.
  26. [open initial index.html] this is the top of the &apos;real&apos; page. it defines the css and javascript you want to import by default.
  27. now let&amp;#x2019;s create our first scene. I&amp;#x2019;m going to call this scene &amp;#x2018;Activate&amp;#x2019; palm-generate -t new_scene -p &quot;name=Activate&quot; DestroyWorld This will create the html and javascript files for our scene.
  28. Now in order to make the scene show up we need to push it. So in our stage assistant we&amp;#x2019;ll call pushScene with the name of the scene: &amp;#x2018;Activate&amp;#x2019;
  29. Now let&amp;#x2019;s open the view for our scene This is the html file for our scene. i&apos;m going to add two buttons [paste in code for two buttons, one to activate, one to destroy] Again, notice that the second button has the &amp;#x2018;negative&amp;#x2019; css class set.
  30. now we will package it up and test it in the emulator. first, package the app with the command palm-package DestroyWorld now start the emulator now install the app with the command palm-install com.palm.dts.destroyworld_1.0.0_all.ipk now that it&apos;s in the emulator we can run it and see that it works. cool.
  31. now let&apos;s edit the actual javascript code for this page to make the button do something. [open up scene assistant] every scene has a view, the html file, and an assistant, which is the javascript code. let&apos;s attach an event handler to our destroy button. [paste in code for the button. code should print &amp;#x2018;destroying the world ...&amp;#x2019;] package and test it again in the emulator
  32. The webOS emulator is an instance of the open source project VirtualBox. It&apos;s an x86 build of our whole OS, so it really is very close to a real device except for the different hardware. Not all hardware features are supported, such as the camera. For some hardware like GPS you can simulate events using command line tools. This comes in very handy when building unit tests for your software. [a note on virtual box: you must have version xxx]
  33. these are the primary shortcut key&amp;#x2019;s you&amp;#x2019;ll want to know: left and right to switch between apps escape = &amp;#x2018;back gesture&amp;#x2019;
  34. In addition to the key strokes for simple accelerometer events you can also simulate some radio features from the command line. For example you can fake an incoming phone call like this. And you can fake a GPS fix like this. You can also use the luna-send command to control the GPS Auto Drive feature. This lets you use a fake GPS route out of a csv file. It&amp;#x2019;s good for simulating the full GPS experience. Even if you have a real device to test on this can be useful for unit tests of edge cases.
  35. As of 1.4.1 we added a mini webserver to the emulator. This lets you browse your apps from another webbrowser over an SSH tunnel. This is great for debugging. Just create a tunnel and then open our desktop browser to this page.
  36. get a log of what your app is doing [type in palm-log -f com.palm.dts.destroyworld] There is a log file for each app. The &amp;#x2018;palm-log&amp;#x2019; command is equivalent to the &amp;#x2018;tail&amp;#x2019; command in Unix. You tell it which app to view the log for. It also supports the -f argument to follow, just like tail. I usually run this command in an extra terminal window and keep it running during development. It makes it easy to print debugging information.
  37. Ares is our new visual IDE and gui builder. It lets you build webOS apps with a drag and drop gui builder. It&amp;#x2019;s entirely webbased but uses the real emulator locally on your computer. It can even deploy straight to your USB connected phone. It really makes coding webOS apps easier and faster.
  38. There are a few differences between Ares and regular Mojo apps. Ares wraps the mojo widgets in lightweight containers and handles a lot of the boilerplate code for you. You can drop down to regular Mojo APIs if you want to, which sometimes you have to do for the widgets that Ares hasn&amp;#x2019;t wrapped yet.
  39. The projects are stored on Palm&amp;#x2019;s servers. You can download the source, or download the packaged up app, which is how the emulator works.
  40. Now let&amp;#x2019;s look at an example of Ares open ares, create a simple one stage application with a header and the same &amp;#x2018;activate&amp;#x2019; and &amp;#x2018;destroy&amp;#x2019; buttons. make the destroy button have the negative class. change orientation to show how stuff resizes automatically run the app in the preview show property sheet, add event handler to the button which prints to the log. show the logging, undo/redo, jslint. run the app in the emulator use the &amp;#x2018;email&amp;#x2019; non visual component to create a new message when the activate button is pressed
  41. In this session we are going to give you an overview of advanced APIs, then run through some specific examples to show you how they work and the overall API patterns.
  42. The webOS has lots of APIs for all sorts of things so I&amp;#x2019;ve divided them into four sections. First is direct monitoring of the hardware. Pretty much every piece of hardware in the phones has an API for it, such as the accelerometer and the GPS radio. Next are platform services. This are services apis for things that aren&amp;#x2019;t really hardware but let you request features from the operating system. This is stuff like the current state of the network, power settings, and direct embedding of video streams. Next are application services. This are simply APIs provided to your app to interact with the user&amp;#x2019;s data on the device, with the appropriate privacy safeguards. Finally we have application actions. These are apis that let you request another application to do something for you, usually by opening that application in a particular state. For example, with the Email API you don&amp;#x2019;t directly send an email. Instead you ask the email app to open up a new message with the recipient and subject you provide.
  43. Network services are super easy to access because the webOS was built on the web. If you want to talk to an XML webservice just do an AJAX request and give it a callback.
  44. You can parse the response into an XML document using the DOMParser and then do XPath queries on the result. This is a great way to loop through webservice responses. And of course you can do the same with JSON as well.
  45. Camera access is slightly different. The camera has an entire custom scene dedicated to taking pictures, so instead of calling an API with a callback function, you just have to push to the special camera scene and then watch for an event containing a filename when your scene is activated again. When you do this the camera viewer will take over the screen until the user is done taking a picture.
  46. Every Palm device has a tilt sensor built into it, called an accelerometer. It doesn&amp;#x2019;t actually measure tilting. Instead it measure acceleration in three dimensions relative to gravity. Through some clever math you can determine the orientation of the device. Since orientation is the most common thing you&amp;#x2019;d want to do with an accelerometer we&amp;#x2019;ve already done the math for you and given you a simple API to access it.
  47. Just listen for orientation events. The event has a numeric code for the different possible positions along with the pitch and roll expressed in degrees
  48. You can get these events by listening for the &amp;#x2018;orientationchange&amp;#x2019; event on the document.
  49. Some apps use shaking as a specific gesture to trigger some behavior. To support this we created a shake recognizer which will send you events.
  50. Again, just listen for the &amp;#x2018;shaking&amp;#x2019; event with a callback.
  51. If you really want the raw acceleration events you can get that two. These are the raw x,y, and z values from the chip. Once you have these you can do whatever you want with them, like make a tilt sensitive racing game. The default refresh rate is four times per second but there&amp;#x2019;s an option for a full 30hz event, which is great for games.
  52. Again, just listen to the right property for events.
  53. There are three kinds of storage: Cookies, the Mojo Depo, and the HTML5 record database. Which one to use depends on your needs.
  54. Mojo Cookies just like normal web cookies. They hold small amounts of state and are limited to about 4K of storage.
  55. To use them just create a cookie object for your key then get and set the value.
  56. Mojo Depot is the next level of storage. It&amp;#x2019;s an object store for JSON objects. It doesn&amp;#x2019;t have any schemas or SQL, so it&amp;#x2019;s very flexible but not as fast as a real SQL database would be. It can have up to 1MB of storage by default, and you can get more by storing the objects in the media storage partition. Underneath it&amp;#x2019;s doing Object to SQL translation, which is why it&amp;#x2019;s not as efficient as the HTML database. The API uses callbacks extensively to ensure proper asynchronous and safe access.
  57. You can create and open a Depot database with an instance of the Mojo.Depot object. Pass in a JSON object with some parameters, including the name of your database. Then provide two callbacks, one if it succeeds and one if it fails.
  58. To store something first open the database, then in the callback store your JSON object with the &amp;#x2018;add&amp;#x2019; method. this method takes the object to be saved and two more callbacks.
  59. To retrieve objects do the same thing. Once your database is open call the &amp;#x2018;get&amp;#x2019; method with the key you used to save it. The callback will have the object as it&amp;#x2019;s argument, and then you can pick it apart.
  60. I&amp;#x2019;m not going to go into detail on this. Basically it&amp;#x2019;s a true SQL database store with transactional access through callbacks. You have to know SQL to use it, but it&amp;#x2019;s the fastest. We are doing work to follow the HTML 5 spec and improve performance. Expect improvements in future releases of webOS.
  61. app catalog rules and structure submission process
  62. There is a fifty dollar fee to submit your app into the on device catalog. These apps go through the full review process, which currently takes about three business days. [verify]. This is the standard way most people distribute apps. You can also distribute apps purely through the web feeds. These apps will not be listed in the on device catalog, but if a user clicks on a webpage link to the app it will come up in the catalog so they can buy it. This lets you do your own marketing for the app. There is no cost for these and they are not reviewed by Palm [verify] The beta feed is free. Publish your app this way if you are just testing the app. Open Source apps do not cost anything to submit in the main catalog if they are free. [verify]
  63. All apps are submitted through our online portal at developer.palm.com. Here you can manage all of your apps, submit new ones,
  64. conclusion and roadmap
  65. extras: sources of graphics and icons tools to use: cssedit, jedit, netbeans &amp; eclipse