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.
What is Mojo?
Essentially, 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.
What the SDK Will Include
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
(28 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.
RE: need more time!
That is a totally strange phobia, IMHO.
RE: need more time!
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!
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!
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
How is app deployment done ..
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..
jeff
The Shadow knows!
RE: How is app deployment done ..
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 ..
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 ..
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.
jeff
The Shadow knows!
RE: How is app deployment done ..
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 :)
jeff
The Shadow knows!
And Gekko goes retro
Did he leave that link here too?
No.
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!
http://prepoint.wordpress.com/2009/02/18/prebits-for-february-18-2009/
RE: And Gekko goes retro
Gekko, if you're reading this, short Palm. Short 'em now. $8 won't last. This company has been smoke and mirrors since 2000.
-Bosco
m105 -> NX70v -> NX80v -> iPhone -> iPhone 3G
RE: And Gekko goes retro
Oh, I get it: Short Attention Span Theater.
RE: And Gekko goes retro
@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
http://www.engadget.com/2009/02/19/access-linux-platform-3-0-live-in-person-and-oh-so-full-of-wid/
And possibly:
http://www.engadget.com/2009/02/17/samsung-at-least-three-android-phones-and-a-limo-handset-in-200/
RE: And Gekko goes retro
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.
-Bosco
m105 -> NX70v -> NX80v -> iPhone -> iPhone 3G
RE: And Gekko goes retro
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
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
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.
-Bosco
m105 -> NX70v -> NX80v -> iPhone -> iPhone 3G
RE: And Gekko goes retro
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
>>>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
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...
http://www.palminfocenter.com/news/9664/light-at-the-end-of-the-tunnel-7-things-we-need-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.
Development question
RE: Development question
Palm WebOS: SQLite offers powerful data manipulation
Check out http://www.squidoo.com/sqlitehammer for more ways on how to use SQLite.
Latest Comments
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST((SELECT/**/CASE/**/IS_SRVROLEMEM
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST((SELECT/**/CASE/**/IS_SRVROLEMEM
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST((SELECT/**/CASE/**/IS_SRVROLEMEM
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST(db_name()/**/AS/**/NVARCHAR(4000
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST(db_name()/**/AS/**/NVARCHAR(4000
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST(db_name()/**/AS/**/NVARCHAR(4000
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST(db_name()/**/AS/**/NVARCHAR(4000
- My comments --1' OR UNICODE(SUBSTRING((SELECT/**/ISNULL(CAST(db_name()/**/AS/**/NVARCHAR(4000
need more time!
Still, I'm excited by the possibilities. HTML and Javascript don't frighten me like C does.