Palm webOS in 10 Minutes

Palm webOS in 10 Minutes

(but only if I talk too fast)

Who's This Guy?

Serial enthusiast and general tinkerer at decafbad.com

Author of books, most recently Professional JavaScript Frameworks from Wrox

Jack-of-All-Trades on the Mozilla Webdev team
(I telecommute from my basement in Livonia)

Developer of two small webOS apps released to the homebrew community

What is webOS?

webOS is Palm's new mobile operating system

It's based on embedded Linux

It uses Apple's WebKit as an application runtime

Apps are built using HTML, CSS, and JavaScript

Currently available on the Pre and soon on the Pixi

What about the webOS SDK?

Free to download, cross-platform

Emulator runs as a disk image in VirtualBox

Developer Mode on device (a.k.a. the Konami code) unlocks a Linux shell and full root access

No certificates are required to install & test software
(unlike the iPhone)

What about the webOS SDK?

Basic tools are Java-based shell commands

Use TCP (emulator) or USB (device)

Tools to generate, package, install, and run apps

Inspector connects via TCP to emulator

Inspector allows live DOM/CSS tweaks and JavaScript shell with message log

What about the webOS SDK?

IDE integration is available

Using Eclipse (officially supported)

Using Komodo Edit (community supported)

Personally, I prefer Vim and a makefile

JSLint is highly recommended
(package/install/launch takes longer than a page refresh)

Application runtime

Apple WebKit 3.2 with patches by Palm

Apple's JavaScriptCore replaced by Google V8

AJAX / XMLHttpRequest without domain restrictions

HTML 5 Web Database support

Subset of <canvas> features

Access to system services via JSON messages

Multitasking UI

One or more cards per app
(think chrome-less browser windows)

One stage per card
(basically the DOM document)

A stack of scenes per stage
(container <div>s inside stage body)

Gestural touch navigation for cards and scenes
(think Minority Report)

Multitasking UI

Growl-like background notifications

Dashboard panels for background interaction

Modal dialog style alerts

Mojo

Palm's mobile MVC framework based on Prototype

Assistants in JS for app, stages, and scenes
(consulted by built-in controller objects)

Common HTML/CSS/JS widgets
(finger-sized and webOS-themed)

Custom events defined for gestures and widgets
(eg. tap, flick, pinch/spread, orientation, shake)

Mojo

Partial HTML templates used for scenes and widgets

CSS used to customize system styles

Access to OS / hardware via JSON messages
(eg. accelerometer, audio, camera, GPS, phone, video, inter-app messaging, media DB access, etc.)

Prototype provides the rest
(eg. AJAX, DOM, JSON, etc)

Homebrew App Repositories

The official Palm App Catalog is in beta

New apps subject to a backlogged review process

But, adventurous users can install apps from homebrew app repositories like PreCentral and Preware

Palm has done nothing to prevent this

Works great for recruiting early test pilots

webOS Internals Group

Exploring & documenting everything in webOS
(even "private" APIs)

Not supported by Palm, but no efforts to stop them

Almost all Palm code on device is unobfuscated HTML/CSS/JS

Other code is mostly Java, easily reverse engineered

Mods to webOS system files and core apps are distributed as patches and applied with quilt

Embedded Linux & OSS

$ uname -a
Linux castle 2.6.24-palm-joplin-3430 #1 175.1.23 armv7l GNU/Linux

Largely based on Open Source Software packages

Nearly 1700 packages from Optware embedded Linux repository can be installed—and most work

...including a LAMP stack, running WordPress!

Thank you! Questions?

http://decafbad.com/2009/09/a2div-webos/

CC BY-SA 3.0

HTML5 Slideshow stolen from Edward O'Connor