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
New Contributor
geng
Posts: 5
Registered: ‎11-04-2011
My Device: Playbook

How to call NDK from Webworks?

How to call my NDK libraries form a Webworks widget? I can'f find any document for this issue.

BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: How to call NDK from Webworks?

[ Edited ]

Hello geng,

 

Unfortunately there is no direct route at this time, however I am in the process of verifying the following:

 

1) Create an AIR Extension to be accessed from your WebWorks application:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Tutorial-for-Writing-WebWorks-Ex...

 

2) Within that AIR Extension, access a native Extension:

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

 

Essentially, the chain becomes: WebWorks > Air > Native.

 

As noted, it is slightly round-about, however direct Native Extensions are not supported by WebWorks at this time. If you're willing to give it a go, let us know how it works out. I'll post my results once I've tested this as well.

 

EDIT: Fixed URLs.

 

Erik Oros

BlackBerry Development Advisor


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Contributor
geng
Posts: 5
Registered: ‎11-04-2011
My Device: Playbook

Re: How to call NDK from Webworks?

Thanks for you reply.

And is there any plan to support direct NDK extension?

Developer
ahmadahmad
Posts: 404
Registered: ‎05-31-2011
My Device: curve

Re: How to call NDK from Webworks?

this 2 links navigate to unfounded pages?!!!
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: How to call NDK from Webworks?

Thanks for the heads up. The links should now be fixed.

As for direct NDK extension support, nothing has been publicly released as this time so I am unable to say.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: How to call NDK from Webworks?

Currently WebWorks is wrapped as an AIR application because it was the only deployment avenue at the time.  As we move towards BBX we will be migrating the WebWorks code base out of AIR down to something closer to the platform.

 

At that point you won't have the extra layer of creating an AIR Native Extension.    What I would suggest is that if you are building an extension for WebWorks, build it in the NDK with an AIR wrapper for now, and that way when WebWorks comes down closer to the QNX core you can remove the AIR wrapper in future BBX versions.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
geng
Posts: 5
Registered: ‎11-04-2011
My Device: Playbook

Re: How to call NDK from Webworks?

Hi tneil:
Would you please clarify how to "build it in the NDK with an AIR wrapper". And How do I pack my c libs(".so" files) into ww extension?
Thanks
Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: How to call NDK from Webworks?

Hi geng,

 

There's documentation here:

 

https://bdsc.webapps.blackberry.com/native/documentation/ane_overview_1908711_11.html

 

And a 3rd party writeup here:

 

http://deleteaso.com/creating-air-native-extensions-for-blackberry-playbook/

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
geng
Posts: 5
Registered: ‎11-04-2011
My Device: Playbook

Re: How to call NDK from Webworks?

Hi Tim:
Thanks for your info.
Currently, I have created an ane and run it in a AIR simple application successfully.
I also create a webworks extension and run it with a Webworks app successfully.
So, my current issue is how to integrate this two together.
Based on the document, there are 4 steps to integrate a ane into an AIR application, So I do them one by one for my Webworks app.
1. include NativeAS3.swc.
I copy NativeAS3.swc into the lib folder in WebWorks SDK (\bbwp\blackberry-tablet-sdk\frameworks\libs). It seems works.

2. Extra package options: -ane ../../NativeAS3/package/com.example.ane

I don't know how to add this option. So I directly zip the ane file into my WebWork application package file.

3. Add tag <extensions> into *-app.xml file. For my WebWorks application, I added it in WebWorksAppTemplate-app.xml which is in WebWorks SDK.

<extensionID>com.example.NativeAS3</extensionID>
</extensions>

4. Add tag <action> into bar file descriptor. I added it in blackberry-tablet.xml which is also located in WebWorks SDK.
<action system=”true”>run_air_native</action>

With all this done. I got that, my WebWorks cannot boot up at all.
I guess it is because the system can not find ane file.
If I remove the <extension> section in WebWorksAppTemplate-app.xml. Then the app can boot up. But when the ane function is called, an error is got. The error is:
Syntax Error: Unable to parse JSON String.

In short words, I believe that I haven't found the way to pack the ane file in my WebWorks app.
Do you have any suggestion for that?

Thanks