Digging Through the Latest webOS Developer Details

Posted by: Ryan Kairer on 2/17/2009 2:57:40 PM EST

On Monday, Palm posted a rough draft of the first chapter of an upcoming webOS programming book, written by core members of the webOS team. Now that Palm has released some specific information about developing for webOS, we take a closer look at some of the new details and functionality within webOS and the Mojo SDK.

Like any first chapter in a programing book, its begins with a philosophical overview of the development model without going to heavily into the specifics. However, now that we've had time to read it over, a number of new details are presented and developers interested in a head start should definitely take a look.

webOS Architecture

The book's first chapter starts out by giving a architectural look into webOS stating:

Architecturally, Palm webOS is an embedded Linux operating system that hosts a custom User Interface (UI) System Manager built on standard browser technology. The System Manager provides a full range of system user interface features including: navigation, application launching and lifecycle management, event management and notifications, system status, local and web searches, and rendering application HTML/CSS/JavaScript code.

[...] The core OS is based on a version of the Linux 2.6 kernel with the standard driver architecture managed by udev, with a proprietary boot loader. It supports an ext3 filesystem for the internal (private) file partitions and fat32 for the media file partition, which can be externally mounted via USB for transferring media files to and from the device.

webOS Architecture

What is Mojo?

palm mojo sdk webosEssentially, Mojo is a built in JavaScript application framework for accessing the webOS APIs. It is complimented by the use of the existing HTML5, CSS, and JavaScript standards to control application presentation and actions. Most of the main webOS application functionality will mainly be written in Javascript accessing the custom, built in Mojo JavaScript framework and extensions and related service API's. While layout and presentation is done in standard HTML and CSS.

Unlike most Javascript frameworks on the web today, Mojo does not need to be explicitly included or declared in your code. It is always present as it is the main interface of Palm's application framework. The framework will also provide access to events and some gestures using the DOM (Document Object Model) Level 2 event model. Palm has also made of a number of extensions to the DOM model for custom webOS controls and functionality.

In addition to the Mojo framework, the book reveals that the Prototype JavaScript framework will be bundled with Mojo to assist with registering for events and DOM handling. Prototype is one of the many JavaScript frameworks out there today that simplify a number of JavaScript tasks for web developers. Prototype specializes in reducing the complexity of DOM events and Ajax functionality. It is not clear at this point if it will be bundled within webOS itself as the book draft states it is not "formally" part of the Mojo framework.

Back at CES, I asked a Palm rep about using existing JavaScript frameworks with webOS such as jQuery, and he indicated that developers should not have any issues if they want to use jQuery or any other JavaScript web toolkit.

Data storage is handled via the HTML5 storage functions will will allow developers to create on device databases. Its built on top of a SQLite layer and will provide high-level functions to support simple Create, Read, Update or Delete (CRUD) operations. Developers will also be able to access data from some of webOS's core applications, such as Contacts and Calendar.

The framework also includes notification services for popup messages and unobtrusive "banner" messages and a multi-tasking model. Applications can run in the background, managing data, events and services behind the scenes while engaging the user when needed.

Another important aspect of Mojo is its access to a device services API. Palm makes the case that the services functionality will "bridge the web and native app worlds" on the webOS platform. Through the Services APIs, developers will be able to access hardware features (such as location services, accelerometer data, the phone, and the camera). Palm also goes on to state that developers can leverage the core application data and services that have always been a key part of a Palm OS device.

Services will be accessed via a single controller function, serviceRequest. The request passes a JSON object specific to the called service and specifying callbacks for success and failure of the service request.

WebOS applications need to be signed for installation on a webOS device. Palm's Developer Portal will be providing application signing services as well as access to Palm's on-device Application Catalog.

webos email banner screenshot mojo sdk webos screenshot

What the SDK Will Include

webos cheese?While its still not clear when the official SDK will be made available (the latest rumors point to the time of the Pre's first release on Sprint), the book does detail what it will include and what platforms it will be compatible with. The SDK includes the development tools, sample code, the Mojo Framework, along with access to the Palm Developer Wiki, where developers will find formal and informal training materials, tutorial and reference documentation. Palm also provides registered developers with direct technical support by email or through interaction in a hosted developer forum.

The Palm Developer Tools (PDT) are installed from the SDK and include targets for Linux, Windows (XP/Vista) and Mac OS X. The tools enable you to create a new Palm project using sample code and framework defaults, search reference documentation, debug your app in the weOS emulator or an attached Palm device, and publish an application.

The tools can be installed and accessed as command-line tools on every platform and include some bundles for integration into popular HTML editors and as a plug-in to Eclipse and Aptana Studio, a popular Javascript/HTML/CSS editor for Eclipse.

This is just a brief summation of some of the new information contained within the recently released rough draft first chapter of "Palm webOS: Developing Applications in JavaScript Using the Palm Mojo Framework." I'd highly encourage anyone who's interested in developing for the Palm Pre and webOS to give it a read. The chapter goes into a number of areas I did not cover here including application setup and behavior. Anyone interested in a head start on webOS development should also checkout the prototype framework and perhaps even start getting comfortable with Eclipse and Aptana Studio.

Read the 28 Comments | Comment Comment On This