Вы находитесь на странице: 1из 23

BlackBerry Tablet OS SDK for Adobe AIR

Version: 1.0 beta

Getting Started Guide For Windows Developers


Published: 2010-10-25
SWD-1360943-1024100522-001
Contents
1 Overview....................................................................................................................................................................................... 2

2 System requirements.................................................................................................................................................................. 3

3 Installing the BlackBerry Tablet OS SDK for Adobe AIR....................................................................................................... 4


Install the BlackBerry Tablet OS SDK for Adobe AIR................................................................................................................. 4
Configure a virtual machine for the BlackBerry Tablet Simulator............................................................................................. 4
Enable development mode.................................................................................................................................................... 8
Retrieving the IP address of the BlackBerry Tablet Simulator.......................................................................................... 8

4 Create an ActionScript project.................................................................................................................................................. 10

5 Testing your application............................................................................................................................................................. 14


Package and deploy your application in Flash Builder 4........................................................................................................... 14
Package and deploy your application from the command line................................................................................................. 16

6 Provide feedback......................................................................................................................................................................... 18

7 Legal notice.................................................................................................................................................................................. 19
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

Overview 1
The BlackBerry® Tablet OS SDK for Adobe® AIR® enables you to create applications for the BlackBerry® PlayBook™. The SDK
allows you to create Adobe AIR applications that engage BlackBerry PlayBook users who are attracted to the possibilties that
are offered by tablet computing on the BlackBerry® Application Platform.
The SDK installs a plug-in for Adobe® Flash® Builder 4. The plug-in allows you to create Adobe® ActionScript® projects intended
to run on the Adobe AIR runtime environment on the BlackBerry PlayBook. A BlackBerry® Tablet Simulator is available as a
separate download so that you can test the appearance and functionality of your applications.

2
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

System requirements 2
Your computer must meet all the following requirements before you install the BlackBerry® Tablet OS SDK for Adobe® AIR®:
• Adobe AIR SDK 2.5. You can download the SDK from http://www.adobe.com/go/getairsdk
• Intel® Pentium® 4 or AMD Athlon™ Desktop Processor 2 GHz or faster
• 1 GB or more available hard drive space
• 2 GB RAM or more
• Computer monitor with resolution of 1024 x 768 or higher
• Windows Vista™ Ultimate or Enterprise, Windows® XP with Service Pack 3, or Windows® 7. Note: 64-bit versions must run
in 32-bit mode.

3
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

Installing the BlackBerry Tablet OS SDK for Adobe AIR 3

Install the BlackBerry Tablet OS SDK for Adobe AIR


Before you begin:
You must download the BlackBerry® Tablet OS SDK for Adobe® AIR® from http://www.blackberry.com/developers/tabletos.
You must also download and extract the Adobe AIR SDK 2.5 at http://www.adobe.com/go/getairsdk.

1. In the folder where you downloaded the BlackBerry Tablet OS SDK for Adobe AIR, double-click the BlackBerryTabletSDK-
air-installer-win.exe file.
2. On the License Agreement screen, accept or decline the terms of the license agreement. Click Next.
3. On the Integration with Adobe Flash Builder screen, select Yes if you want to install the Adobe® Flash® Builder 4 plug-
in . Otherwise, select No. Click Next.
If you choose not to install the AdobeFlash Builder 4 plug-in, you must provide the location where you want the SDK installed.
You can package and deploy your application using the command line tools. For more information, see "Package and deploy
your application from the command line".
4. On the Choose Install Folder screen, provide the location of the folder where you installed Adobe Flash Builder 4. The
default location is C:\Program Files\Adobe\Adobe Flash Builder 4. Click Next.
5. On the Choose Adobe AIR SDK Install Folder screen, provide the location of the folder where you extracted the Adobe
AIR SDK 2.5. Click Next.
6. On the Pre-Installation Summary screen, verify your installation settings. Click Install.

Configure a virtual machine for the BlackBerry Tablet Simulator


Before you begin: Download and extract the BlackBerry® PlayBook™ virtual machine ISO file from http://www.blackberry.com/
developers/tabletos. You must also download and install the VMware® Player from http://www.vmware.com/download/player.

1. In VMware Player, click Create New Virtual Machine.

4
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

2. Select the Installer disc image file (iso) option.

3. Click Browse.
4. Select the BlackBerryPlayBookSimulator.iso file from the location where you extracted it.
5. Click Open.

5
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

6. Click Next.
7. Select the Other option from the Guest operating system section.
8. Select the Other option from the Version section.

9. Click Next.
10. In the Virtual machine name field, type a name for the simulator.
11. Click Next twice.
12. Click Customize Hardware.
13. In the Memory section, in the Memory for this virtual machine field, type 1024.

6
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

14. Select Display from the device list.


15. In the 3D graphics section, select the Accelerate 3D graphics checkbox.

16. Click OK.


17. Click Finish.
18. When your virtual machine starts for the first time, you will be prompted to overwrite /dev/hd0 with the QNX demonstration.
Type Y, then press the ENTER.
After you finish:

7
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

To load applications on the simulator, you must enable development mode and retrieve the IP address. For more information
about enabling development mode, see "Enable development mode". For more information about retrieving the IP address, see
"Retrieving the IP addres of the simulator".

Enable development mode


Before you can load and run your application on the BlackBerry® Tablet Simulator, you must enable development mode.
1. In the upper-right corner of the simulator screen, click the gear icon.
2. In the list of settings, click Security.
3. Beside the Device password label, click Change.
4. Set a password for the simulator.
5. Beside the Development mode is off label, click Enable.

Retrieving the IP address of the BlackBerry Tablet Simulator


Each time the BlackBerry® Tablet Simulator starts, VMware® Player assigns it an IP address. You must provide this address to
the deployment tool of your choice to load your application on to the simulator. To display the IP address, the simulator must be
in development mode. For more information about development mode, see "Enable development mode on the simulator".

8
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

After you enable development mode, click the image of the hammer (found to the right of the clock on the status bar) to display
the simulator's IP address.

9
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

Create an ActionScript project 4


You can create a BlackBerry® Tablet OS application using Adobe® ActionScript®. The following steps describe how to create an
ActionScript project named AIRHelloWorld in Adobe® Flash® Builder 4.
Before you begin:
You should create a 90 x 90 pixel image in PNG format to be used as an icon for your application. Your image file should be
named blackberry-tablet-icon.png.

1. On the File menu, click New > Flex Project.


2. In the Project name field, type AIRHelloWorld.
3. In the Application type section, select the Desktop (runs in Adobe AIR) option.
4. In the Flex SDK version section, select BlackBerry Tablet OS SDK for Adobe AIR.

10
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

5. Click Next twice.


6. In the Main application file field, type AIRHelloWorld.as.

11
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

7. Click Finish.
8. Paste the following code sample into AIRHelloWorld.as.
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFormat;
import qnx.ui.buttons.Button;
import qnx.ui.buttons.LabelButton;

// The following metadata specifies the size and properties of the canvas that
// this application should occupy on the BlackBerry PlayBook screen.
[SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]
public class AIRHelloWorld extends Sprite
{

12
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

public function AIRHelloWorld()


{
var helloButton:LabelButton = new LabelButton();
helloButton.label = "Hello World!";
helloButton.x = (stage.stageWidth - helloButton.width)/2;
helloButton.y = (stage.stageHeight - helloButton.height)/2;

var myFormat:TextFormat = new TextFormat();


myFormat.color = 0xAA0000;
myFormat.size = 24;
myFormat.italic = true;
myFormat.align = "center";

var text:TextField = new TextField();


text.text = "Close";
text.setTextFormat(myFormat);

var closeButton:Button = new Button();


closeButton.addChild(text);
closeButton.addEventListener(MouseEvent.CLICK, closeWindow);
closeButton.x = (stage.stageWidth - closeButton.width)/2;
closeButton.y = helloButton.y - helloButton.height;

addChild(helloButton);
addChild(closeButton);

stage.nativeWindow.visible = true;
}

private function closeWindow(event:MouseEvent):void{


stage.nativeWindow.close();
}
}
}
9. Add a 90 x 90 pixel image in PNG format named blackberry-tablet-icon.png to create an icon for your project.
10. Save the files in your project.

13
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

Testing your application 5


You can package and deploy your application to test it on the BlackBerry® Tablet Simulator. If you installed the BlackBerry®
Tablet OS SDK as an Adobe® Flash® Builder 4 plug-in, then you can configure the integrated launch tools to load your application
on the simulator. Otherwise, you can use the command line tools that are provided with the SDK.

Package and deploy your application in Flash Builder 4


Before you begin:
To deploy applications on the BlackBerry® Tablet Simulator, you must enable development mode and retrieve the IP address. For
more information about development mode, see "Enable development mode. For more information about retrieving the IP address
of your simulator, see "Retrieving the IP address of the BlackBerry Tablet Simulator.

1. In Adobe® Flash® Builder 4, on the Run menu, select Debug > Other.
2. In the list of debug configurations, select BlackBerry Tablet AIR Application.

3. Click the New button. The button is represented by a white rectangle with a yellow cross, above the list of debug
configurations.
4. Click Browse beside the Project field.
5. Click your project in the list in the dialog box.

14
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

6. On the Main tab, in the Deployment section, in the Target field, type the IP address of your simulator.

7. Click Apply.
8. On the Common tab, in the Display in favorites menu list, select the Debug check box.

15
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

9. Click Apply.
10. Click Debug to launch your application in the BlackBerry Tablet Simulator.

Package and deploy your application from the command line


Before you begin:
Add the path to the bin subfolder where you installed the BlackBerry® Tablet OS SDK to your PATH environment variable for
your operating system. The default location for this folder is C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\blackberry-
tablet-sdk\bin. For more information about command line options, run blackberry-airpackager from the command line
with no options.

1. Open a command prompt.


2. Navigate to the bin-debug subfolder of your project.
3. Type the following command to package, deploy, and launch your application.

16
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

blackberry-airpackager -package output_bar_file_name -installApp -launchApp


project_name-app.xml project_name.swf any_other_project_files
-device IP_address

17
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

Provide feedback 6
To provide feedback on this deliverable, visit www.blackberry.com/docsfeedback.

18
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

Legal notice 7
©2010 Research In Motion Limited. All rights reserved. BlackBerry®, RIM®, Research In Motion®, and related trademarks, names,
and logos are the property of Research In Motion Limited and are registered and/or used in the U.S. and countries around the
world.
ActionScript, Adobe AIR, and Adobe Flash are trademarks of Adobe Systems Incorporated. AMD Athlon is a trademark of Advanced
Micro Devices, Inc. Intel and Pentium are trademarks of Intel Corporation. VMware is a trademark of VMware, Inc. Windows,
Windows Vista,Windows XP, and Windows 7 are trademarks of Microsoft Corporation. All other trademarks are the property of
their respective owners.

This documentation including all documentation incorporated by reference herein such as documentation provided or made
available at www.blackberry.com/go/docs is provided or made accessible "AS IS" and "AS AVAILABLE" and without condition,
endorsement, guarantee, representation, or warranty of any kind by Research In Motion Limited and its affiliated companies
("RIM") and RIM assumes no responsibility for any typographical, technical, or other inaccuracies, errors, or omissions in this
documentation. In order to protect RIM proprietary and confidential information and/or trade secrets, this documentation may
describe some aspects of RIM technology in generalized terms. RIM reserves the right to periodically change information that
is contained in this documentation; however, RIM makes no commitment to provide any such changes, updates, enhancements,
or other additions to this documentation to you in a timely manner or at all.
This documentation might contain references to third-party sources of information, hardware or software, products or services
including components and content such as content protected by copyright and/or third-party web sites (collectively the "Third
Party Products and Services"). RIM does not control, and is not responsible for, any Third Party Products and Services including,
without limitation the content, accuracy, copyright compliance, compatibility, performance, trustworthiness, legality, decency,
links, or any other aspect of Third Party Products and Services. The inclusion of a reference to Third Party Products and Services
in this documentation does not imply endorsement by RIM of the Third Party Products and Services or the third party in any way.
EXCEPT TO THE EXTENT SPECIFICALLY PROHIBITED BY APPLICABLE LAW IN YOUR JURISDICTION, ALL CONDITIONS,
ENDORSEMENTS, GUARANTEES, REPRESENTATIONS, OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
WITHOUT LIMITATION, ANY CONDITIONS, ENDORSEMENTS, GUARANTEES, REPRESENTATIONS OR WARRANTIES OF
DURABILITY, FITNESS FOR A PARTICULAR PURPOSE OR USE, MERCHANTABILITY, MERCHANTABLE QUALITY, NON-
INFRINGEMENT, SATISFACTORY QUALITY, OR TITLE, OR ARISING FROM A STATUTE OR CUSTOM OR A COURSE OF DEALING
OR USAGE OF TRADE, OR RELATED TO THE DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-PERFORMANCE
OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED HEREIN, ARE
HEREBY EXCLUDED. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY BY STATE OR PROVINCE. SOME JURISDICTIONS
MAY NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES AND CONDITIONS. TO THE EXTENT
PERMITTED BY LAW, ANY IMPLIED WARRANTIES OR CONDITIONS RELATING TO THE DOCUMENTATION TO THE EXTENT
THEY CANNOT BE EXCLUDED AS SET OUT ABOVE, BUT CAN BE LIMITED, ARE HEREBY LIMITED TO NINETY (90) DAYS FROM
THE DATE YOU FIRST ACQUIRED THE DOCUMENTATION OR THE ITEM THAT IS THE SUBJECT OF THE CLAIM.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, IN NO EVENT SHALL RIM BE LIABLE
FOR ANY TYPE OF DAMAGES RELATED TO THIS DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-
PERFORMANCE OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED
HEREIN INCLUDING WITHOUT LIMITATION ANY OF THE FOLLOWING DAMAGES: DIRECT, CONSEQUENTIAL, EXEMPLARY,

19
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, OR AGGRAVATED DAMAGES, DAMAGES FOR LOSS OF PROFITS OR REVENUES,
FAILURE TO REALIZE ANY EXPECTED SAVINGS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, LOSS OF
BUSINESS OPPORTUNITY, OR CORRUPTION OR LOSS OF DATA, FAILURES TO TRANSMIT OR RECEIVE ANY DATA, PROBLEMS
ASSOCIATED WITH ANY APPLICATIONS USED IN CONJUNCTION WITH RIM PRODUCTS OR SERVICES, DOWNTIME COSTS,
LOSS OF THE USE OF RIM PRODUCTS OR SERVICES OR ANY PORTION THEREOF OR OF ANY AIRTIME SERVICES, COST OF
SUBSTITUTE GOODS, COSTS OF COVER, FACILITIES OR SERVICES, COST OF CAPITAL, OR OTHER SIMILAR PECUNIARY
LOSSES, WHETHER OR NOT SUCH DAMAGES WERE FORESEEN OR UNFORESEEN, AND EVEN IF RIM HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, RIM SHALL HAVE NO OTHER
OBLIGATION, DUTY, OR LIABILITY WHATSOEVER IN CONTRACT, TORT, OR OTHERWISE TO YOU INCLUDING ANY LIABILITY
FOR NEGLIGENCE OR STRICT LIABILITY.
THE LIMITATIONS, EXCLUSIONS, AND DISCLAIMERS HEREIN SHALL APPLY: (A) IRRESPECTIVE OF THE NATURE OF THE
CAUSE OF ACTION, DEMAND, OR ACTION BY YOU INCLUDING BUT NOT LIMITED TO BREACH OF CONTRACT, NEGLIGENCE,
TORT, STRICT LIABILITY OR ANY OTHER LEGAL THEORY AND SHALL SURVIVE A FUNDAMENTAL BREACH OR BREACHES
OR THE FAILURE OF THE ESSENTIAL PURPOSE OF THIS AGREEMENT OR OF ANY REMEDY CONTAINED HEREIN; AND (B)
TO RIM AND ITS AFFILIATED COMPANIES, THEIR SUCCESSORS, ASSIGNS, AGENTS, SUPPLIERS (INCLUDING AIRTIME
SERVICE PROVIDERS), AUTHORIZED RIM DISTRIBUTORS (ALSO INCLUDING AIRTIME SERVICE PROVIDERS) AND THEIR
RESPECTIVE DIRECTORS, EMPLOYEES, AND INDEPENDENT CONTRACTORS.
IN ADDITION TO THE LIMITATIONS AND EXCLUSIONS SET OUT ABOVE, IN NO EVENT SHALL ANY DIRECTOR, EMPLOYEE,
AGENT, DISTRIBUTOR, SUPPLIER, INDEPENDENT CONTRACTOR OF RIM OR ANY AFFILIATES OF RIM HAVE ANY LIABILITY
ARISING FROM OR RELATED TO THE DOCUMENTATION.
Prior to subscribing for, installing, or using any Third Party Products and Services, it is your responsibility to ensure that your
airtime service provider has agreed to support all of their features. Some airtime service providers might not offer Internet browsing
functionality with a subscription to the BlackBerry® Internet Service. Check with your service provider for availability, roaming
arrangements, service plans and features. Installation or use of Third Party Products and Services with RIM's products and services
may require one or more patent, trademark, copyright, or other licenses in order to avoid infringement or violation of third party
rights. You are solely responsible for determining whether to use Third Party Products and Services and if any third party licenses
are required to do so. If required you are responsible for acquiring them. You should not install or use Third Party Products and
Services until all necessary licenses have been acquired. Any Third Party Products and Services that are provided with RIM's
products and services are provided as a convenience to you and are provided "AS IS" with no express or implied conditions,
endorsements, guarantees, representations, or warranties of any kind by RIM and RIM assumes no liability whatsoever, in relation
thereto. Your use of Third Party Products and Services shall be governed by and subject to you agreeing to the terms of separate
licenses and other agreements applicable thereto with third parties, except to the extent expressly covered by a license or other
agreement with RIM.
Certain features outlined in this documentation require a minimum version of BlackBerry® Enterprise Server, BlackBerry® Desktop
Software, and/or BlackBerry® Device Software.

20
RIM Confidential and Proprietary Information - Beta Customers Only. Content and software are subject to change.

The terms of use of any RIM product or service are set out in a separate license or other agreement with RIM applicable thereto.
NOTHING IN THIS DOCUMENTATION IS INTENDED TO SUPERSEDE ANY EXPRESS WRITTEN AGREEMENTS OR WARRANTIES
PROVIDED BY RIM FOR PORTIONS OF ANY RIM PRODUCT OR SERVICE OTHER THAN THIS DOCUMENTATION.

Research In Motion Limited


295 Phillip Street
Waterloo, ON N2L 3W8
Canada

Research In Motion UK Limited


Centrum House
36 Station Road
Egham, Surrey TW20 9LF
United Kingdom

Published in Canada

21

Вам также может понравиться