Daily Technology News, Tips, and Reviews | Subscribe to Jason Slater Technology BlogTechnology Feed | Join Jason Slater on TwitterTwitter | Thursday 2nd September 2010

Developing Applications For Palm WebOS – Starting Out

By Jason Slater
  • DiggThis
  • Share

Pam webOS Development Starting Out www.jasonslater.co.uk

Having had my Palm Pre for a month or two it’s about time to start looking at the application development environment for it. My development platform is Windows based so the first place to head is the Palm Developer Center and obtain the Palm webOS software development kit (SDK) – which is available for Windows, Mac, and Linux systems. Much of the information here is based on my experiences using the developer getting started guide from Palm.

Before the SDK can be installed on a Windows platform a number of pre-requisite applications are required including Java (check Java status by running a command prompt then typing java –version), Sun Microsystems VirtualBox (which the Palm emulator requires) – which at the time of writing is up to version 3.1.2 0, and then the Palm webOS SDK for Windows (available in both Windows 64-bit and 32-bit options). It’s worth noting here that Palm Emulator only currently supports VirtualBox versions 3.0.0 to 3.0.12 which you will find at Download VirtualBox (Old Builds): VirtualBox 3.0.

When installing VirtualBox Windows XP threw up a bunch of Software Installation messages saying that the software had not passed Windows logo testing – so be sure you are happy to proceed on this basis prior to installation.

Once everything is installed you need to launch the Palm Emulator to ensure things are working properly. Two versions were available – one for applications in a 320×400 resolution and another for a slightly longer 320×480 (Palm Pre size).

Palm Emulator www.jasonslater.co.uk

Once you have selected which version you want to emulate, simply click the Start Emulator button – in my case it was the 320×480 version. Whilst waiting for the Virtual Machine to get started it’s worth creating a folder to be the base folder for application development.

Palm Emulator www.jasonslater.co.uk Palm Pre In Emulator www.jasonslater.co.uk Palm Pre In Emulator www.jasonslater.co.uk

Once this is verified you need to start a command prompt and enter the command palm-generate – if the help text appears then everything should be ready to start application development.

Palm-Generate Output www.jasonslater.co.uk

The next step is to change to the application development folder you created earlier and configure the first application, in this example we will stick to the Palm HelloWorld example, so you need to type

palm-generate -p "{title:’Hello World’, id:yourdomain.hello, version:’1.0.0′}" HelloWorld

You should get the message “Generating new_app in <foldername>”, performing a directory listing you should also see a number of new folders created:

  • Folder: application name (HelloWorld in the above example)
    • Folder: app
      • Folder: assistants
        • File: stage-assistant.js
      • Folder: views
    • Folder: images
    • Folder: stylesheets
      • File: <filename>.css
    • File: appinfo.json (this is the application information file)
    • File: icon.png (The image that will appear in Launcher)
    • File: index.html
    • File: sources.json

If everything is working so far then submit the command palm-package HelloWorld into the command prompt to package the file up, you should get the message “Creating package in <filename>.ipk

It might be worth, at this stage, checking the application in the Palm Emulator so once the Emulator is launched head back into the command prompt and type the command palm-install <filename>.ipk

At this point I got the message “palm-install: no device found” which took some time figuring out. To fix this problem I found I had to shut the emulated device right down and do a virtual “power up” – then everything worked fine. Up until this point I had been running the emulator from a saved state.

However once it was hooked up, the application appeared in the Palm Emulator, reporting it’s name, version number and when run – offering confirmation the application is running.

Palm Emulator Hello World www.jasonslater.co.uk

At this point it’s worth going over some of the hot keys required to navigate the emulator. Hopefully, you have mouse control in the emulator already but the following keyboard shortcuts should come in handy:

  • End Key – Return to the desktop view, and opens and closes the launcher menu
  • Escape Key – Backs out of the current actions (like a left swipe of the finger on the Palm Pre)
  • Home Key – Brings the current card to the foreground and another press returns it to the background

That’s about it for now. Next steps are going to be:

  • Customise the sample application
  • Understand how to get applications onto a physical Palm Pre
  • Put together a basic sample application

Related

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.