10 Tips for Developing for the BlackBerry PlayBook

So it’s been a couple of weeks now since RIM unleashed the PlayBook development SDK and simulator.  I thought I’d share some of the things that I’ve experienced – issues, tips, etc in a quick blog post.

  1. Flex Builder 4.0 isn’t going to cut it.  You need to download the 4.1 update in order to avoid a very vague error when trying to deploy to the PlayBook simulator.
  2. FlexBuilder is absolutely not required to build a PlayBook application.  I haven’t been using it.  Instead, I’ve turned to trusty Notepad++ on Windows.  If you plan on doing the same, make sure to remove the .as extension from the langs.xml file for the haskell language type.  Actionscript is already defined as a language with the .as extension, but by default, Notepad++ sets the language type to haskell when the .as extension is used.
  3. You need the 32bit java runtime installed.  If using Windows 7 or Vista, you might have the 64bit version installed.  You can have both on your machine at the same time.  I downloaded the 32 bit JDK and unzipped it into c:\Java.  I then created a shortcut to the command line that also sets the JAVA_HOME path and adds the Playbook SDK bin folder to my PATH environment variable.
  4. If you’re using the command line tools to build and deploy, you will find that packaging a number of large assets into a bar file will cause an error when deploying the bar file to the PlayBook when using the blackberry-airpackager batch file for install and launch.   Instead, break the packaging and deployment into two separate steps.  Step 1, package with blackberry-airpackager.  Step 2: Use blackberry-deploy to deploy the app to the PlayBook simulator.
  5. If you’re building and deploying with the command line tools, use Ant.  It will make your life a billion times easier by allowing you to bundle your command line arguments into build targets using the exec command.  For example:

    <target name="build-debug">
    <exec executable="amxmlc.bat">
    <arg value="-compiler.debug"/>
    <arg value="HelloWorld.as"/>
    </exec>
    </target>
  6. MXML isn’t optimized for the PlayBook yet.  Write it all out in action script.  ActionScript is a great language anyway  (best implementation of ECMAScript in my opinion) and the more you have to write in it, the better programmer you become.
  7. Many of the PlayBook functions don’t have anything written for them in the QNX API yet.  So don’t search too hard online for geolocation methods.  I suspect that these hooks will be available in an upcoming SDK package.  By the way – RIM is hoping to release an updated SDK at least once per month (according to the first developer webinar).
  8. I wasn’t able to get the debugger working with an app if it was deployed with the blackberry-deploy tool.  This is unfortunate, given point 4 above.  However, adl seems to work fine so in theory, you probably don’t even need to test in the PlayBook simulator for the majority of the time.  Just use adl and run as if it were a regular Air app.
  9. Blitting BitmapData objects with CopyPixels is wicked fast for Bitmap based animation.
  10. There is no way currently to change the opening BlackBerry splash for an app.  Ask RIM to change this via the developer forum or via email to pressure them to make this change.

So it’s been a couple of weeks now since RIM unleashed the PlayBook development SDK and simulator.  I thought I’d

share some of the things that I’ve experienced – issues, tips, etc in a quick blog post.

1) Flex Builder 4.0 isn’t going to cut it.  You need to download the 4.1 update in order to avoid a very vague

error when trying to deploy to the PlayBook simulator.

2) FlexBuilder is absolutely not required to build a PlayBook application.  I haven’t been using it.  Instead,

I’ve turned to trusty Notepad++ on Windows.  If you plan on doing the same, make sure to remove the .as extension

from the langs.xml file for the haskell language type.  Actionscript is already defined as a language with the

.as extension, but by default, Notepad++ sets the language type to haskell when the .as extension is used.

3) You need the 32bit java runtime installed.  If using Windows 7 or Vista, you might have the 64bit version

installed.  You can have both on your machine at the same time.  I downloaded the 32 bit JDK and unzipped it into

c:\Java.  I then created a shortcut to the command line that also sets the JAVA_HOME path and adds the Playbook

SDK bin folder to my PATH environment variable.

4) If you’re using the command line tools to build and deploy, you will find that packaging a number of large

assets into a bar file will cause an error when deploying the bar file to the PlayBook when using the

blackberry-airpackager batch file for install and launch.   Instead, break the packaging and deployment into two

separate steps.  Step 1, package with blackberry-airpackager.  Step 2: Use blackberry-deploy to deploy the app to

the PlayBook simulator.

5) If you’re building and deploying with the command line tools, use Ant.  It will make your life a billion times

easier by allowing you to bundle your command line arguments into build targets using the exec command.  For

example:
<target name=”build-debug”>
<exec executable=”amxmlc.bat”>
<arg value=”-compiler.debug”/>
<arg value=”HelloWorld.as”/>
</exec>
</target>

5) MXML isn’t optimized for the PlayBook yet.  Write it all out in action script.  ActionScript is a great

language anyway  (best implementation of ECMAScript in my opinion) and the more you have to write in it, the

better programmer you become.

6) Many of the PlayBook functions don’t have anything written for them in the QNX API yet.  So don’t search too

hard online for geolocation methods.  I suspect that these hooks will be available in an upcoming SDK package.

By the way – RIM is hoping to release an updated SDK at least once per month (according to the first developer

webinar).

7) I wasn’t able to get the debugger working with an app if it was deployed with the blackberry-deploy tool.

This is unfortunate, given point 4 above.  However, adl seems to work fine so in theory, you probably don’t even

need to test in the PlayBook simulator for the majority of the time.  Just use adl and run as if it were a

regular Air app.

8) Blitting BitmapData objects with CopyPixels is wicked fast for Bitmap based animation.

9) There is no way currently to change the opening BlackBerry splash for an app.  Ask RIM to change this via the

developer forum or via email to pressure them to make this change.

You can leave a response, or trackback from your own site.