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
Contributor
turbidity
Posts: 26
Registered: ‎11-16-2010
My Device: Not Specified
Accepted Solution

Using QNX classes in a Flex Library Project

In order to be able to deploy to many platforms, I'm trying to build my application in a "headless" fashion; the main app class changes based on the OS I'm deploying it to, but the underlying library remains the same. I have my library classes in their own Flex Library Project, and the Playbook specific classes in their own project. Currently, I can't get any QNX classes to show up inside my library project, but they show up just fine in my main app project. I have both the main app and the library projects using the Playbook 0.9.1 SDK. 

 

Is there something special I need to do for a library project to bring in QNX classes, or am I missing something obvious? Thanks!

Contributor
underLabs
Posts: 37
Registered: ‎11-29-2010
My Device: Not Specified

Re: Using QNX classes in a Flex Library Project

[ Edited ]

funny, I was just about to post on that.

 

But my case may be the same. Like you, I cannot access the QNX library. I just downloaded Flex Burrito, and for some reason... I don't have access to the qnx library?

 

import qnx. (command + space) = nothing....

 

It was working with Blackberry Lib 0.9.0 and I had access to the lib, but not 0.9.1? Surely I'm missing something...

 

I also noticed that I don't need to have the Emulator, it just runs locally... in a special version of AIR I guess?

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Using QNX classes in a Flex Library Project

@turbidity: I need you to right click on your project and go to properites. Navigate to ActionScript Build Packaging and Click on BlackBerry Tablet. What do you see checked off? Make sure both checkboxes are checked off:

 

Screen shot 2010-12-07 at 2.13.35 AM.png

Next go to the ActionScript Build Path and what do you see there? You should get a list of libraries that FB4 uses to build and compile your program. Here's what you should see:

 

Screen shot 2010-12-07 at 2.15.26 AM.png

 

let me know if your settings are any different.

 

@underlabs: from the sound of it the SDK wasnt properly installed. Does it happen to all your apps you try to create? what steps did you follow to install the SDK? When creating a new ActionScript Mobile Project do you get the option to choose BlackBerry Tablet as a target platform?

 

in regards to having the Desktop AIR run your applications it is a standalone testing environment that does the basic AIR runtime functionality but it does not have the native playbook runtime. This means that of you try using any sort of dialog service or try to use a QNX component the formatting will be off and you may get errors. You are limited. Try redoing the SDK installation this time choosing the Flex Hero SDK instead of the AIR SDK when asked to choose in Step 3 i believe. (both options work for some people but i went with the Flex Hero and it installed properly.)

 

Good luck guys!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Contributor
underLabs
Posts: 37
Registered: ‎11-29-2010
My Device: Not Specified

Re: Using QNX classes in a Flex Library Project

[ Edited ]

I see... I was very pleased to flip flop between Actionscript and MXML when I created my app as a Flex Mobile Project.

 

It seems you can only access the qnx with a purely Actionscript Mobile Project.

 

I even tried manually adding the swcs of qnx in the Flex Mobile Project... but while compiling, I get an error:

 

VerifyError: Error #1079: Native methods are not allowed in loaded code.

 

Thanks though.

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Using QNX classes in a Flex Library Project

hey underlabs,

 

yeah unfortunately that was one of the caveats of using burrito. in order to directly access qnx ui components and such you have to use an actionscript mobile project. however there is a middle ground. if you do decide to use the Flex Mobile Project you can do so. If you go to the post below, renaun created an extension of the button class from the QNX library that can be used in an MXML format project. Its pretty cool actually. Gotta love those work arounds. Here's the link:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Using-QNX-components-in-MXML/m-p/...

 

Good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Contributor
turbidity
Posts: 26
Registered: ‎11-16-2010
My Device: Not Specified

Re: Using QNX classes in a Flex Library Project

Hi JRab, thanks for the advice.  It looks like I have quite the different setup. I'm using FB 4.0.1 Standalone. For my Flex Library Project, here are the options I have in the Properties panel. I don't have the QNX SWC in there, and I don't have the options for the ActionScript Build Packaging:
FlexLibraryProperties

For my main app project, because it is not a Flex Library Project, I have a different set of options, but interestingly the QNX SWC is not present in its Build Path either. I also don't have the access to the ActionScript Build Packaging options either.

bbScreenshot2.png

The only difference I saw between the main app project and the library projects' build paths was that the SDK was merged into the main app code, and that the library's wasn't. I tried switching that so the library merged the SDK code into it, but that didn't make any difference. I still can't import any qnx package classes without getting compile errors and it won't autocomplete the import.

 

Any ideas? Thanks!

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Using QNX classes in a Flex Library Project

hey,

 

the screen shots i showed you were from my flash builder 4.5 burrito application. so the menus will look a little different. this is the menu from my flash builder 4.0.1 application:

 

Screen shot 2010-12-08 at 1.31.35 AM.png

 

and with the libraries expanded:

 

Screen shot 2010-12-08 at 1.34.18 AM.png

from the looks of things your SDK did not install or isnt being read properly. did you follow and do everything according to the getting started for windows guide? good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Contributor
turbidity
Posts: 26
Registered: ‎11-16-2010
My Device: Not Specified

Re: Using QNX classes in a Flex Library Project

Aha! Thanks for the screenshot. That gave me the clue to figure out what the issue was. I noticed I also didn't have all the AIR classes you have. I went in and clicked the Include AIR Libraries under the Flex Library Compiler options in Properties and all the AIR libraries, including the qnx-air SWC showed up. Now I can bring in QNX classes into my Library project. I guess the QNX stuff gets lumped in with AIR and is not just part of the SDK by itself.

 

And I apologize for the long response time. I've been offline and then tied up with business. Thanks!

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Using QNX classes in a Flex Library Project

Haha don't sweat it! Just glad u got it figured out. Good luck with everything!
J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman