Using git, perform the following in a command prompt:
The above command will copy Samples-for-Air source to Samples-for-AIR directory.
GitHub also provides git-less access to a repo’s sources via a zip-ball. In this case, point your browser or curl to https://github.com/blackberry/Samples-for-AIR/zipball/master and unzip.
Importing project into Flash Builder 4.5
Adobe Flash Builder 4.5 and Blackberry Tablet OS SDK for Adobe AIR are both required to build the Samples for AIR project. See http://us.blackberry.com/developers/tablet/adobe.jsp
Once you’ve checked out the Samples-for-Air project, launch Flash Builder 4.5 and click File\Import\Flash Builder\Flash Builder Project
Select Project Folder Samples-For-Air\SampleLibrary and click Finish.
Repeat the above steps and import Samples-For-Air\SampleApplication and click Finish.
You should now have two projects SampleAirApplication and SampleAirLibrary. You’re now ready to begin exploring the sample application and library.
When creating this project Adobe AIR SDK version 3.1 was used with the BlackBerry tablet OS SDK. Therefore, if you’re using a different Adobe AIR SDK version, SampleAirApplication/src/SampleApplication-app.xml may require a change. If you experience the following error: Namespace x.x.x in the application descriptor file should be equal or higher than the minimum version x.x.x required by Flex SDK
The above example shows changing the xmlns version to 3.1 in the line
in SampleAirApplication/src/SampleApplication-app.xml to match the version of the Adobe AIR SDK version 3.1 installed.
Deploying Sample AIR project to the BlackBerry Playbook
NOTE, some included APIs will not execute within Desktop Application Flash builder debug profiles.
Select SampleAirApplication and choose Run As Mobile Application (or Debug As)
Set the following properties in the Debug Configurations window:
- Project: SampleAirApplication
- Application File: src/SampleApplication
- Target Platform: BlackBerry Tablet OS
- Launch Method: On device
NOTE: When configuring BlackBerry Tablet test device profile USB is preferred as WiFi reception can cause the connection to fail, depending on your WiFi signal strength. The USB port starts with 169.254.*.* If you are using Tablet OS version 1.0.7 and above the IP address will be 169.254.0.1 and set the debug host to 169.254.0.2.
Enabling debug mode on the BlackBerry Playbook
Enable development mode on your BlackBerry Playbook by visiting Playbook Options\Security\Development Mode and set Use development mode set to on.
Need help installing a Debug Token in your Playbook?
Customizing the Sample Library package path and directory structure
Open Samples-for-AIR\SampleLibrary\build.xml with your favourite editor and locate the line:
<property name=”generated.package.root” value=”com.playbook.samples”/>
To change the package path of the sample library change value=”com.playbook.samples” to your preferred package path. e .g.
<property name=”generated.package.root” value=”net.foo“/>
Then, from a command prompt, execute ant in Samples-for-AIR\SampleLibrary
[echo] Generated source will copied to: generated/net/foo
[echo] Target package: net.foo.*
[echo] Generated source copied to: generated/net/foo
Total time: 1 second
The newly generated source files will be found in Samples-for-AIR\SampleLibrary\generated
After running the above example, the package path in each source file starts with net.foo. e.g Samples-for-AIR\SampleLibrary\generated\net\foo\ui\menu\Menu.as contains package net.foo.ui.menu
See related post Samples for AIR: An open source project for the BlackBerry Playbook.