Friday, July 31st, 2009...07:12
First webOS App
I finished version 0.1 of my first Palm webOS application last weekend. The Palm Pre has a GPS chip in it but there are no applications that expose the raw data, as a dedicated GPS would. As I’m about to embark on a 9 day hike around the rim of Lake Tahoe, I decided to look into what it would take to give the Pre some additional location based functionality which might come in handy on my hike. The goals I set for a version 0.1 application was to clone the basic functionality of Spot:
* Display latitude/longitude/altitude
* Store an emergency contact number
* Easy way to alert emergency contact number of my current location
Of course, before I could get started on any of that, I had to setup a working development environment and familiarize myself with how a webOS application works. Palm has an SDK for Windows, Mac and Linux (Ubuntu). In order to maximize the amount of time I had to work on this, I went with the Linux install, as I have Ubuntu running on my Eee PC and it goes almost everywhere with me. The SDK contains an emulator running inside a virtual machine (VirtualBox). The high-level overview of how development works is:
* Write code
* Package and deploy to the emulated device
* Test
* Repeat
* Deploy to the actual device
There is an Eclipse plug-in, but I have not tried it yet. VirtualBox takes a decent amount of system resources, as does Firefox (open all the time to reference documentation), so running Eclipse as well was not really an option on my Eee PC…
I spent quite a bit of time futzing with the documentation, which while not terrible, wasn’t fully baked yet. If I had to do it all over again, here is how I would structure the initial foray:
- Get the HelloWorld application running. This will introduce you to the concepts of stages, scenes and assistants.
- Add a file called framework_config.json to the HelloWorld application directory. In this file, put: {“logLevel”:20}. This will instruct the system to log Info and Warning levels in addition to Error. Familiarize yourself woth Mojo.Log and viewing the log for HelloWorld using novaterm.
- Build and install the “Style Matters” application found in: /opt/PalmSDK/Current/share. This application is a big demo of lots of the webOS UI widgets. Some of the scenes have source code displayed in them, but it’s sometimes easier to look at the source in the stylematters directory.
At this point you’ll likely have enough knowledge to make quick and meaningful progress building your own application. Depending on what the application will do will likely define what you learn next. Perhaps the most pressing need will be storing client-side data, interacting with services found on the device or running your application “headless”.
Here are a couple of screen shots of the application.
In my field test both the GPS and SMS messaging failed quite a bit due to lack of reception, so it’s certainly not a replacement for Spot, but at least it gave me a taste of what developing a webOS application was like.
Comments are closed.