Digging Through the Latest webOS Developer Details

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.

Article Comments


The following comments are owned by whoever posted them. PalmInfocenter is not responsible for them in any way.
Please Login or register here to add your comments.

Start a new Comment Down

need more time!

freakout @ 2/18/2009 1:05:12 AM # Q
dammit, you know what this is going to do? I'm going to convince myself that it won't be that hard to brush up on my web-coding skills and possibly make an app myself... and then waste hours and hours and hours of time realising that it's a lot harder than it looks from the outside.

Still, I'm excited by the possibilities. HTML and Javascript don't frighten me like C does.

RE: need more time!
SeldomVisitor @ 2/18/2009 4:11:36 AM # Q
> ...HTML and Javascript don't frighten me like C does.

That is a totally strange phobia, IMHO.

RE: need more time!
freakout @ 2/18/2009 5:24:46 AM # Q
Maybe, but there's certainly weirder ones out there...

Arachibutyrophobia- Fear of peanut butter sticking to the roof of the mouth.

Apotemnophobia- Fear of persons with amputations.

Logizomechanophobia- Fear of computers.

Oneirogmophobia- Fear of wet dreams.

Trichopathophobia or Trichophobia- Fear of hair. (Chaetophobia, Hypertrichophobia)


RE: need more time!
SeldomVisitor @ 2/18/2009 5:48:55 AM # Q
Can't argue with that!

But, IMHO, if you're willing to "give it a go" in ANY programming language, C certainly should be one you fear LESS than...gack!...javascript.

Here's some neato javascript open-sourced ya can try out on yer Pre...er...or whereever...: http://www.dynamicdrive.com/

RE: need more time!
NuShrike @ 2/18/2009 10:10:34 AM # Q
It certainly makes sense to program the UI layer in Javascript instead of raw C since the DOM interface is designed quite well and obsoletes a lot of the grunt work needed to produce a nice looking and working UI interface compared to MFC/WTL, etc.

However, C/C++ is still needed to have efficient core app logic running efficiently on the CPU, so I hope Palm gives more details in this area soon.

Palm III -> Sony NR610C -> Sony NR70 -> Sony NX80 -> Palm T|X -> HTC Kaiser -> HTC Fuze

Reply to this comment

How is app deployment done ..

skeezix @ 2/18/2009 6:42:28 AM # Q
Are applications bundled into zip files named myapp.webos or something? I wonder what layout they must take.

Apps must be signed, but presumably there will be an unlock tool to make all apps runnable, for development sake.

A lot of devs are really on the edge of their seat wondering - if apps are plaintext or in zip files or something .. how are they to be protected? Are all apps going to be plaintext visible?

Perhaps the SDK includes a JS compiler to some webos specific VM (ie: akin to java .class or precompiled python .pyc files, etc.)

Fun times..


The Shadow knows!

RE: How is app deployment done ..
freakout @ 2/18/2009 1:19:52 PM # Q
Regarding the app layout, the book says:

Palm webOS applications are required to use directory and file structure conventions to enable the framework to run the applications without complex configuration files. At the top level the application must have an appinfo.json object, providing the framework with the essential information needed to install and load the app. In addition, all applications will have an index.html file, an icon.png for application's Launcher icon, and an app folder, which provides a directory structure for assistants and views.

By convention, if the app has images, other javascript or application-specific CSS, then these should be contained in folders named images, javascripts, and stylesheets respectively. This is not required but makes it simpler to understand the application's structure.

Launching a webOS application starts with loading the index.html file and any referenced stylesheets and javascript files, as would be done with any web application or web page.

As for protecting source, Mitch Allen noted in the comments on the Palm developer blog:

We are definitely going to have a tech note in the SDK on protecting your JavaScript source code and perhaps we can work that into the book. It is a key concern for some developers, but for many others have found that it's easier and more secure to put the differentiation in the web services or data provided with the application.

Fun times indeed

RE: How is app deployment done ..
SeldomVisitor @ 2/18/2009 1:36:01 PM # Q
The latter is difficult.

There is some concern, too, about the need to sign all apps that can be loaded on the Pre - I haven't found too much on that other than:

== ... 13.) Will there be restrictions on apps?
== Palm will certify all developers and approve all apps, but
== only to make sure they work properly. They won't kill apps
== for content-related reasons like Apple does. Think Android,
== not iPhone...

- http://www.pcmag.com/article2/0,2817,2338583,00.asp

BTW - I can imagine all SORTS of horrendous sideeffects of getting an unproven app on the Pre...like by a Bad Guy with a web site loaded JUST to hack into the Pre's javascript, say...

RE: How is app deployment done ..
skeezix @ 2/18/2009 5:18:02 PM # Q
In practice historically, that isn't so much a problem. ie: Palm OS runs unsigned apps, and theres really not all that many hostile ones. And the 3 or 4 there were got found out pretty fast and banned..

More to point, consider the thing is all about web interactivity apparently; I'd be less worried about unsigned apps than just naughty javascript in the wild on websites, with respect to security. The app signing is purely there to make an app-store more viable, not so much for security.

It does worry me about so much data dependancy .. the hint above that the best place to hide your code is in your web service, for instance. Hopefully theres a lot of love for those of us without inexpensive data plan options, and the device still working when in the elevator/subway when you dont' have 802.11, GPRS or anything :)

At the same time .. it is very interesting they're standardized on JS and CSS/HTML5 .. pretty darned gutsy and cool for a lot of things.


The Shadow knows!

RE: How is app deployment done ..
skeezix @ 2/18/2009 5:22:08 PM # Q
Anyone seen more videos than me? I keep wondering about music and video playing, for instance.

ie: Presumably there wil be a Mojo set of APIs in JS to invoke the multimedia player. Or perhaps its just a fancy url, like media:///sd card/music/foo.mp3 or something. Anyway, I had originally assumed they'd have a flash version in there so it'd work like youtube or the like, and also support flash games and apps, killing a few birds with one stone.

But with flash not being there on day zero, it must be their own API. Hopefully it allows for embedded video player components, or even crazy SVG-video or the like so you can rotate it around. I think thats all HTML5 magic, but I've not looked so a big guess. Palm are pretty smart when it comes to makin things flexible.. but I am highly curios; I hope all the stuff built in is embeddable and re-usable.

I can spew out random questions all day .. Enquiring minds are dieing to know :)


The Shadow knows!

Reply to this comment

And Gekko goes retro

mikecane @ 2/18/2009 5:51:20 PM # Q
He comes to my frikkin Pre blog and leaves a link that has nothing to do with anything Pre related!

Did he leave that link here too?


FYI Gekko, I *saw* that a day before your link showed up. Try again.

As for all you Pre devs, get to work on a software-based TARDIS!

RE: And Gekko goes retro
abosco @ 2/18/2009 8:58:28 PM # Q
I still don't understand why you're so interested in the Pre vs the iPhone that has been available for two years now. Because the Pre has some mass integration feature that the iPhone doesn't have? I see a keyboard, cards, and a platform that has no support. And just like that, you go from "COLLIGAN, RESIGN!" posts to "ALL HAIL COLLIGAN!" I don't get it. His company made an iClone. What mass turnaround am I missing here? Because they aren't de-listed yet?

Gekko, if you're reading this, short Palm. Short 'em now. $8 won't last. This company has been smoke and mirrors since 2000.

m105 -> NX70v -> NX80v -> iPhone -> iPhone 3G

RE: And Gekko goes retro
akalefty @ 2/19/2009 3:25:12 AM # Q
And just like that, you go from "COLLIGAN, RESIGN!" posts to "ALL HAIL COLLIGAN!"

Oh, I get it: Short Attention Span Theater.

RE: And Gekko goes retro
mikecane @ 2/19/2009 7:09:44 AM # Q
@absoco: I can wait for you to catch up.

@akalefty: And where were all those Abcess devices at MWC? Oh right, there WERE NONE. Go back to triumphing about getting that crap failed OS into 99-cent keychains.

RE: And Gekko goes retro
abosco @ 2/19/2009 11:38:48 AM # Q
Three reasons why nobody will give a shit about the Pre:

1) Stupid name. Consider this a trivial offense, but don't take it lightly. Companies spend a lot of time, effort, and marketing money trying to get a catchy name to stick. What the hell is a Pre? Palm PREmortem?

2) It's going to be too late. Enjoy your CDMA exclusivity for 3-6 months - and that's after it comes out in March (not even confirmed!). That puts it in the timeframe to be released on AT&T after the third iteration of the iPhone. They're behind the 8-ball, since they're betting the bank on people liking the Pre better than the iPhone 3G. It will be like trying to convince people Vista is better than Mac OS 9.

3) It's nothing new. Cry and wail as much as you want about its innovative cloud computing, but its integration is solving a problem looking for a solution. People don't need what it's offering, and they sure as hell aren't going to pay the Palm PREmium price for it. This is going to be fighting for space next to a wildly popular iPhone consumer platform, a surging Blackberry enterprise market, and Android devices that are already realizing problems finding a niche. Palm has nowhere to specialize, and seeing how this is their only business, they don't have the time nor resources to outlast the competition like Microsoft does.

m105 -> NX70v -> NX80v -> iPhone -> iPhone 3G

RE: And Gekko goes retro
freakout @ 2/19/2009 1:32:25 PM # Q
^^ 1) I thought Wii was a stupid name when I first heard it. I still do. Hasn't stopped it from being one of the biggest success stories in consumer electronics history.

2) Third iPhone still won't have a keyboard, or a removable battery, or non-crippled Bluetooth, or sync with anything other than iTunes, or yada yada. I reckon you underestimate the number of people who want the cool multitouch, but despise Apple's artificial limitations. Or those who simply aren't willing to switch to AT&T. (Sprint may be a sinking ship, but it's still got millions of subscribers, many of whom are likely real interested in a hot new phone.)

And why is this an either/or thing, anyway? The smartphone market continues to grow massively. There's room enough for everyone to be successful.

3) "Cry and wail" all you like about Synergy not being innovative (mainly because Apple didn't come up with it first, I'm guessing :P ), it's the wave of the future. Internet-integrated devices are the way the world's going. It's the new paradigm. Deal with it.

RE: And Gekko goes retro
mikecane @ 2/19/2009 3:19:04 PM # Q
We all thought Wii was a stupid name. But think of it spelled in English: Whee. As in fun.

Abosco is feeling some iPhone panic there, I see. Up until now he's made sense when defending his iPhone. Give it a real competitor and he goes all freakish, pulling at straws. Suddenly there's a new popular kid on the block and it's not from Apple.

And SV just gets the usual /ignore

RE: And Gekko goes retro
abosco @ 2/19/2009 3:43:45 PM # Q
2) Third iPhone still won't have a keyboard, or a removable battery, or non-crippled Bluetooth, or sync with anything other than iTunes, or yada yada. I reckon you underestimate the number of people who want the cool multitouch, but despise Apple's artificial limitations. Or those who simply aren't willing to switch to AT&T. (Sprint may be a sinking ship, but it's still got millions of subscribers, many of whom are likely real interested in a hot new phone.)

Then how do you explain the failure of the G1? I'm curious. It has a keyboard, removable battery, non-crippled Bluetooth, sync with Exchange, and an open-source OS.

Maybe people don't actually care about brute-force features after all?

3) "Cry and wail" all you like about Synergy not being innovative (mainly because Apple didn't come up with it first, I'm guessing :P ), it's the wave of the future. Internet-integrated devices are the way the world's going. It's the new paradigm. Deal with it.

I'm not convinced at all. Tim, I could see if last year you were complaining about the scattered nature of your applications on the Treo and the need to consolidate your information. But I don't remember you mentioning that as a problem anywhere. I remember complaining about my old shitty phones' user interfaces being unintuitive and a hassle to use. I was the "Software Expert" for PalmSource for browsers years back, and I knew that there wasn't anything available worth shit for Palm OS. When the iPhone came out, the multi-touch UI and Safari got me the most excited. That's what brought me in. What brought you in to the Pre? The Palm name. There's a VERY limited number of people who are drawn in for that same reason.

A lack of real need for Synergy, plus the stupid exclusivity through 2009 to a provider in third place and bleeding subscribers, is the reason why the Pre will see no success.

m105 -> NX70v -> NX80v -> iPhone -> iPhone 3G

RE: And Gekko goes retro
Gekko @ 2/19/2009 4:00:28 PM # Q

is the G1 a failure?

RE: And Gekko goes retro
abosco @ 2/19/2009 4:09:44 PM # Q
Ever seen one?

m105 -> NX70v -> NX80v -> iPhone -> iPhone 3G
RE: And Gekko goes retro
twrock @ 2/19/2009 5:41:18 PM # Q
I still don't understand why you're so interested in the Pre vs the iPhone....

I do have a aversion to the iPhone, although stuff I'm hearing about the Pre is making me wonder whether or not I should be having the same concerns about the it.

It's basically a company culture thing. Apple creates cool products and then locks them down in a way that keeps people from getting the full functionality out of them they could. You have to use them the way the company wants you to use them. They even try to tell you it's illegal to figure out how to get the most out of the device. And you not only pay a premium up front, you keep paying because you are locked in.

One of the main things I've liked about my Palm products up to this point was the "open" nature of the system. We had all these different developers who could tweak the crap out of the Palm system, finding extra functionality in the software and hardware, allowing me to create the devices I wanted and use them the way I wanted to use them. Moving to an iPhone (or possibly a Pre?) was in some important ways too much of a step back at a time when I'm looking for increased freedom from my computing products (which is how I look at a PDA or true smartphone).

It's a bit hard to put it down on paper. But I'm having "philosophic issues" with where all these proprietary, locked-down systems are trying to take me. I guess my eyes have become too open by my increased use of opensource software over the past few years and it's hard to go backward.

And Android is interesting me too. But since I can still wait, I have the luxury of sitting on the sidelines and just waiting to see what happens with all these companies, their OS's, and their products. Who knows? Maybe in the end I'll be content to live in a gilded cage, whether it be Apple's or Palm's.

"twrock is infamous around these parts"
(from my profile over at Brighthand due to my negative 62 rep points rating)

RE: And Gekko goes retro
mikecane @ 2/19/2009 6:21:00 PM # Q
>>>is the G1 a failure?

>>>Ever seen one?

ROTFLMAO!!! So where's the guy who jumped on *me* over my disdain for the G1 and Android, eh?

Yeah, I also saw vids of the HTC Magic. Same FAIL, different lipstick. Adapter dongle for earbuds (WTF?), no MultiTouch. Yawn.

RE: And Gekko goes retro
freakout @ 2/19/2009 7:57:40 PM # Q
Then how do you explain the failure of the G1?

it's an ugly, undesirable brick. And it doesn't have the cool multitouch. Pre is hawt, dawg.

I'm not convinced at all. Tim, I could see if last year you were complaining about the scattered nature of your applications on the Treo and the need to consolidate your information.

As you might remember, I made a list the week before CES of what I wanted from Nova...


Number three on the list was Superior Sync:

Palm Desktop and Hotsync: these were once great answers to the age-old problem of personal information management. But just like the classic Treo form factor, they're looking more than a bit long in the tooth come the 21st century. It's time for a revolution in sync and Palm, with their history of great PIM solutions, are uniquely positioned to do something about it. Palm Desktop and Hotsync need either a total makeover, or to be completely junked. A modern solution should give us... blah blah blah

That aside: my main complaints with the Treo/Centro were an unstable, aging, ugly OS, low-spec hardware and a crummy web browser. Pre handily fixes all of them. I'd like Garnet compatibility and an SD slot, but they're not dealbreakers.

Reply to this comment

Anyone know?

Piero @ 2/18/2009 6:39:49 PM # Q
if there will be a "next version" release of the nokia810 this year?

Reply to this comment

Development question

madmaxmedia @ 2/19/2009 10:39:07 AM # Q
So from reading this first chapter, can anyone glean whether PreFart/PreMyFinger will be possible with WebOS, or will deeper machine-level access be required?

RE: Development question
Ryan @ 2/19/2009 10:55:19 AM # Q
I image it would be easily possible. There is not much you could not replicate in that app via Javascript and js libraries and I'm sure there will be some sort of sound/media api included.
Reply to this comment

Palm WebOS: SQLite offers powerful data manipulation

jaygodse @ 2/24/2009 7:15:51 AM # Q
That's great to see that another embedded platform has incorporated SQLite. SQLite offers all of the powerful data manipulation features of SQL. This means that the embedded developers can actually design normalized data structures, and not worry about writing tedious and error-prone algorithms to manipulate the data. Just use SQL queries, and prove them out on your workstation using the command line tools before running them on the Palm target. It can make embedded developers more productive. SQLite also has in-memory databases if you want to really go whole-hog on using SQL for your data instead of home-grown data structures.

Check out http://www.squidoo.com/sqlitehammer for more ways on how to use SQLite.

Reply to this comment
Start a New Comment Thread Top


Register Register | Login Log in