Porting from Cordova

BlackBerry WebWorks SDK 2.0 is built upon the Cordova open source project with custom BlackBerry plugins and features. This shift increases the portability of BlackBerry WebWorks applications and makes it easy to integrate with the BlackBerry 10 OS. Essentially, BlackBerry WebWorks SDK 2.0 consists of Cordova and BlackBerry specific APIs as well as a custom CLI and GUI.

Architectural diagram showing a breakdown of BlackBerry WebWorks SDK 2.0. It shows that the SDK is now built upon Apache Cordova with the addition of a BlackBerry WebWorks GUI, CLI and BlackBerry APIs.

Use the WebWorks CLI

The BlackBerry WebWorks CLI provides custom commands for developing and testing BlackBerry applications.

To use a BlackBerry WebWorks command, run webworks <command>, where <command> is one of the following:

  • The build command builds your app in release mode or debug mode, without deploying it to a simulator or device.
  • The serve command lets your preview your app in your default browser.
  • The emulate command builds and deploys your app to a BlackBerry 10 Device Simulator.
  • The run command builds and deploys your app to a BlackBerry 10 device. This command also create and install a debug token automatically.

Both the emulate and run commands also let you specify whether you want to skip the build or launch steps.

Add BlackBerry plugins

BlackBerry 10 WebWorks SDK 2.0 contains BlackBerry specific APIs that allow applications to tightly integrate with the BlackBerry 10 OS. You will need to use BlackBerry plugins to access core BlackBerry funtionality. For a full list of BlackBerry plugins, see Plugins installed with BlackBerry 10 WebWorks SDK.

To add a BlackBerry plugin using the BlackBerry WebWorks CLI:

  1. On the command line, navigate to your project folder.
  2. Run the following command:
    webworks plugin add <id> | <path> | <uri> 
For example, the following example adds the BlackBerry Application API to your app.
webworks plugin add com.blackberry.app

Check the table below for parameter details:

Parameters Description
<id>

Specifies the unique identifier for the plugin.

<path>

Specifies the path to the plugin on your local file system.

<uri>

Specifies the remote location for the plugin.

Add BlackBerry plugins using the Cordova CLI

You can add BlackBerry plugins to your app without installing the BlackBerry WebWorks SDK by using the Cordova CLI.

Visit http://plugins.cordova.io/ to download the plugins and learn how to add them using the Cordova command line interface.

Last modified: 2014-09-29



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

comments powered by Disqus