Developing Apps for BlackBerry Playbook Tablet
I admit it, I am a sucker for free stuff so when RIM offered a free tablet to anyone that submitted an app to AppWorld, I thought that it would be a good incentive for me to stick my toe into the water and test out the market for App Development. It is also, potentially a good time to signed up to BlackBerry as they have waived their sign up fee which is normally $200. That does sound crazy when they are obviously the underdog in the app market but it was the policy until recently.
To start with, “free” is a bit of a misnomer as you can expect to spend at least 10 hours figuring out how to build the app before you even get a chance to submit it. Seeing as the deadline is in 11 days, if you are interested you would definitely want to get moving on it. If you have an app that was built with PhoneGap or some other type of Web based (HTML/CSS/JavaScript) than it would have a reasonable chance of porting to the Playbook via their WebWorks SDK.
Just to clear things up a bit, the Playbook currently only has development options for WebWorks or Adobe AIR. RIM supports Java on their other phones but there is no method as far as I understand to getting Java to work on the Playbook as of yet. Part of the problem on their website is it is difficult to understand what they do and don’t support as there is no differentiation between Playbook and their other phone OS stuff. Part of the reason for this post is to point people down the right track. I am a total newbie to Mobile Apps, so hopefully this will be helpful to some people that are looking to get into it.
This will plot the eventual successful course to getting a Playbook WebWorks App working on the Playbook simulator.
I have Windows 64 bit running with 4 gigs RAM on an otherwise dodgy laptop.
Here is RIM’s list of things you need:

You can view getting started if you want but it might just make it more confusing.
I don’t think you need Adobe AIR SDK. Maybe it is used to unpack the install packages. I didn’t overtly use it.
You do need everything else.
You need a BlackBerry Developer Zone account
WebWorks SDK
VMware – You have to sign up for an account but it is free otherwise.
Playbook Simulator
Apply for signing keys from RIM. Remember the name and passwords you put here as you will need them later.
The guide from RIM is actually quite helpful for this next part. Go there and follow the instructions to get the simulator installed.
I think you have to reboot the virtual machine at this stage to get it to come up. If when you start the Playbook simulator it hangs on the start up screen, in other words for more than 5 minutes than you will have to trouble shoot it.

The thing that worked for me was to shut down all other applications to get it going the first time. Now it starts up without a problem. Other things you could try would be to restart Windows, reinstall VMware, etc. If you have anything that worked feel free to comment.
If you make it to here, congratulations.

The OS only comes with a browser and no other programs.
Make sure you enable development mode instructions are here. The ‘gear’ icon they talk about in the instructions can be seen in the image above.
Now you need to work on compiling your program to put it onto the simulator.
You need to make sure that the JAVA_HOME variable in your operating system is pointing at a current version of the Java SDK. I had some problems with this which I had to fix by updating Java and changing the JAVA_HOME variable to the main parent directory of your Java SDK. The problem I had I think was in relation to 32 bit vs. 64 bit Java. You need to have JAVA_HOME pointing to the 32 bit version to get WebWorks to work. I just installed 32 bit Java in Program Files (x86).
You may also have to update the PATH variable to include your Java SDK\bin directory. You can find instructions on these procedures in many other places so I don’t feel I have to include it here.
This guide is quite helpful to understand how to compile. Keep in mind you are starting out with something that is already a functioning web page or site that you have built in whatever text editor you use. If it doesn’t work in a browser it won’t work as an app either. Don’t ask me about listening for other types of events such as motion as I don’t know yet. However, the basic app I did get up and running worked as expected.
In the parent directory of the app create a file called config.xml. If you download the above guide there is some sample code you can copy and paste to get yours going in the right direction. If you don’t know XML don’t worry, it looks and behaves like HTML for the purpose of this. I am sure you can figure it out. If you have more than one page you need to define where to start so use the content element:
<content src=”startpage.html” />
Or if your main page is in a sub directory:
<content src=”sub/startpage.html” />
Now create a zip archive file with your page(s) and other applicable directories that make up your webpage in the immediate zip file. Make sure that the zip doesn’t add an extra level of directory or your app won’t compile.

You need to modify the bbwp.properties file in C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp or wherever you put it, this is the default location.
This line is originally commented out but uncomment it and modify it to reflect the name that the signing keys are under:
<developer_cn_signature>Your Name or Company</developer_cn_signature>
The following is mostly thanks to ‘ProfHawking’ from the Support Forum in the Developer Zone. This post is about half way down the page.
You need to generate a sigtool.p12 file. To do that, navigate to C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin in a command window and run the following command:
blackberry-keytool -genkeypair -keystore sigtool.p12 -storepass <PASSWORD> -dname "cn=<NAME OR COMPANY>" -alias author
You have to replace with whatever password you used for your signing key application and replace with Your name or company. Don’t include the <> on either of these, it’s not syntax, it’s just for my emphasis.
This code generates a sigtool.p12 file in C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin
Now you need to generate a CSK certificate. While still in the above directory, run the following command:
blackberry-signer -csksetup -cskpass <CSK PASSWORD>
I never set up this password beforehand so I just chose another password and kept track of it. In the original post he says this is the password you set for your developer certificate. Anyway it is a DIFFERENT password than the other password.
According to the original post:
This generates barsigner.csk in your local settings directory:
C:\Document and Settings\\Local Settings\Application Data\Research In Motion\
I never did find the file where it was put. I don’t have the above directory and it wasn’t anywhere I looked. However, the command executed without error so I think it did what it was supposed to. Enlighten me if you are able.
Hopefully, by now you have got an email back from RIM with your signing file in it. This looks like client-RDK-1111111111.csj. For the sake of simplicity copy this file into your current directory, C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin and run the command:
blackberry-signer -register -csjpin <CSK PIN> -cskpass <CSK PASSWORD> client-RDK-1111111111.csj
CSJ PIN is the PIN you chose when you applied for your signing keys and YOUR CSK PASSWORD is whatever password you chose earlier. For me it was just at the last step. Also, replace client-RDK-1111111111.csj with whatever your version of this file is.
According to original post:
This generates barsigner.db in your local settings directory: C:\Document and Settings\\Local Settings\Application Data\Research In Motion\
This was not my experience and I never did find the generated file despite not getting any errors when running the command.
Move the generated sigtool.p12 file from: C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin to C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\bin
Now that we have the signing process finished we can actually compile a bar file, which is the finished product that will be put into your emulator. In the command window, navigate to C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp and run the following command:
bbwp "c:\whatever\sample.zip" -gcsk <CSK PASSWORD> -gp12 <PASSWORD> -buildId <BUILD NO> -o "c:\workingdir"
Note: in the original post there were ‘/’s instead of ‘-’s which is part of the conflicting documentation from RIM. It wouldn’t work for me with ‘/’s but it did with ‘-’s.
According to the documentation, you can also specify a different destination folder if you are so inclined. You will find a list optional arguments for all these commands in this document which I linked to above as well.
Now that we have the app built, we need to push it out to the Playbook simulator. Navigate back to C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin and put in the following command:
blackberry-deploy -installApp -password <DEVICE PASSWORD> -device <DEVICE IP ADDRESS> -package "C:\workingdir\sample.zip"
The is whatever password you set up when you installed the simulator and enabled development mode. Now fire up your Playbook simulator and your app should be there for you in the ‘All’ directory. If it isn’t reset the simulation and try again. I had to reset it to work as it doesn’t seem to be a live link.