you know webos

20
webOS The Platform You Already Know Eric Marthinsen and Gary Smith Agile Commerce

Upload: 360conferences

Post on 13-Jan-2015

2.102 views

Category:

Technology


0 download

DESCRIPTION

1 of 2 Gary and Eric from Agile Commerce present a Hands-On course on Palms new WebOS MojoSDK at the InsideMobile Conference.

TRANSCRIPT

Page 1: You Know WebOS

webOSThe Platform You Already Know

Eric Marthinsen and Gary SmithAgile Commerce

Page 2: You Know WebOS

Agenda

Terminology

Technologies

Similarities

Differences

What next?

Page 3: You Know WebOS

Terminology

Palm Pre

webOS

Mojo

Page 4: You Know WebOS

Technologies

HTML

CSS

JavaScript

Page 5: You Know WebOS

Similarities

StructureModel View Controller (MVC) paradigmVery close in style and form to Ruby on Rails

PhilosophyHelper tools, similar to Ruby on RailsConvention over configuration

CodingHTML, CSS, and JavaScript – follows typical web paradigms

Page 6: You Know WebOS

Structure

Ruby on Rails

appcontrollers

   models    views

public    images    stylesheets

Mojo

appassistantsmodelsviews

imagesstylesheets

Mojo applications are MVC applications.

Page 7: You Know WebOS

Philosophy

Mojo follows closely to many core concepts in Ruby on Rails.

Convention over configuration ruby script/generate versus palm-generate

Page 8: You Know WebOS

Code: HTML

HTML

<div style=”background: red”>This is some text

</div>

webOS

<div style=”background: red”>This is some text

</div>

Page 9: You Know WebOS

Code: Finding an Element

HTMLdocument.findElementById(“id”)

$('id')

webOSdocument.findElementById(“id”)

$('id')

this.controller.get('id')

Page 10: You Know WebOS

Code: Wiring up an Event Handler

HTML

elem.onclick = this.handler

Event.observe('elemName', 'click', this.handler)

webOS

Mojo.Event.listen(element, Mojo.Event.tap, this.handler)

Page 11: You Know WebOS

Code: Ajax

A typical AJAX call:  var url = "http://api.example.com";

new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { console.log("SUCCESS!!!"); }, onFailure: function() { console.log("FAILURE"); }});

Page 12: You Know WebOS

Code: Ajax

Accessing the GPS System Service in Mojo:  var url = "palm://com.palm.location";  this.controller.serviceRequest(url, {   method:"startTracking",  parameters:{ subscribe: true },  onSuccess: function(result){    console.log("GOT A NEW LOCATION");  },  onFailure: function(result){    console.log("FAILURE");  }});

Page 13: You Know WebOS

Code: Widgets

SWFobject

<div id="myContent"></div>

swfobject.embedSWF("myContent.swf","myContent","300","120","9.0.0"

);

Page 14: You Know WebOS

Code: Widgets

Simple slider widget in jQuery

<div id="slider"></div>

$("#slider").slider();

Page 15: You Know WebOS

Code: Widgets

TextField in Mojo

<div id="searchString" x-mojo-element="TextField"></div>

this.controller.setupWidget("searchString",{

hintText: 'enter search criteria',multiline: false

},this.searchModel = {

value: “”}

);

Page 16: You Know WebOS

Differences: JavaScript

It is not like Java or a scripting language More like Self or Scheme It has objects, but no classes Functions can have properties

(which can be functions themselves) “this” isn't always that

Page 17: You Know WebOS

Differences: Mojo API

Any platform has a set of APIs, Mojo is no exception

Page 18: You Know WebOS

What Next? Learn JavaScript

JavaScript: The Good Parts

Douglas Crockford

Page 19: You Know WebOS

What Next? Get Mitch's Book

Palm webOS

Mitch Allen

Available through O'Reilly

Page 20: You Know WebOS

One Last Resource