Playbook Development with FDT and ANT
December 13th, 2010 • ActionScript, AIR, Flash, Playbook
I just put up a sample FDT project on github which gets you started with BlackBerry Playbook development with FDT. I comes with an ANT build.xml which pretty much does all the work for you.
https://github.com/formatlos/hello-playbook-with-fdt
Setting up Playbook SDK and Simulator
There are a few good tutorials out there which explains the setup process in detail, so I don’t want to bother you with that … and it’s really straightforward anyway.
http://us.blackberry.com/developers/tablet/devresources.jsp
http://www.12robots.com/index.cfm/2010/11/21/Getting-your-BlackBerry-PlayBook-development-environment-set-up–Part-One
Setting up FDT
First of all you need to setup an ANT property. Go to Eclipse Settings -> ANT -> runtime -> Properties -> Add Property and type in the name “BB_TABLET_SDK_HOME” and as value the path to your installed Playbook SDK. Insert another property with the name “FLEX_HOME” and point it to the same location … you’ll need this to use the mxmlc task.
ANT property
SDK
The Playbook SDK is basically just a AIR SDK with a little extra spice … so you can add the SDK to your FDT settings like you do with every other SDK.
Project
After that you can create a new project or download my sample project from github. Create “Empty AS3 AIR Project” and select the installed Playbook SDK in my case “BlackBerry Tablet OS SDK 0.9.1 for Adobe AIR”.
your project structure should look like this:
FDT doesn’t add the blackberry specific SWCs automatically to the project, you have to do this step manually. To do that open your project properties -> FDT Build Path -> SDK Library -> Select SWCs and select the blackberry.swc, qnx-screen.swc and qnx-air.swc …
that’s it!! now you can use the build targets to compile your App and deploy it to the simulator.
Debugging Procedure
After running the debug-deploy target you’ll probably look for any trace output. The SDK ships with another tool you can use to debug your App it’s called fdb. Open a terminal window and launch the fdb tool, once the Flash Debugger opens issue the command “run”. The debugger times out if nothing connects within about 60 seconds, yo you should immediately start you debug-deploy target after running the debugger.
Your application should deploy and connect to the debugger but probably it’ll take a bit before the simulator connects. If you have a firewall it can interfere with the simulator’s ability to connect, make sure port 7935 is open. When the simulator connects you will be prompted to enter breakpoints. If you don’t want to add any breakpoints just type “continue” and your Application will start up and you’ll see the trace output in you terminal.
23 Responses (Add Your Comment)
-
-
Hey Martin, excellent read. Managed to get it working with the new SDK as well, though the debugging process is still cumbersome. There’s got to be some easier way to get your traces into Eclipse/FDT. :)
-
@Doccie have you tried SOSMax? Not integrated in FDT but should do the job.
-
Kirill February 2, 2011at 12:43 am
I have some problem when compile project:
Buildfile: D:\Development\FDT4\Workspace\HelloPlaybook\build.xml
clean:
debug-compile:
[echo] === compile class D:\Development\FDT4\Workspace\HelloPlaybook/src/HelloPlaybook.as to D:\Development\FDT4\Workspace\HelloPlaybook/bin/HelloPlaybook.swf ===BUILD FAILED
D:\Development\FDT4\Workspace\HelloPlaybook\build.xml:70: The following error occurred while executing this line:
D:\Development\FDT4\Workspace\HelloPlaybook\build.xml:182: FLEX_HOME must be set to use the Flex Ant TasksWindows 7 64x
-
Kirill February 2, 2011at 7:26 pm
another error when deploy example program:
Buildfile: D:\Development\GitHub\hello-playbook-with-fdt\build.xml
clean:
debug-compile:
[echo] === compile class D:\Development\GitHub\hello-playbook-with-fdt/src/HelloPlaybook.as to D:\Development\GitHub\hello-playbook-with-fdt/bin/HelloPlaybook.swf ===
[mxmlc] ???????? ????? ???????????? D:\Development\SDKs\blackberry-tablet-sdk-0.9.2\frameworks\air-config.xml
[mxmlc] D:\Development\GitHub\hello-playbook-with-fdt\bin\HelloPlaybook.swf (255230 ????)
debug-deploy:BUILD FAILED
D:\Development\GitHub\hello-playbook-with-fdt\build.xml:85: Execute failed: java.io.IOException: Cannot run program “D:\Development\SDKs\blackberry-tablet-sdk-0.9.2\bin\blackberry-airpackager” (in directory “D:\Development\GitHub\hello-playbook-with-fdt\bin”): CreateProcess error=193, %1 ?? ???????? ??????????? Win32Total time: 4 seconds
My “D:\Development\SDKs\blackberry-tablet-sdk-0.9.2\bin\” folder:
http://twitpic.com/3vto11Windows 7 64x
-
Kirill February 2, 2011at 9:16 pm
Thank you very much!)
But I’ve another problem w/ debug application.
my computer ip address:
http://twitpic.com/3vum7kmy build.xml
http://twitpic.com/3vuhxuproblem w/ debuggin’ in playbook emulator:
http://twitpic.com/3vun30 -
another happy clone on osx with fdt 4.2!
great ant script, just don’t forget to set your device password and id.
wasn’t able to try debugging yet as i’m behind a corporate firewall i have no control over. i use flashconsole most of the time anyway :)
i’m curious about your usual workflow–do you test your application most of the time as a native/desktop air application, then build for playbook once in a while? or do you build for playbook with every change?
big thanks for this ant script and project!
-
Great post! Thanks for the build file! Got it all working on the simulator but couldn’t get the debug to work.
-
Debugging fine now, check the host IP is also changed I missed it first time.
I’m trying to use robotlegs.swc as a shared library and even though I have it on the build path(put it the libs folder) the compiler throws errors as it can’t find the Robotlegs classes. Any ideas why this would be?
Thanks,
-
Has anyone using this build script gotten a splashscreen to work? I don’t see a file corresponding to the blackberry-tablet.xml described at http://docs.blackberry.com/en/developers/deliverables/23959/Configuring_your_application_1524626_11.jsp
-
I got it! Created a blackberry-tablet.xml next to the the other XML files, added a blackberry-tablet.xml property to the and script and stuck that property in the debug-deploy and release-create-package tasks. Big ups!
-
I replaced my build.xml with your new file, to get the splash screen to work, and not I get the following error:
BUILD FAILED
C:\Users\Scott\Development\FDT\Workspace\Dunkkkin\build.xml:86: Execute failed: java.io.IOException: Cannot run program “C:\Users\Scott\Development\SDK\blackberry-tablet-sdk-0.9.4\bin\blackberry-airpackager” (in directory “C:\Users\Scott\Development\FDT\Workspace\Dunkkkin\bin”): CreateProcess error=193, %1 is not a valid Win32 applicationI can’t see how why this would suddenly occur?
Cheers,
Scott
-
Cheers Martin, I should have remembered as I changed this in the original project template. You probably already know but I received an email from RIM telling me the app icon has to be 86×86.
-
redHouse71 May 7, 2011at 11:36 pm
Thanks, Great post!
When I run the fdb tool and then launch the debug deploy the simulator always throws the error “unable to connect to host N/A please enter correct IP” even though I have entered the IP into the build.xml. When I enter the IP at this stage it works fine. Do I need to add something to my compiler arguments as it is very annoying having to enter the IP address everytime I want to debug.
Thanks again
-
Arthur Oliveira June 5, 2011at 9:02 am
Hello, Thank you for the post, it was very helpful. I am just having one problem. in my lib folder, I have also classes .as, how can I add the lib folder to my source? Thank you





Worked beautifully. Thanks so much for sharing your work and instructions… this is fantastic.