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

The splash screen

Finished!

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
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.

7 – Go to your emulator and run the program!


8- Profit!
6/28/2009-updated with hardware specs
5/1/2010 – linked to SDK download through palm.com


any ideas on how to get this running on OS X? Also is there a TextMate bundle floating around yet?
will
27 Jun 09 at 4:37 pm
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)
Matthew
27 Jun 09 at 5:26 pm
Doh! Had to run cmd in administrator mode. Oops.
Matthew
27 Jun 09 at 5:34 pm
@will
Don’t know the answer to either
clickonchris
27 Jun 09 at 5:52 pm
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…
WebOS App Review
27 Jun 09 at 7:23 pm
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?
Colonel Kernel
27 Jun 09 at 8:29 pm
Dood!! You rock. Thanks for the tutorial.
frankos72
27 Jun 09 at 10:34 pm
@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
27 Jun 09 at 11:55 pm
u should post a vid to understand it better mine says the system cannot find the path specified)
ulises v
28 Jun 09 at 12:39 am
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
dave
28 Jun 09 at 2:03 am
@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
czechdev
28 Jun 09 at 2:38 am
@clickonchris
How?
David
28 Jun 09 at 2:56 am
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?
Caldera
28 Jun 09 at 4:28 am
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.
Caldera
28 Jun 09 at 4:30 am
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?
Scott R
28 Jun 09 at 5:46 am
When I run the Palm Emulator, it seems to just load black and nothing happens. Any idea why this is happening?
Joffroi
28 Jun 09 at 7:09 am
@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.
clickonchris
28 Jun 09 at 9:12 am
Thanks for this. I’ll update the original article with this info.
clickonchris
28 Jun 09 at 9:16 am
I just downloaded the SDK, about to give it a whirl now.
Dominik
28 Jun 09 at 1:16 pm
@Caldera
That was mentioned in the 1st post.
Matthew
28 Jun 09 at 2:37 pm
Works great!!!…How do ya port it from the emulator to the pre?
JeffM
28 Jun 09 at 4:46 pm
@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.
Jason
28 Jun 09 at 4:49 pm
Can you post your batch file? When I tried to run package and install in the same file it would exit after package
clickonchris
28 Jun 09 at 5:50 pm
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
—
Jason
28 Jun 09 at 6:13 pm
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).
Dave
28 Jun 09 at 7:32 pm
Thanks a lot. This is very helpful. Now I can get to playing around with this thing.
Blubble
28 Jun 09 at 8:00 pm
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
majik
28 Jun 09 at 9:04 pm
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).
orim181
28 Jun 09 at 11:06 pm
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!
Dubious
29 Jun 09 at 12:10 am
@will
go here for a mac os x download prethinking.com
chefjabril
29 Jun 09 at 6:53 pm
@majik
Did you ever get a reply on how to fix that connection refused error?
orim181
29 Jun 09 at 8:24 pm
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?
Dan D
29 Jun 09 at 10:09 pm
Thanks for your tutorial ! I’ve added this page to the “Palm Open Source” database. http://www.palmopensource.com
ld
30 Jun 09 at 3:46 am
Hey, nvm what i said. i ended up having more problems with the sdk so i just reinstalled it and it works fine now.
Dan D
30 Jun 09 at 8:10 am
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.
firestorm_v1
30 Jun 09 at 9:23 am
@firestorm_v1
Umm.. #sheepishly# nevermind. It just started working.
firestorm_v1
30 Jun 09 at 9:25 am
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.
clickonchris
30 Jun 09 at 9:51 am
Is it only html and web programming that can be programmed in the PalmPre? What about more advanced things?
Iosif
30 Jun 09 at 11:53 am
IS there any documentation on the SDK out yet?
Cooter Brown
30 Jun 09 at 1:01 pm
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.
clickonchris
30 Jun 09 at 2:08 pm
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.
orim181
30 Jun 09 at 9:58 pm
@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/
Guider
1 Jul 09 at 11:29 am
Can pinch zoom be done in emulator ?
Dr.Sid
2 Jul 09 at 3:58 am
Thanks. I’ll be picking this up
clickonchris
2 Jul 09 at 9:57 am
@clickonchris
lainteract
2 Jul 09 at 12:18 pm
This will really help me get going. Thank you for sharing– I will do the same.
Tom
2 Jul 09 at 3:05 pm
i made a “hello world” app on my mac
animaxcg
2 Jul 09 at 11:50 pm
Thanks for the great tutorial. It really made it easy.
Dacsoft
3 Jul 09 at 12:52 pm
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?
John
3 Jul 09 at 1:19 pm
@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
johnr
4 Jul 09 at 5:29 pm
Thanks for your useless tutorial, it was really great to see an exact copy of the Palm Pre official tutorial, except you slightly changes the text. It must have taken you weeks.
cak
5 Jul 09 at 9:31 pm
When you don’t have content of your own, how else will you draw people from search engines to click on your google ads?
philo
6 Jul 09 at 11:55 am
@cak
Excuse me? Where can I find a Palm Pre official tutorial? At the time that I wrote this (the day after the SDK got leaked) there was no official palm pre official tutorial.
clickonchris
6 Jul 09 at 12:17 pm
[...] source : Palm Pre, iPhone, Windows [...]
How to make professional looking User Interface for your next Windows Mobile app with ease | Download Pocket PC Freeware and Windows Mobile 6.5 Software
6 Jul 09 at 10:29 pm
Thanks for posting this. By the official Palm Pre Tutorial, I think they are referring to this:
https://prerelease.palm.com/confluence/display/sdk/Hello+World
Weirdly, there’s no “getting started” documentation installed with the SDK, so I actually found your page before I found Palm’s.
mhenry1384
7 Jul 09 at 9:22 am
Thanks a bunch Chris, i was able to resolve my issue with your tutorial.
smv
7 Jul 09 at 11:53 pm
Thanks for your time and help – this was the first sample I was able to find.
Bob
11 Jul 09 at 8:14 pm
I have the same problems as two others have posted.
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 specified)
both resolved their problems by running cmd as administrator. is this different then logging onto windows as administrator? because I have the only windows account on my computer, and am obviously logged in as the administrator.
Ive only barely played with alice, dr.java, and visual basic in an intro class at school so I probably wont be able to get anything out of this anyways but id like to try.
Matt
13 Jul 09 at 2:56 pm
[...] world” TwitterClient (a tutorial on writing your first app for the Pre can be found here, has nice wordpress-skin [...]
Palm Pre SDK (Mojo) on Linux | Syntactic sugar
14 Jul 09 at 12:34 am
Can you use this same program for Modifying only? Like in some of the “my notifications” changes @ Pre-Central.net?
Ron
15 Jul 09 at 10:11 am
I tried creating an icon and saving it to the palm folder where the icon with the moon is, and it wouldnt let me save there and to contact the administrator? well I created another user account and made it the admin, and the emulator wont even open in that account, still works fine in my other account though…
Matt
15 Jul 09 at 1:58 pm
[...] also found another tutorial here. This one is about getting the SDK ready and includes a couple screenshots! __________________ [...]
Instructional for beginners and Hello World 2.0! [v1.0][NRR] - Page 4 - PreCentral Forums
17 Jul 09 at 11:46 am
I got stuck at:
7 – run “palm-install ”
but after changing that to:
7 – run “palm-install.bat ”
it worked
Vincent
22 Jul 09 at 2:02 pm
I agree that this was very helpful The only bloody tutorial that actually shows what to expect, not useless written text.@Bob
Sean
4 Aug 09 at 8:52 pm
I liked seeing this, do you have a Facebook page for this site?
facebook design
10 Oct 10 at 4:57 am