Creating native extensions for BlackBerry 10

Although a BlackBerry WebWorks application has a wide range of functionality, that functionality is limited to the resources that the application contains. By creating a custom extension, you can extend the functionality of your application to include the features and functions provided by core native APIs that are available to BlackBerry 10 OS applications.

You create a custom extension in C/C++, which are the native languages for BlackBerry 10 OS, and then you wrap it in JavaScript. When you build and package your BlackBerry WebWorks application, you include the extension, so that your application can access the extension through JavaScript. You can pass arguments into the extended function and handle return values as you would in any native BlackBerry 10 OS application.

System requirements

To create custom extensions for use with BlackBerry 10 OS applications, you require the following:
  • BlackBerry 10 WebWorks SDK 1.0.1.8 Beta or later
  • BlackBerry 10 Native SDK 10.0.06 Beta 2 or later
  • BlackBerry 10 device or simulator

Using a sample to create an extension

You can download an extension template from GitHub at: https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10/Template. Instructions for using the template are included in the GitHub resources.

Creating a BlackBerry WebWorks extension involves two parts:

  1. Create the native part of the extension
  2. Create the JavaScript part of the extension

After you create an extension, you can add it to the BlackBerry WebWorks installation so that it's available when you build your BlackBerry WebWorks applications. See Make the extension available to your app for more details.

Last modified: 2014-10-09



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus