Getting Started Tips for BlackBerry WebWorks SDK for Tablet OS

Open Source

BlackBerry WebWorks command line

While I’ve been hacking away at building some of my own BlackBerry® WebWorks™ applications for the BlackBerry® PlayBook™ tablet, I’ve come up with a “getting-started” recipe that works for me, so I figured I would share it with the community. I also have some nifty little scripts that I’d like to share.

Getting Up and Rolling

You can find a full BlackBerry WebWorks Getting Started Guide for BlackBerry PlayBook Tablet OS that will step you through the whole process for either Mac® or Windows®, but I figured I would give a quick cheat sheet on the steps I typically follow.

  1. Download and extract the Adobe® AIR® SDK. This is actually a zip file that you’ll extract to a directory on your machine – you’ll want to remember it because the SDK installer asks for it later.
  2. Download and install the BlackBerry WebWorks SDK for Tablet OS. The link I supplied is to the general SDK download page, so it doesn’t become obsolete when we make the next Beta drop. You should find the download link in step 3 on that page.
  3. Download and install VMware Player if you’re on Windows or VMware Fusion if you’re on Mac OS X. Why? The BlackBerry PlayBook tablet simulator is actually a VMware instance just as if you were running Windows or Linux in VMware. Unfortunately, VMware Fusion doesn’t currently have a free offering for Mac OS X, but we are working closely with VMware to streamline and improve the entire simulation experience for developers.
  4. Download and install the BlackBerry PlayBook tablet simulator. The only thing this install does is extract the Tablet OS *.iso file to a directory on your machine. Remember your install location because you’ll need this *.iso file to load into VMware. Again, I just linked to the main download area, so that link will still be good when new versions of the simulator are released. The download should be in step 5.
  5. Run VMware and load the PlayBook *.iso file. See the Windows or Mac setup instructions.
  6. Now you’re ready to rock and roll with my tips below 🙂

You’re probably thinking that these are a lot of steps to get your environment set up – and we agree! We’re working hard to simplify this setup process, and we’ll have a post up soon to share some insights on the steps we’re taking to do just that.

Cutting to the Chase

I’d like to share some tips that I use when building BlackBerry WebWorks applications for the Tablet OS. Since there are a few steps and different command line tools involved, I like to create myself a nice little batch file that does all the heavy lifting for me.

Since I’m typically only working on one application at a time, I usually create a batch file for each one of my projects. You could make your batch files a lot more generic for reuse, but I like the simplicity of not having to pass in command line parameters.

The first thing I usually do is create a virtual directory on a local web server running on my machine. This way I can use a browser like Chrome to do my application testing and perform my debugging using Web Inspector – I find that it’s the closest browser for accurate rendering on the BlackBerry PlayBook tablet. I can write and test my application out in Chrome just like any other web site and then package it up and try it out on the simulator when I‘m ready. We also have some pretty cool plans for some new web tooling and device emulation that we’ll talk about soon. 🙂

I then grab a free zip utility like the 7-zip command line tool and use it to zip up my website’s content so that I can pass it to the bbwp command line tool (bbwp stands for BlackBerry WebWorks Packager). I usually delete the pre-existing archive first before zipping up a new one. You’ll have to change the paths below to represent your application’s resources. I just zip up all the files in the root of my website using the “*” wildcard with 7-zip. For this example, I’ll be using the sample SketchPad application:

del "D:\"
"C:\Program Files\7-zip\7z.exe" a "D:\" "D:\sketchPadStandard\*"

Then I run the BlackBerry WebWorks Packager to bundle up the content into an application that can be pushed onto the simulator:

"C:\Program Files\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\bbwp.exe" "D:\" /o "D:\packaged"

The packager will output the file to the directory specified by the /o parameter, which in this case is pointing to the “D:\packaged” directory.

Last step is to run the script to load the application onto the BlackBerry PlayBook tablet simulator.

"C:\Program Files\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin\blackberry-deploy.bat" -installApp -password qaqa -device -package "D:\packaged\"

You’ll notice that I pass my local password “qaqa” for the -password parameter and -device which is the IP address from my simulator. Make sure your simulator is set to Development Mode before trying to deploy your app. That detail caught me off guard a couple of times.

Once it’s all put together, the full batch file looks like the following:

del "D:\"

"C:\Program Files\7-zip\7z.exe" a "D:\" "D:\sketchPadStandard\*"

"C:\Program Files\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\bbwp.exe" "D:\" /o "D:\packaged"

"C:\Program Files\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin\blackberry-deploy.bat" -installApp -password qaqa -device -package "D:\packaged\"

Whenever I want to build and deploy my application to the simulator, I simply run my batch file and I’m good to go!

Uninstalling your application is pretty straight forward as well – an example script can be found below:

"C:\Program Files\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin\blackberry-deploy.bat" -uninstallApp -password qaqa -device -package "D:\packaged\"

Hopefully you’ll find these scripts helpful to get you on your way to building a great application for the BlackBerry PlayBook tablet. We invite you to share yours, too.

About Tim N.

Tim leads Application Platform & Tools Product Management at Research In Motion. This includes APIs, Frameworks and Tools for the BlackBerry Platform. He can be found hanging out in the development forums or Twitter (@brcewane) trying to help out where he can and to bring your feedback into the next releases of BlackBerry tooling. You’ll also see Tim presenting various topics at the BlackBerry Developer Conferences and BlackBerry World so be sure to stop by and say hi. Just don’t start talking about cars or Batman or you won’t be able to get rid of him.

Join the conversation

Show comments Hide comments
+ -
  • Scripts and Batch File Help for Developing for the BlackBerry PlayBook | BlackBerry Cool

    […] environment and getting your first apps running. Today’s article by the Dev Blog is entitled Getting Started Tips for BlackBerry WebWorks SDK for Tablet OS. The article outlines the basic setup steps, and then goes in to greater detail with some helpful […]

  • Thogek

    Nice walkthrough description. This looks almost exactly like what I’ve settled on doing (swapping WinRAR for 7-zip), but it did take some trial-and-error to get it settled into place…

  • Tim Neil

    There’s also a good thread going on in the forums right now around some useful ANT scripts that tackle the same goal

  • Really?

    “You’re probably thinking that these are a lot of steps to get your environment setup – and we agree!”

    Less talk, more fixing. None of this crap should be necessary.

  • RIM’s WebWorks Development Tips and Tricks for the PlayBook - BerryReview - Mobile Edition

    […] based but the ideas are not too different on a Mac but you will not be able to use the batch file.Check out the tips and tricks at this link | Older: New PSHD Theme from Hedone Design » This entry was posted on Wednesday, March 2nd, […]

  • Ashley Forrester

    I’m looking forward to buying a Blackberry phone and i’m glad I came across this blog post. So, thanks a lot for this well written share.

  • interfaSys Ltd
blog comments powered by Disqus