This guide assumes you have installed the BlackBerry® PlayBook SDK. It is not meant to cover how to get it installed. However, it should be noted, if you are developing on Linux you can just copy the installation directory from a Windows® install. RIM has not released a proper Linux installer, so you won't find instructions for it. This guide also does not cover installing the BlackBerry® Playbook Simulator.
This guide also assumes you have added the SDK's bin folder to your default path. If you have not then you will have to prefix each command with the path to the SDK's bin folder.
We're also going to assume that in a directory you have a file called HelloWorld.as you wish to compile.
Standard Release Procedure
First off, we're going to compile our source code to a .swf file.
In your development directory you should now have HelloWorld.swf. This is the binary for your program, it now has to be packaged.
Before we can package it we will need a XML info file and an icon. Here is an example of the XML you can use:
You'll need to modify this to suit your application, creating your own id, filename, name, version and content. Use HelloWorld.swf in the content section to match the application we're creating in this article. Once complete, save this file in your development directory as HelloWorld-app.xml.
You now need to copy a PNG icon of size 90x90 into your development folder, assuming you aren't using the default icon (default icon not recommend for production applications). The name must be blackberry-tablet-icon.png.
For production applications you should also include a blackberry-tablet.xml file. You can find a sample of this file in the HelloWorld project that is included with the SDK. If you're just getting started this file is not required, so these instructions assume you do not have one.
Now it's time to package and deploy your application. You should already have the simulator running with development mode enabled. You have to change directory to one containing the xml and swf file. Your command is:
Your app should now package and deploy. You may not require the password option depending on what you have done in the simulator. You can omit the icon file name if using the default icon. You can include any additional resource files your application requires in the list of files.
This procedure assumes you've already followed the standard compile and deployment procedure. If not you'll need to follow the steps relating to the XML file and icon before this procedure will work.
First, we need to compille your app with debugging enabled. Your command is:
amxmlc -compiler.debug HelloWorld.as
You should now have a HelloWorld.swf file which is somewhat larger (file size) than the .swf file produced by the standard procedure.
Open a second console and run:
Once the Flash Debugger opens issue the command:
Immediately switch back to your previous console. The Adobe® Flash® debugger times out if nothing connects within about 60 seconds.
We now deploy your app for debugging using the command:
Your application should deploy and connect to the debugger you have open in the other window. Switch back to the console where the debugger is running. Be patient as it can take a bit before the simulator connects. If you have a firewall it can interfere with the simulator's ability to connect, make sure port 7935 is open. When the simulator connects you will be prompted to enter breakpoints. The use of Flash Debugger is outside the scope of this tutorial, there is a built-in help function. If you just want console output then issue the command:
This will let your application start execution and no breakpoints will be set. You will get console output of things such as trace().