Monday, June 13, 2011

Using Flash Professional to create Apps for the BlackBerry Playbook


As of now, the only “built-in” option to compiling Blackberry apps for the Blackberry Tablet is using Flash Builder 4. This process if straightforward, but what if you do not have Flash Builder 4 or if you have it and not comfortable using Flash Builder.  Let’s just say you are a Flash Professional Pro! During Adobe MAX, it was mentioned that Blackberry was working on an update for Flash Professional that will allow you to use Flash Pro to compile Blackberry Apps. 

But, right now if you are only using Flash Professional then you are sort of “in the dark”.
Well, this tutorial will give you some insight on a workaround, until the update is released. First lets start with some basics.
  • Blackberry Apps have a “.bar” extension
  • SWF files are compiled to a “bar” file
  • You must use the Blackberry Tablet simulator
  • You must use VMware Fusion for MAC or VMware Player for Windows
Installing and configuring you computer to run the BlackBerry Tablet Simulator here
  1. Install the Blackberry Tablet OS SDK for Adobe AIR. here
  2. Install VMware Fusion for MAC or Windowshere
  3. Install/Configure the Blackberry Tablet simulator. here
  4. Enable Development Mode on the Blackberry Tablet simulator. here
  5. Retrive the IP address for the BlackBerry Tablet Simulator .  The IP addresss in the Simulator is used to transfer your BlackBerry App to the simulator. here
After the above steps are completed, you now can create and test your Apps on the BlackBerry tablet Simulator.
By default, our next steps would be to create a Flash Builder Project, compile and test it on the Simulator.  But we are going to use Flash Professional CS5.
Overview – The steps to create BlackBerry Apps using Flash Professional CS5.
  1. Create a new .fla file.
  2. Set the stage size to match the resolution of the BlackBerry Tablet. 1024 x 768
  3. Create you Flash project as normal.  Set your publish settings to Flash Player 10. (It is not necessary to set your Publish settings for AIR 2.5 or AIR for Android.  The xml files that are generated from these publish settings are not compatible with the BlackBerry Tablet/Simulator)
  4. Publish your project to create a “.swf” file.
  5. Create a Adobe AIR Application Descriptor File.  “appname-app.xml”.  You can download a template of the XML file here. Save the file in the same folder of your “swf” file. You will have to change a few of the tags to match the name of your application. These tags are in different areas within the xml file.
  6. <id>appName</id> <filename> appName </filename> <name> appName </name> <content>appName.swf</content>
  7. Create a folder called “icons” and create three “.png” files.
  8. Three sizes: 36 pixels, 48 pixels, and 72 pixels
  9. Name them: icon36.png, icon48.png, and icon72.png
  10. Using the command line, compile your application. Using Terminal on MAC or MS-DOS prompt on Windows.
  11. Navigate to the folder where your files are located.
  12. Run the following command, replace “appname” with the name of your application.
1location_of_your_BlackBerrySDK/blackberry-airpackager -package appname.bar -installApp -launchApp appname -app.xml appname.swf icons/icon48.png icons/icon72.png icons/icon36.png -device IP_Address
The command will take your swf/xml/icons and compile it to a “.bar” file.  It will then install it on the BlackBerry Tablet Simulator and run your application.
Happy Developing! Flash Rocks!

No comments:

Post a Comment