Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Contributor
jayantv
Posts: 2
Registered: ‎10-25-2010
My Device: Not Specified

How to compile the sample apps that came with the SDK from the command line

Hi,

 I do not have Flex Builder, Apanta, Eclipse or whatsoever because I just have xCode on my Mac.

Now with the SDK, there is the mxmlc compiler, how can I from the command line compile the source code of Hello World and install into the simulator?

 

If this easy task is cumbersome, then working with the SDK is not going to be an easy sway for developers from other platforms. There is no integrated IDE, have to rely on 3rd part which might or might not work on the platform/machine.

 

so, any ideas, please let me know.

 

cheers,

 

Jayant C Varma

Developer
fnicollet
Posts: 85
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to compile the sample apps that came with the SDK from the command line

Hi, you can use xCode to build Flex Applications, here is a how-to guide:

http://blog.joshbuhler.com/xcodeflex/

If you want to build using command line, check the livedocs:

http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_1.html

It might to be up to date but it will give you a good start. Anyway, for AS3 / Flex development, i strongly recommand you to use Flash Builder, it's worth it and makes you a lot more productive than trying to fit into other IDEs

 

 

Fabien

Hope this helps,
Fabien

--
1. If you liked my post or found it useful please click on the white star and provide a Kudo!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!
Developer
taylortbb
Posts: 137
Registered: ‎10-26-2010
My Device: Bold 9900 + PlayBook

Re: How to compile the sample apps that came with the SDK from the command line

[ Edited ]

See Post Below. These instructions have been replaced.

 

I'm in the same situation. I've managed to get an app compiled and deployed, but there's still major issues preventing it from working correctly. Unfortunately fnicollet's links are for Flex 3, that command doesn't exist in Flex 4 or AIR 2.5.

 

To get the .as file compiled I had to run:

 

 

../../blackberry-tablet-sdk-0.9.0/bin/mxmlc -library-path+=../../blackberry-tablet-sdk-0.9.0/frameworks/libs/qnx-screen/ -library-path+=../../blackberry-tablet-sdk-0.9.0/frameworks/libs/air/ -static-link-runtime-shared-libraries HelloWorld.as

 

 

Obviously those paths will be different on your system.

 

It appears to depend on two .swc files. The airglobal.swc in frameworks/libs/air and qnx-screen.swc in frameworks/libs/qnx-screen.

 

If I don't use the "-static-link-runtime-shared-libraries" command then I compile warning about runtime shared libraries (RSLs). If I ignore the warning and deploy my app it will just be a grey screen. I can't find qnx-screen.swc anywhere on the PlayBook's file system, so as far as I can tell every app should have this statically linked. Without it the app is of course unable to draw UI controls, and I get the blank screen. airglobal.swc is located on the PlayBook's filesystem, but I am unsure if I have been successful in getting it to be dynamically linked (I'd never touched AIR/Flex before today).

 

With the use of the static link options however I do get a working .swf, so I can deploy it. To do that you're going to need a valid manifest XML file. I extracted RSSReader.fxp and grabbed its RSSReader-app.xml. I then edited the file to change the names over to HelloWorld. Because I'm not using FlexBuilder I had to manually set the .swf file to RSSReader.swf. The file from the example will have a little note saying it will be automatically input, I wish.

 

You'll also need your icon in the same folder as your manifest and source file. The docs cover the details of what you need for it.

 

Now that we've got our 3 files you can use the packager and deploy to your simulator. That requires the use of the command:

 

 

../../blackberry-tablet-sdk-0.9.0/bin/blackberry-airpackager -package HelloWorld.bar -installApp -launchApp HelloWorld-app.xml HelloWorld.swf blackberry.png -device 192.168.0.246

That command is pretty much straight out of the getting started guide. Of course, tweak paths and addresses to be appropriate for your system.

 

At this point the deployment will work and you should have an AIR app in your simulator.

 

Unfortunately, there's a really major catch. If your AIR app does anything fancy (translation: anything worth writing) then all you'll get is a grey screen, just like the dependencies weren't linked properly. It appears to be a product of accessing anything outside the qnx.ui package. Why? I've got absolutely no idea. If I take the HelloWorld app from the getting starting guide it works perfectly. If I add an 'import qnx.media.MediaPlayer;' my app still works fine. But if I change the close button to instead execute 'var mp:MediaPlayer = new MediaPlayer("01.mp3");' then my app becomes a grey screen. It doesn't even wait for me to click the button to go grey, the app is completely non-functional.

 

I've been trying to make this work for several hours now, but I'm not really any closer to a solution. I thought it might be related to the linking, but I've tried everything and nothing has changed. Static linking both .swc's, dynamically linking the AIR one, nothing changes what happens. I've tried it with things other than the media player too. The RSSReader demo is non-functional too, though I haven't isolated what specifically causes these issues.

 

I've extracted the .swf from RSSReader.bar and used it in place of my own compiled version when packaging. That version works perfectly, so it's an issue in the compilation and not the packaging.

 

I hope that's enough to get you started, hopefully you'll have more insight into how to get past this roadblock, or maybe someone else here will know what is wrong.

 

TO RIM (Employees): You really need to document how to do this from the command line without FlashBuilder; otherwise there might as well be a $250 fee to develop for Tablet OS. $250 kills any chance of me writing a free app for the PlayBook, and possibly any chance of me developing an AIR app at all. WebWorks doesn't provide the power of AIR, and the native SDK will be comparatively time consuming (C isn't nearly as fast to write as ActionScript). Long term free dev tools are more important than free PlayBooks for getting non-commercial developers.

 

--------
Taylor Byrnes
Developer
taylortbb
Posts: 137
Registered: ‎10-26-2010
My Device: Bold 9900 + PlayBook

Re: How to compile the sample apps that came with the SDK from the command line

[ Edited ]

Okay, there was an error in my process. I expected amxmlc to be included with the AIR SDK, it's not, it's included with the Flex SDK (which the Tablet OS SDK is a version of). Ultimately it appears amxmlc uses the same backend compiler, but it reads the configuration from a different file which has all the settings you need for a successful build.

 

My revised instructions are to first run:

 

 

../../blackberry-tablet-sdk-0.9.0/bin/amxmlc HelloWorld.as

 

 

To do the deployment you're going to need a valid manifest XML file. I extracted RSSReader.fxp and grabbed its RSSReader-app.xml. I then edited the file to change the names over to HelloWorld. Because I'm not using FlashBuilder I had to manually set the .swf file to RSSReader.swf. The file from the example will have a little note saying it will be automatically input, I wish.

 

You'll also need your icon in the same folder as your manifest and source file. The docs cover the details of what you need for it.

 

Now that we've got our 3 files you can use the packager and deploy to your simulator. That requires the use of the command:

 

 

../../blackberry-tablet-sdk-0.9.0/bin/blackberry-airpackager -package HelloWorld.bar -installApp -launchApp HelloWorld-app.xml HelloWorld.swf blackberry.png -device 192.168.0.246

 

 

Of course edit paths and address as appropriate for your system.

 

At this points your AIR app should successfully deploy. The RSSReader sample now works perfectly for me, and I'm going to try developing something more advanced.

 

Both of these commands were actually executed by me on Linux. All of the Mac shell scripts in the PlayBook SDK that I've tried work perfectly on Linux, so you don't even need to launch the JARs manually. I believe everything will be the same on Mac OS as the scripts are originally for Mac OS. Windows users should be fine too as there are equivalent batch files.

--------
Taylor Byrnes
Developer
haimez
Posts: 23
Registered: ‎10-26-2010
My Device: 9650

Re: How to compile the sample apps that came with the SDK from the command line

Thanks taylortbb, I'll have to try this when I get home. I also have to agree with your remark regarding the SDK. They're essentially requiring a $250 fee to be a PlayBook developer and that's going to guarantee that only professional developers will build PlayBook apps.

That strategy might work out in the short-term, but professional developers aren't going to bring enough innovative and cool apps to the table. To do that, you need independent developers and to get those, the costs to develop have to be low. This doesn't bode well for RIM's chances in the upcoming PlayBook vs. Android Tablet vs. IPad war.
Developer
Harry_Dodgson
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900

Re: How to compile the sample apps that came with the SDK from the command line

[ Edited ]

Hi,

 

Here is a C-shell script that does the same as above....

#!/bin/csh

# $1 is argument typed on command line with your project name i.e. HelloWorld

# set these two for your environment
set SDKBIN = "/Applications/Adobe Flash Builder 4/sdks/blackberry-tablet-sdk-0.9.0/bin"
set DEV = "172.16.198.128"

"$SDKBIN"/amxmlc "$1".as

if ($? != 0) then
  exit -1
endif

"$SDKBIN"/blackberry-airpackager -package "$1".bar -installApp -launchApp "$1"-app.xml "$1".swf blackberry-tablet-icon.png -device $DEV

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn
New Contributor
electricthought
Posts: 5
Registered: ‎12-15-2010
My Device: Not Specified

Re: How to compile the sample apps that came with the SDK from the command line

$250-$700 to start developing?????

 

Trying to make money on developers that ultimately create products that makes your platform a success?

 

Come one Mike!  Stop this greed and let us code for free!

Developer
kdittyr
Posts: 278
Registered: ‎10-27-2010
My Device: Playbook

Re: How to compile the sample apps that came with the SDK from the command line

[ Edited ]

@electricthought,

 

You can code for free using the mxmlc compiler ( provided free by Adobe ).  Absolutely no money is required to write an application and get it onto the Blackberry Playbook.  I don't see any greed in this at all.

--------------
kdittyr

Accepted PlayBook Applications:
HDB Converter -- Utilities/Calculators
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: How to compile the sample apps that came with the SDK from the command line

I can understand your frustration if you alredy dont have Flash Builder as an IDE for build Flex/AIR products.  For me, I've been developing Flex/AIR applications for years, so the PB is just another platform to target.  However, you do not have to use Flash Builder to develop against.  All the Adobe AIR SDK are FREE to download and compile at the command line.  The BB SDK is free and all of their tools are FREE to work with the FREE simulator and FREE VMWare.  Getting your application to the end consumer via App World is FREE (for now).  Getting signed keys with BB is FREE.

 

If you want to increase your productivity and use additonal tools that helps make your application better, than Flash Builder is something to consider.  If you feel you will never get a positive ROI on your investment with Flash Builder than that is a business decision to make not a technical one.  Both Adobe and BB has provide a FREE path to develop applications.

 

True the current BB/PB environment is in a beta stage.  The term "beta" can mean a lot of things.  I dont think the current beta is near a candidate release level since a lot of functionality is still evolving and the testing environment is minimal, but we're getting there.  Being an early adoptor is never easy.

 

good luck with your decision.  For what it is worth, this community has been very helpful in getting over humps.  We welcome you since all our succeses are tied together.

Developer
kdittyr
Posts: 278
Registered: ‎10-27-2010
My Device: Playbook

Re: How to compile the sample apps that came with the SDK from the command line

Great reply, like you, I have been writing software in Flex Builder ( now Flash Builder ) and Actionscript every day for many years now.  When I saw that RIM had decided to include Air in their OS it was a no brainer for me to want to support a product that supports my profession.

--------------
kdittyr

Accepted PlayBook Applications:
HDB Converter -- Utilities/Calculators