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

Web and WebWorks Development

New Contributor
Posts: 4
Registered: ‎08-05-2013
My Device: Z10
My Carrier: N/A
Accepted Solution

Webworks extension for BB10 and OS7



I'm interested in writing an extension for some software that will be deployed to both a BB10 and OS7 device. I was wondering if it was possible to package the native code for each platform into one extension so I can then use it in a project without having to include two extensions. Ideally I would like to include the extension into the project and leave the webworks code untouched for each platform and then let the compiler decide whether to use BB10 code or OS7 code from the extension file.


Is there any way to do this?





BlackBerry Development Advisor
Posts: 766
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: Webworks extension for BB10 and OS7



I've never seen this done before... I'm pretty sure it's not possible and you'll have to write two separate extensions because natively BBOS is Java, and BB10 is C/C++.

Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Webworks extension for BB10 and OS7

BB10 is C/C++ and a JavaScript wrapper called JNext

Playbook OS is C/C++ and an Adobe AIR wrapper to an ANE that can talk to C/C++ bit

OS7 and lower are entirely Java


i.e. you have to write completely different extensions for each


Done OS6/7 and BB10, got lost with PB

Click the like button if you find my posts useful!
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Webworks extension for BB10 and OS7

You can write an extension such that the API is identical, so your javascript is the same, and you name it the same, so your config.xml and your app side are identical. However, the native portions would be completely different. You would write each separately and inlcude them in the different SDKs. Once done, you would build for each platform (OS7, or BB10) and the compiler would pull in the native code from your extension.

Tim Windsor
Open Source Technical Lead
New Contributor
Posts: 4
Registered: ‎08-05-2013
My Device: Z10
My Carrier: N/A

Re: Webworks extension for BB10 and OS7

Thanks guys.


I'd come to the conclusion that doing what Tim suggested was the neatest way of doing it. It didn't look like I could package the two codebases into one but thought that somebody might have done it! 


Thanks for the help.