Technology Entrepreneur, Innovator, Author and Thought Leader

Shashank Tiwari

Subscribe to Shashank Tiwari: eMailAlertsEmail Alerts
Get Shashank Tiwari via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Blog Feed Post

First Steps with BlackBerry PlayBook AIR SDK

Last week at Adobe MAX 2010, the BlackBerry Playbook was introduced to the world of developers. Positioned as a powerful multi-tasking environment it promises to pose formidable competition in the tablet landscape. The PlayBook OS is built on QNX, the real-time time-tested OS and offers an Adobe AIR based SDK for developers to write their apps.

As soon as I was back from MAX, I was itching to write my first “Hello World” app using the BlackBerry PlayBook SDK. So here in this post is an account of that adventure.

To get started with the PlayBook SDK, first go to the BlackBerry Tablet OS development resources and download the SDK and the simulator for your platform. You will need to get the appropriate versions of the SDK and the simulator for your platform. At the moment, Mac and Windows are supported. I tried my hand with both Mac and Windows. There are “Getting started” guides for Mac and Windows and that’s where my journey began.

To setup the development environment you need the following:

  • The BlackBerry Tablet OS Simulator ISO
  • VMWare Player (or VMWare Fusion on the Mac) to configure and run a virtual environment on the basis of the ISO
  • AIR 2.5 SDK
  • Flash Builder 4.x (the support officially extends to Flash Builder 4.0.1 but you can make it work with FB Burrito)
  • BlackBerry AIR SDK

The PlayBook simulator leverages VMWare Player to create a virtual environment for you to test your apps. When I began to follow the steps in the “Getting started” started guide for Mac and wanted to download and install the VMWare Player on a Mac as per the following guidelines: Configure a virtual machine for the BlackBerry Tablet Simulator, I realized a VMWare Player didn’t exist for a Mac at all. So I downloaded a trail version of VMWare Fusion instead to get things working. Once VMWare Fusion is installed one can follow along the instructions in the “Getting started” guide to setup and configure the simulator. Since that is documented and available online it makes no sense to reproduce it here.

Next, I downloaded the BlackBerry AIR SDK. Flash Builder 4.0.1, AIR 2.5 SDK and Flash Builder Burrito were already installed so I did not need to re-install it. If you don’t have Flash Builder and AIR on your machine then please download and install them before you move forward. Installing the BlackBerry SDK was elementary as a wizard guided through the process. However, one little thing was very odd. The BlackBerry SDK refused to deploy to any Flash Builder other than one named: “Adobe Flash Builder 4″. I have Flash Builder 4 installed as a plug-in and have the standalone FB Burrito that does not have a folder name as stated. So I had to hack around the problem by creating a symbolic link named “Adobe Flash Builder 4″ to my FB Burrito folder on the Mac. On Windows I just configured the SDK, which I will talk about in a bit.

With that done things were working on the Mac.

On the Windows box, I had a different story. Installing the VMWare Player was no problem. It comes for free and installing it requires clicking the installer. That’s it! However, things got tricky right after that. I downloaded the simulator installer but on clicking the installer was greeted with this lack of 64-bit platform support message:

BlackBerry TabletOS Simulator Installer Error on Windows 7

BlackBerry TabletOS Simulator Installer Error on Windows 7

This I think was quite uninviting. Anyway, I worked around this problem. All I needed from this bundle was the TableOS Simulator ISO, so I extracted the installer using 7-zip and traversed down the extracted folder to BlackBerryPlayBookSimulator-Installer-Win\InstallerData\Disk1\InstData, where I again extracted the zipped up file called “Resource1″. Once extracted, I could get the ISO at Resource1\$IA_PROJECT_DIR$\installerdata. From there on I could use the instructions in the “Getting started” guide for Windows to setup the simulator.

As expected, the BlackBerry SDK installer didn’t work on Win 7 either. It again threw up the now familiar message stating lack of Win64 support. Makes me wonder why companies don’t have installers support the 64-bit platform. This is a developer’s tool and not an end user product. Many developers are already using the 64-bit platform and all should and will use it in a couple of years time.

I used the same trick as before and extracted the SDK installer using 7-zip. This time I traversed down the extracted installer to BlackBerryTabletSDK-Air-Installer-0.9.0-Win\InstallerData\Disk1\InstData. There I extracted the “Resource1″ zip file and traversed further down to Resource1\$IA_PROJECT_DIR$\installerdata. In this folder there are two JAR (Java Archive) files that hold the contents of the SDK. The names of these 2 jar files are as follows:

  • blackberry-tablet-sdk-0.9.0_zg_ia_sf.jar
  • qnxsdk_zg_ia_sf.jar

Next, I extracted these two jar files using 7-zip again. After this I created a folder in the “applications” folder, which resides at the root of the C: drive and named it “blackberry-tablet-sdk-0.9.0″, essentially all except the “zg_ia_sf.jar” part of the BlackBerry Tablet jar file name. You can choose any other name, say just blackberry-tablet-sdk or any other. Next, I merged the contents of the two extracted jar files and the Adobe AIR 2.5 SDK (which I assume you would have downloaded and setup by now). That was it! It got my BlackBerry Tablet SDK up and running.

Once the SDK and simulator is setup, you can open up Flash Builder and first configure the BlackBerry Tablet AIR SDK by adding it to the list of “Installed Flex SDKs” as shown in the Figure below:

Installed Flex SDKs

Installed Flex SDKs

Once the setup was complete, I could finally get to writing the “Hello World” app. I wanted the “Hello World” app to be a bit more exciting than printing “Hello World” out to the screen so used the Google Maps Flash API to draw out a map of the area where the Adobe MAX venue, i.e. the LA Convention Center, was.

To create this app, I created a Flex project in Flash Builder and selected it to be an Adobe AIR application. Then I explicitly chose the BlackBerry Tablet AIR SDK as the SDK and finally I chose an ActionScript file as the main file. (As far as I understood, the SDK doesn’t support MXML directly as of now.)

Once the application was written, I compiled the application as usual and then packaged and installed the application to the simulator. I used the command line to package and install the app. You can read about the command line options online. You will need to retrieve the simulator IP to get this to work. Don’t forget to read about retrieving the IP of the simulator.

The command line packager and installer has a format like so:

blackberry-airpackager -package output_bar_file_name -installApp -launchApp project_name-app.xml project_name.swf any_other_project_files -device IP_address

I will not talk about the app itself at the moment but may cover that in a subsequent post, especially once I integrate with a few BlackBerry TabletOS specific features and gestures.

For now I just include a snapshot of the initial “Hello World” version.

Hello BlackBerry PlayBook World!

Hello BlackBerry PlayBook World!

Read the original blog entry...

More Stories By Shashank Tiwari

I am a technology entrepreneur, innovator, author and, as some say, a “thought leader”. I like to solve challenging computing problems, especially those that drive innovation. Being a polyglot programmer, I can program fluently in many languages, including Java, Python, C++, C, Ruby, ActionScript, JavaScript, Objective-C, Haskell, Scala, Clojure, PHP, Groovy, Lisp and Perl. I must admit that I like to learn programming languages and if there is a new interesting one coming, I wouldn’t be far behind getting to grips with it. Over the last many years I have built some cutting edge enterprise and consumer software applications, many of which have leveraged large data sets and the web based programming paradigms. This means I also know a lot about data bases and persistence. I am very conversant with relational databases, embedded databases, object databases, text based data and XML. Having leveraged web based programming paradigms, I have first hand experience with a lot of web development frameworks, including but not limited to Adobe Flex, Spring MVC, Rails, Grails and Django. Not to forget, I obviously have worked a lot with HTML, JS and CSS. My experience and interest are varied and diverse and range a wide spectrum of application development realms that include the server, the client and the middleware. Besides, programming, I am also deeply interested in mathematics and theoretical computer science. This motivates me to bring my knowledge of applied mathematics, statistical modeling, artificial intelligence and sometimes simply data structures, to good use, when I build applications. A couple of domains like financial mathematics and scientific computing seem to have been good fit for such expertise. I am an ardent supporter of open source software and try and contribute to open source code bases and causes. I like the plurality and variety that software development offers; the choice of programming languages, the abundant availability of tools and libraries, the existence of multiple operating systems and the possibility of varied software development methodologies. As a member of the technology community, I am an active contributor to the ever evolving software development languages, methodologies and standards. I am an expert group member on a number of JCP (Java Community Process) specifications, for example JSRs 274, 283, 299, 301 & 312, and have been recognized as an Adobe Flex Champion.I run and organize a few community events like Flex Camp Wall Street, Show Ramp and Polyglot World. I bring together all my expertise in terms of services and products via my primary venture, Treasury of Ideas LLC, in which I play the role of a Managing Partner. Treasury of Ideas LLC, through its focus on innovation and value optimization, offers many best of the breed services and products and has incubated many ideas to help translate them to reality. Our clients range from large enterprises, government agencies, not-for-profit organizations to promising new startups. I write regularly in many technical journals and magazines, present in seminars and mentor developers and architects. I have authored a few books, including Advanced Flex 3 (friends of Ed/APress, 2008) and Professional BlazeDS (Wrox/Wiley, 2009) , and am in the process of authoring a few more. You can learn all about my books and public talks by browsing through the Publish & Present page at www.shanky.org.