Prerequisite Knowledge
You should have some familiarity with building Adobe AIR applications.
Required Products
Adobe AIR
Flash Builder 4 (Download trial)
Sample Files
User level
This article discusses some basic concepts about the RIM BlackBerry PlayBook, the Adobe AIR and Adobe Flash Player runtimes, the relevant SDKs and tooling choices, the BlackBerry ecosystem, and how they all fit together. You'll get a better understanding of what I call the PlayBook difference—what sets the PlayBook apart from other devices. As a platform, the PlayBook provides many unique opportunities for developers and this article will help you recognize these opportunities and act upon them.

Introduction to RIM PlayBook and Adobe AIR

The BlackBerry PlayBook is a tablet device created by Research In Motion (RIM). The PlayBook runs the BlackBerry Tablet OS, which is based on the QNX OS created by QNX, a RIM subsidiary.
Note: Currently the PlayBook and BlackBerry Tablet OS are still in beta and will be released in the first half of 2011. Information in this article is relative to the information available as of February 2011 and might not reflect actual release features and functionality.
Adobe AIR is a runtime that enables you to build standalone applications for the desktop, TVs, and devices. Along with Adobe Flash Player, it provides a unique platform for developers to build highly engaging applications across multiple screens. The first PlayBook difference is the level of integration between AIR and the device. The PlayBook uses AIR at the OS level. There is tight integration between AIR and the core QNX OS, and many native PlayBook applications are built to run in AIR. For example the camera native UI, native media player, and settings panel all are AIR apps. There are other ways to build applications on the PlayBook, described later in this article, but the fact that many of the core PlayBook applications built with AIR make it a differentiator.
The RIM team provides developers with the same components used to build native PlayBook apps. This ActionScript-based set of components is referred to as the QNX component library. The QNX components are found in the BlackBerry Tablet OS SDK for Adobe AIR. That means that, as a developer, you can use the same components that are used in the native PlayBook applications. The QNX components have been optimized for the PlayBook and touchscreen interaction. The BlackBerry Tablet OS SDK for Adobe AIR also includes the command-line tools to build, package, debug, and deploy PlayBook (.bar) applications to the PlayBook simulator or device.

Flex SDK Hero and Flash Builder "Burrito"

At a basic level, AIR and Flash Player run SWF files, typically referred to as Flash or AIR apps. To create a SWF file, ActionScript is compiled into bytecode, which is then interpreted by AIR or Flash Player at runtime. Flex is a framework of ActionScript classes that help developers build rich applications. The Flex SDK also allows you to build applications with MXML, a declarative markup language that makes layout and view-based development easy. In the end, Flex and MXML are translated into ActionScript that is compiled into a SWF.
Both the QNX component library and Flex provide a set of UI components. The Flex framework also provides features and supporting classes for a wide variety of application development needs, such as CSS styling, binding, modules, and FXG-based skinning. Flex has been around for several years and is used in mission-critical applications around the world. With the preview releases of Flex SDK "Hero" and Flash Builder "Burrito", developers are able to build applications optimized and targeted for devices (see Figure 1).
Creating a new Flex mobile AIR project in Flash Builder "Burrito"
Figure 1. Creating a new Flex mobile AIR project in Flash Builder "Burrito".
The QNX components and Flex SDK "Hero" both work very well on the PlayBook. Although there are many factors to consider when deciding which framework to use, keep in mind that both are optimized for devices and the PlayBook touchscreen. As part of the PlayBook development ecosystem, BlackBerry provides a BlackBerry Tablet OS plug-in for both Flash Builder 4 and Flash Builder "Burrito". Using this plug-in, you can package, debug, and deploy applications to the PlayBook simulator or device from within Flash Builder. From the Run Configurations dialog box, you can specify the target platform and whether you want to run your application on the desktop or on the actual device (see Figure 2).
Preparing to run the RIMMobileAIR application (targeting the BlackBerry Tablet OS platform) on the PlayBook device.
Figure 2. Preparing to run the RIMMobileAIR application (targeting the BlackBerry Tablet OS platform) on the PlayBook device.
With Flash Builder "Burrito" you can create Flex mobile projects and ActionScript mobile projects. Both types of mobile projects allow you to target the BlackBerry Tablet OS platform and build applications using the QNX libraries. Although the QNX components do not work directly with the Flex framework, there are ways to mesh them together. For more information on this topic, check the BlackBerry forums for relevant threads since it is beyond the scope of this article.

The hardware difference

The specifications of the PlayBook show that RIM intends on leading the tablet space. The PlayBook offers many powerful and intriguing hardware features:
  • Dual-core 1GHz CPU
  • 1 GB RAM
  • Dual cameras: 3 MP front-facing, 5 MP rear-facing
  • Stereo sound
  • 7-inch screen, 1024 × 600 resolution
  • Multitouch interface, supporting four touch points
  • 1080p HD video
  • Video codec support for H.264, MPEG4, and WMV, as well as AIR video codec support
  • HDMI video output through Micro HDMI port
  • 5.1" × 7.6" × 0.4" (130mm × 194mm × 10mm)
  • 0.9 lbs. (400 g.)
  • Wi-Fi 802.11 a/b/g/n
  • PlayBook system gestures, swiping from bezel into screen.
Along with the hardware features, the QNX OS will come with the following features:
  • WebKit (HTML5 and Flash Player 10.1)
    • Acid3 score: 100/100
    • CSS3 Selectors test score: 578/578
    • HTML5 test score: 208/300
  • True multitasking
  • Application-specific swipe down gesture for developer integration
  • Custom app notifications
  • BlackBerry security and data efficiency, including locking the device by application and not necessarily the whole device
  • Pairing with BlackBerry smartphones over secure Bluetooth connection to push e-mail, calendar, BlackBerry Messenger, task, and document data

The BlackBerry difference

There are many avenues to take when building applications for the PlayBook. The approach you take will likely depend on your background. A Flex developer, for example, may take a different path than a BlackBerry developer. BlackBerry offers their existing developer base the option to use WebWorks and Java integration (the exact Java SDK and details have not yet been determined). The BlackBerry Tablet OS SDK for Adobe AIR is the first SDK for BlackBerry tablets and comes with tooling integration using Flash Builder. The details of each of the development SDKs are discussed later in this article.
These approaches have one thing in common: They all use a VMWare image for simulating the PlayBook device. BlackBerry provides this BlackBerry PlayBook Simulator alongside its BlackBerry Tablet OS SDK download. Using the simulator, you can run the apps you develop without an actual device. There are obviously some features that will not work on a VMWare image, but having a full OS image is quite different from other mobile devices that provide only an emulator or no simulation environment at all. Both the PlayBook Simulator and device use an IP address to deploy and debug applications over your network. No cables are required to sync or debug your applications.
Once you've finished developing your application, you'll want an efficient way to distribute it. PlayBook applications will be distributed through the App World application found on the PlayBook. The App World application and other BlackBerry services enable revenue opportunities such as marketplace sales, advertising, and in-app purchases.
App World
BlackBerry App World is the official marketplace for apps that run on Blackberry devices, including the PlayBook. Currently, App World is accepting PlayBook application submissions. The marketplace is available in 70 countries and in six different languages. End users can purchase applications using a BlackBerry ID, carrier billing, or a credit card. The developer's share of a sale is 70 percent. To participate in App World and other BlackBerry services, a developer must sign up as a vendor. As a vendor, you have access to other BlackBerry services outlined below.
Payment service (in-app payments)
The BlackBerry Payment Service provides APIs for selling in-application goods. These can include art, e-books, game levels, character customization, video streaming, or other dynamic content. To sell a digital good to an application user, the vendor first must register each digital good through the vendor portal. The developer uses the API inside the application to create a connection to the payment service and send a purchase call. The user is then prompted to purchase the digital good with a PlayBook-specific dialog box. The current BlackBerry Tablet OS SDK for Adobe AIR provides the Payment Service APIs to test various purchase/non-purchase use cases around in-application selling. For an example of the current Tablet OS SDK for Adobe AIR API, see my blog post on the topic, Using BlackBerry Payment Service with Adobe AIR for the PlayBook.
Advertising service
BlackBerry offers vendors the ability to add advertising to their applications with a few lines of code. The API for this service has not been released but RIM has stated it will be coming in the future. BlackBerry provides a vendor management portal to easily select and change different ad networks without changing any code in the application. This allows for multinetwork advertising inside the application with a simple set of API calls. The revenue split for this service is 60 percent for the vendor.
Analytics service powered by Webtrends
Analytics are important for maximizing revenues and refining application experiences. BlackBerry has partnered with Webtrends to provide vendors with insight into how users are using their applications. Vendors can track application use, frequency of use, user loyalty, and even individual screen and feature access. The release of the API for this service is also still pending.

The BlackBerry Tablet OS SDK for Adobe AIR difference

One thing that stands out with the BlackBerry Tablet OS SDK for Adobe AIR is the extended AIR APIs that provide PlayBook-specific features. For example, as the developer you have access to device-specific information via the qnx.system.Device class, including the board serial number (bsn), hardware ID, vendor ID, battery level, battery state, device PIN, and SCM bundle. You can use the qnx.system.QNXApplication class to listen for the bevel swipe down gesture to display secondary navigation or context menus inside the application. The package contains classes for media playback, including hardware accelerated playback, as well as playback of all PlayBook supported codecs. The ability to view HTML content inside of AIR is extended by the class, which provides hooks to control the web view directly.
The payment services mentioned above are also extended SDK APIs. APIs to call out to the PlayBook notification system and make calls to C/C++ applications are also planned. These are just some of the API highlights; it is not an exhaustive list. For more details, see the BlackBerry Tablet OS SDK for Adobe AIR API Reference.

What other tablet OS SDKs mean for AIR apps

In addition to the main BlackBerry Tablet OS SDK for Adobe AIR, the PlayBook will support applications built with other SDKs. Currently slated for the PlayBook, these SDKs will support developing applications using the browser (both HTML5 and Flash Player 10.1), BlackBerry WebWorks, and native C/C++.
Browser development
The WebKit used in the PlayBook has roots in the BlackBerry 6 WebKit browser, with enhanced support for HTML5 and CSS3. Along with this HTML engine, the PlayBook browser supports Flash Player 10.1, making it easy for developers to reuse their existing web games or content in the PlayBook browser. The PlayBook browser performs very well in web standard tests—see the section, "The hardware difference," for details. It also features improved JavaScript performance, touch event handling, and data handling.
BlackBerry WebWorks
BlackBerry WebWorks enables developers to use modern web technologies to build BlackBerry applications that can take full advantage of the BlackBerry platform (see Figure 3). Using BlackBerry WebWorks tools, developers can be more productive as they create BlackBerry applications that interact with BlackBerry devices.
The WebKit engine and the WebWorks platform in a high-level architecture diagram
Figure 3. The WebKit engine and the WebWorks platform in a high-level architecture diagram.
Applications built with WebWorks for BlackBerry 6 devices will work on the PlayBook with limited modifications. Developers can currently download the WebWorks SDK for Tablet OS for PlayBook and test applications on the simulator.
BlackBerry Native SDK
The Native SDK uses the C/C++ development environment and provides low-level access to features such as OpenGL 2.0, networking, and data storage. BlackBerry provides tooling integration with the existing QNX Momentics SDK and tool suite. The target audience for this SDK is game developers, but it also opens opportunities for developers to build apps using the Native SDK and pair them with other PlayBook applications. For example, an AIR app might use a Native SDK built application as an extension to handle performance intensive routines.
Note: Exact details for how applications built with the Native SDK can be used to extend AIR applications will not be available until the Native SDK is available.

Where to go from here

Both the BlackBerry Tablet OS SDK for Adobe AIR and Flash Builder will continue to improve the AIR application development workflow for devices. Be sure to look for new updates in the future.
In the meantime, learn more at the BlackBerry topic page on the Adobe Developer Connection, as well as the official BlackBerry PlayBook site. For the latest information, check out the BlackBerry developer forums or the BlackBerry PlayBook posts on my blog.