Home > Pre, Programming > Tutorial: Palm Pre SDK

Tutorial: Palm Pre SDK

The Palm Pre SDK, named Mojo, is not supposed to be available to the general public of developers for a few months.  Apparently it was leaked on the internets last night.  I was able to get a Hello World program running on the emulator.  Here is how I did it.

Environment:
Windows XP
Java JDK 1.6.0_11 (any 1.6 probably works)
Any modern CPU should work.  Mine is 32 bit – not sure about 64 bit.
The emulator takes ~300MB of memory so you’ll probably want at least 1GB.I’ve got 2GB

1 – Download and install VirtualBox
(http://www.virtualbox.org/wiki/Downloads).  I am using version 2.2.4

2 – Download and install the SDK.
Palm has the SDK available for free download.  I think registration is required.
link: http://developer.palm.com/index.php?option=com_content&view=article&layout=page&id=1788

3 – Start the Emulator.
When the SDK finishes installing you should see a “Palm Emulator” icon on your desktop.  Open it.

The emulator should start up and it should look like this:

Linux kernel starting

Starting Linux

The splash screen

Splash screen

Finished!

started

Ok, you’ve got your emulator running.  Now its time for the fun part.  Lets make a program!

4 – Open up your command prompt (start-run-”cmd”).   If you’re running vista, make sure you run “cmd” as Administrator.  Navigate to ‘Program Files\Palm\SDK\bin’.  Type in “palm-generate helloWorld” to create the shell of a hello world program.  The output should say “Generating new_app in C:\Program Files\Palm\SDK\bin\helloWorld”

5 – Go into your new helloWorld directory and modify index.html.  Now we’re just programming a web page!

Hello World

Hello World

6 – once you’ve modified and saved index.html, go back to the command prompt and run “palm-package helloWorld”.  It should create a .ipk file in the bin directory.

7 – run “palm-install <name of .ipk file>”  Mine got named ‘com.yourdomain.helloworld_1.0_all.ipk’.  At this point you will want to make sure that your emulator is still running.

install

7 – Go to your emulator and run the program!

Program Menu

running

8- Profit!

6/28/2009-updated with hardware specs

5/1/2010 – linked to SDK download through palm.com

Categories: Pre, Programming Tags:
  1. will
    June 27th, 2009 at 16:37 | #1

    any ideas on how to get this running on OS X? Also is there a TextMate bundle floating around yet?

  2. Matthew
    June 27th, 2009 at 17:26 | #2

    I get a “the system cannot find the path specified” when running the palm-generate helloWorld (helloWorld\appinfo.json – the system cannot find the path specified)

  3. Matthew
    June 27th, 2009 at 17:34 | #3

    Doh! Had to run cmd in administrator mode. Oops.

  4. June 27th, 2009 at 17:52 | #4

    @will
    Don’t know the answer to either :(

  5. June 27th, 2009 at 19:23 | #5

    Thank you SO MUCH for posting this Chris! I’ve been looking for a quick get started guide. I downloaded the SDK, and got the emulator running, but had no idea how to start coding, or get the code into the emulator. Now the fun starts…

  6. June 27th, 2009 at 20:29 | #6

    Thanx, Chris.

    I don’t like having to use the command line. I know it’s old hat for old timers but noobs need niceties, y’no?

  7. frankos72
    June 27th, 2009 at 22:34 | #7

    Dood!! You rock. Thanks for the tutorial.

  8. June 27th, 2009 at 23:55 | #8

    @Colonel Kernel
    If you are really serious about developing an app with this thing you could use Eclipse and wire up an “external tool” to invoke the package or install in one button click.

  9. ulises v
    June 28th, 2009 at 00:39 | #9

    u should post a vid to understand it better mine says the system cannot find the path specified)

  10. dave
    June 28th, 2009 at 02:03 | #10

    I’ve installed win xp sp3 on virtualbox 2.2.4r47978, and when i start the palm emulator on the vm, I get the following error:

    “Palm Emulator requires that VirtualBox 2.2.0 or greater is installed”

    2.2.4 should be > 2.2.0. Has anyone else encountered this

    Thanks

  11. czechdev
    June 28th, 2009 at 02:38 | #11

    @will
    sure, you can run the emulator (don’t know if the whole SDK) both on Mac OS and Linux http://forums.precentral.net/web-os-development/189062-mojo-sdk-download-6.html#post1714406

  12. David
    June 28th, 2009 at 02:56 | #12
  13. Caldera
    June 28th, 2009 at 04:28 | #13

    I am getting this error in generating:

    C:\Program Files\Palm\SDK\bin>palm-generate.bat helloWorld
    Generating new_app in C:\Program Files\Palm\SDK\bin\helloWorld
    palm-generate: helloWorld\appinfo.json (The system cannot find the path specifie
    d)

    I am also getting this error in packaging:

    C:\Program Files\Palm\SDK\bin>palm-package.bat C:\Users\caldera\workspace\HelloWorld
    Creating package in C:\Program Files\Palm\SDK\bin\com.yourdomain.hello_1.0_all.ipk
    Exception in thread “main” java.lang.NullPointerException
    at com.palm.packager.jpkg.ipkg.IpkgPackageBuilder.write(IpkgPackageBuild
    er.java:114)
    at com.palm.packager.Packager.doPackageItUp(Packager.java:391)
    at com.palm.packager.Packager.createPackageFromApp(Packager.java:264)
    at com.palm.packager.Packager.main(Packager.java:254)

    Both errors prevent any sort of ability to transfer the data to the device. The emulator works, the communication with the device is happening fine, except for these steps encountered in building. Any ideas?

  14. Caldera
    June 28th, 2009 at 04:30 | #14

    I just found out that you have to run the commandline “cmd” as Administrator if you are using Windows Vista. This fixed my problems and I can now perform all the operations fully.

  15. Scott R
    June 28th, 2009 at 05:46 | #15

    It was my understanding that one of the big problems with Palm’s yet-to-be-released SDK was that they still hadn’t figured out / done anything about obfuscating the underlying source code of a person’s app. Until they did that, Developer A could write an app, then if Developer B could figure out a way to pull the app off of the device (which we all know has already been done), Developer B could then have full access to the source code of Developer A’s app.

    In your article here, you talk about the app getting compiled (?) into an .ipk file. Is this file truly compiled or can it be easily disassembled back into the source code bits again?

  16. Joffroi
    June 28th, 2009 at 07:09 | #16

    When I run the Palm Emulator, it seems to just load black and nothing happens. Any idea why this is happening?

  17. June 28th, 2009 at 09:12 | #17

    @dave
    It sounds like you’re running linux or OSX and have a virtualBox instance running WindowsXP on it? Not sure if this works or not, but on your WindowsXP instance you will want to install another virtualBox instance. The SDK can’t jump out of your current virtual machine to find virtualBox. you need another virtualBox inside your WindowsXP VM.

  18. June 28th, 2009 at 09:16 | #18

    Caldera :

    I just found out that you have to run the commandline “cmd” as Administrator if you are using Windows Vista. This fixed my problems and I can now perform all the operations fully.

    Thanks for this. I’ll update the original article with this info.

  19. June 28th, 2009 at 13:16 | #19

    I just downloaded the SDK, about to give it a whirl now.

  20. Matthew
    June 28th, 2009 at 14:37 | #20

    @Caldera

    That was mentioned in the 1st post.

  21. JeffM
    June 28th, 2009 at 16:46 | #21

    Works great!!!…How do ya port it from the emulator to the pre?

  22. June 28th, 2009 at 16:49 | #22

    @Colonel Kernel

    I’m using Visual Studio to automatically build my app and install it on the emulator. Basically I just created my own .bat which builds the package and installs the package whenever I click ‘run’. You can easily set visual studio to call your custom .bat. I can post a modified version of the Hello World app if people are interested.

  23. June 28th, 2009 at 17:50 | #23

    Jason :

    @Colonel Kernel

    I’m using Visual Studio to automatically build my app and install it on the emulator. Basically I just created my own .bat which builds the package and installs the package whenever I click ‘run’. You can easily set visual studio to call your custom .bat. I can post a modified version of the Hello World app if people are interested.

    Can you post your batch file? When I tried to run package and install in the same file it would exit after package

  24. June 28th, 2009 at 18:13 | #24

    clickonchris :
    Can you post your batch file? When I tried to run package and install in the same file it would exit after package

    Ah, Im sure youre having the same issue I had. You need to use the CALL command when invoking another bat or the first bat will end everything when its finished.

    This is basically what I have:

    cd C:\Program Files\Palm\SDK\share\projects
    CALL palm-package HelloWorld
    CALL palm-install -r com.vyrotek.hello
    CALL palm-install com.vyrotek.hello_1.0_all.ipk

  25. Dave
    June 28th, 2009 at 19:32 | #25

    On two machines, I am not having any luck getting the emulator to open. I double-click and I get an hourglass for a couple of seconds. Then nothing.

    I can see the process start and end in Task Manager.

    Anyone else seeing this?

    FYI – One machine is Vista x64, the other is XP SP3 (32 bit).

  26. Blubble
    June 28th, 2009 at 20:00 | #26

    Thanks a lot. This is very helpful. Now I can get to playing around with this thing.

  27. majik
    June 28th, 2009 at 21:04 | #27

    I wrote basic HTML, and packaged the program. Now I receive this error in command prompt:

    C:\Program Files\Palm\SDK\bin> palm-install com.yourdomain.helloworld_1.0_all_ipk

    palm-install: Connection refused: connect

  28. orim181
    June 28th, 2009 at 23:06 | #28

    I get the same “palm-install: Connection refused: connect” error, too. I turned off my firewall just in case on my Vista Home Premium (32-bit).

  29. Dubious
    June 29th, 2009 at 00:10 | #29

    I edited the text in the HTML page and saved it. After I package the application and install it, it still comes up with the default text. Created another application with a different name, but same result!

  30. chefjabril
    June 29th, 2009 at 18:53 | #30

    @will
    go here for a mac os x download prethinking.com

  31. orim181
    June 29th, 2009 at 20:24 | #31

    @majik
    Did you ever get a reply on how to fix that connection refused error?

  32. June 29th, 2009 at 22:09 | #32

    hey, i get to the very end but the install never goes through. it says

    connecting to device emulator (numbers and letters:tcp:numbers)

    and thats it. it never finishes. any hints?

  33. June 30th, 2009 at 03:46 | #33

    Thanks for your tutorial ! I’ve added this page to the “Palm Open Source” database. http://www.palmopensource.com

  34. June 30th, 2009 at 08:10 | #34

    Hey, nvm what i said. i ended up having more problems with the sdk so i just reinstalled it and it works fine now.

  35. firestorm_v1
    June 30th, 2009 at 09:23 | #35

    Great tutorial!! I wanted to say Thank you and to ask for some quick help:

    I need to find the VM’s IP address. I took a look at the DHCP server and it never made a broadcast to the server yet has internet connectivity.

    Is there some way to find out from the Pre itself? the WiFi is off and won’t let me turn it on so I can’t get the IP there as I can with my real Pre. I’ve also tried using a local PHP script on my local server to give the IP address.

    Additionally, palm-install can’t connect despite me specifying -d tcp on the command line and -d usb won’t work because I can’t emulate a USB connection (I don’t know how) through VirtualBox.

    Any assistance you can provide would be extremely helpful. Thank you again.

  36. firestorm_v1
    June 30th, 2009 at 09:25 | #36

    @firestorm_v1

    Umm.. #sheepishly# nevermind. It just started working. :P

  37. June 30th, 2009 at 09:51 | #37

    firestorm_v1 :Great tutorial!! I wanted to say Thank you and to ask for some quick help:
    I need to find the VM’s IP address. I took a look at the DHCP server and it never made a broadcast to the server yet has internet connectivity.
    Is there some way to find out from the Pre itself? the WiFi is off and won’t let me turn it on so I can’t get the IP there as I can with my real Pre. I’ve also tried using a local PHP script on my local server to give the IP address.
    Additionally, palm-install can’t connect despite me specifying -d tcp on the command line and -d usb won’t work because I can’t emulate a USB connection (I don’t know how) through VirtualBox.
    Any assistance you can provide would be extremely helpful. Thank you again.

    I haven’t actually tried installing the app to my pre yet. It sounds like -d usb may be the ticket! I’m going to try tonight.

    Re: VM IP address – I would think that virtualbox could give this to you somehow. Otherwise you can ssh in via localhost port 5522, username: root, password: . “ifconfig” should tell you the ip.

  38. Iosif
    June 30th, 2009 at 11:53 | #38

    Is it only html and web programming that can be programmed in the PalmPre? What about more advanced things?

  39. June 30th, 2009 at 13:01 | #39

    IS there any documentation on the SDK out yet?

  40. June 30th, 2009 at 14:08 | #40

    Cooter Brown :

    IS there any documentation on the SDK out yet?

    That is some name Mr. Brown. There is no documentation out yet. That might be a big reason why Palm didn’t want to release the SDK yet.

  41. orim181
    June 30th, 2009 at 21:58 | #41

    orim181 :
    I get the same “palm-install: Connection refused: connect” error, too. I turned off my firewall just in case on my Vista Home Premium (32-bit).

    I get the error that Novacom isn’t running which is the reason that the connection is being refused. When I check Windows Services, it says the Novacom driver has started but apparently it’s got an issue.

  42. Guider
    July 1st, 2009 at 11:29 | #42

    @clickonchris
    OReilly does have a rough-cuts version of an upcoming book. They have been pushing frequent updates and looks good so far. http://oreilly.com/catalog/9780596801816/

  43. Dr.Sid
    July 2nd, 2009 at 03:58 | #43

    Can pinch zoom be done in emulator ?

  44. July 2nd, 2009 at 09:57 | #44

    Guider :

    @clickonchris
    OReilly does have a rough-cuts version of an upcoming book. They have been pushing frequent updates and looks good so far. http://oreilly.com/catalog/9780596801816/

    Thanks. I’ll be picking this up

  45. July 2nd, 2009 at 12:18 | #45

    clickonchris :
    @Colonel Kernel
    If you are really serious about developing an app with this thing you could use Eclipse and wire up an “external tool” to invoke the package or install in one button click.

    clickonchris :
    I have Eclipse installed, and have used it for ColdFusion Web Apps, but not for anything like this, i.e., developing a Palm Pre App using the SDK and the Emulater. I was successful developing the “helloworld” app, but now I am ready for serious stuff. Can you provide me with steps/guide on how to get it started in Eclipse? Do I need to download anything new from the Eclipse download center?
    @Colonel Kernel
    If you are really serious about developing an app with this thing you could use Eclipse and wire up an “external tool” to invoke the package or install in one button click.

    @clickonchris

  46. Tom
    July 2nd, 2009 at 15:05 | #46

    This will really help me get going. Thank you for sharing– I will do the same.

  47. animaxcg
    July 2nd, 2009 at 23:50 | #47

    i made a “hello world” app on my mac

  48. Dacsoft
    July 3rd, 2009 at 12:52 | #48

    Thanks for the great tutorial. It really made it easy.

  49. John
    July 3rd, 2009 at 13:19 | #49

    When attempting to run the Palm-generate command, I get an error “\Palm\SDK\share\jars\%j> was unexpected at this time”

    I suspect that this is due to variables not being set, but how do I go about setting them?

    PS> because I am on a x64 OS, I had to create the palm emulator in a x86 XP VM, and then copy the virtual hard drive and all of the config files to my host OS. Could this be why the variables are not set?

  50. johnr
    July 4th, 2009 at 17:29 | #50

    @John
    I have my SDK at c:\Palm\SDK. In this case you need to enter the command

    set PalmSDK=\Palm\SDK

    before executing any of the palm-generate, palm-package, … commands

Comment pages
1 2 151
  1. July 6th, 2009 at 22:29 | #1
  2. July 14th, 2009 at 00:34 | #2
  3. July 17th, 2009 at 11:46 | #3