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

Native Development

Reply
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Calling NDK from AIR

What is the best way to call a NDK app/library from AIR?  Are there any samples that can clear the air on this that is both one time calls (eg. spawning) or interactive in sending info and receiveing events?

 

NativeProcess seems to be one way.

NativeExtension seems to be another.

 

Still digging.  Will report if I trip over anything.

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Calling NDK from AIR

We don't have any documentation or samples for this yet, but stay tuned...  :smileyhappy:

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
BlackBerry Development Advisor
pgarcia
Posts: 52
Registered: ‎04-01-2011
My Device: Torch, Playbook
My Carrier: Rogers

Re: Calling NDK from AIR

Hi,

 

in case you missed, the tutorial in online now. 

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Creating-Air-Native-Extensions-fo...

 

 

Cheers

 

---
Paulo Garcia
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Calling NDK from AIR

I am trying to follow the tutorial.

 

I get a compile error of "cannot find -lAirSub".

 

I think this has to do with the instructions at:

  • Make sure to select [ All Configurations ] in the Configurationfield on top of the dialog window.
  • In the list in the middle, click the (+) icon and enter the value AirStub when prompted.

 

The "list in the middle" I guessed to be "Libraries (-l)" becasue the steps prior ahd the QCC Linker/Libraries item selected. Is this correct? What is the "list in the middle"?

Please use plain text.
BlackBerry Development Advisor
pgarcia
Posts: 52
Registered: ‎04-01-2011
My Device: Torch, Playbook
My Carrier: Rogers

Re: Calling NDK from AIR

Hi,

It should be AirStub. I'll check if there is a typo in the document.

Cheers

---
Paulo Garcia
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Calling NDK from AIR

Ah. Fat fingers. Will try it later. Assuming that is the issue, it might help to edit the tutorial and state what list to click the + icon instead of the "middle". It was confusing.
Please use plain text.
BlackBerry Development Advisor
pgarcia
Posts: 52
Registered: ‎04-01-2011
My Device: Torch, Playbook
My Carrier: Rogers

Re: Calling NDK from AIR

Hi,

 

yes, I agree. I'm already doing some changes, corrections, etc... I'll add the list name, and maybe add a new image related to it. Thanks for the suggestion.

 

 

Cheers

 

 

 

 

---
Paulo Garcia
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Calling NDK from AIR

Some observations:

  • Was not clear which place to add the package directory.  I added it under the project's directory which seem fine.
  • Does the name space version of the extension.xml file always stay at 2.5 or will it be the same as the AIR namespace?
  • In the section where you are addidng the resulting SWC to the main application, you have for #3 "Action Script Build Path".  In 4.5.1, my IDE has "Flex Build Path".  Similar for step #7.

Otherwise it worked fine.  Great!

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Calling NDK from AIR

Is the contextInitializer(...) function in NDK only called once when when in AS3, ExtensionContext.createExtensionContext, is called and returns an ExtensionContext?

Please use plain text.
BlackBerry Development Advisor
pgarcia
Posts: 52
Registered: ‎04-01-2011
My Device: Torch, Playbook
My Carrier: Rogers

Re: Calling NDK from AIR

Hi,
my comments below:
  • Was not clear which place to add the package directory.  I added it under the project's directory which seem fine.

The package directory was my idea to keep the paths the simplest possible, since I've seen it is always a point of problems when working with command line. It could be whereever you want. In any case, I've added to the tutorial it should be under the project root folder.

   

  • Does the name space version of the extension.xml file always stay at 2.5 or will it be the same as the AIR namespace?

 

I didn't find an explanation why, but yes, you should use 2.5 for the extension namespace, even if you're working with  a different version of Air.

 

  • In the section where you are addidng the resulting SWC to the main application, you have for #3 "Action Script Build Path".  In 4.5.1, my IDE has "Flex Build Path".  Similar for step #7.

For Action Script and Flex projects, the configuration names are different. I've added them to the document for clarity sake.

 

 

Cheers

 

 

---
Paulo Garcia
Please use plain text.