The HTML5 Development Environment

The HTML5 SDK is required to build and package HTML5 apps to .bar files. These .bar files can be built or installed into a system built with the QNX SDK for Apps and Media. image.

The HTML5 SDK contains the Cordova framework, runtime, tools, and APIs that you can use to create plugins and HTML5 apps. The HTML5 SDK packages HTML5 apps as .bar files. You, or another developer, can then integrate these .bar files into a target image so your apps are available by default. You can also use these .bar files to install your apps on the target at a later time.

You can download the QNX SDK for HTML5 (.zip file) from the QNX Download Center. To install the package, follow the installation notes for the QNX SDK for HTML5 corresponding to this release.

Managing plugins

To manage plugins, use Plugman. Plugman was installed into your environment using the Node.js package manager (npm) when you installed the HTML5 SDK (i.e., npm install -g plugman). You use plugman to manage Cordova plugins from within your HTML5 projects. If you want multiple apps to use a plugin, you must run the plugman command for each app that needs to use the plugin. The plugman command is on a per project (or app) basis.

To add a plugin from your project, use the following command:
plugman install --platform blackberry10 --project folder to project 
                --plugin id|path|url [--variable NAME=name]      
For example, from within your Cordova project directory, you can use the plugman command to add the demo plugin from the HTML5 SDK:
  • On Windows:
    plugman install --platform blackberry10 --project . 
                    --plugin HTML5 SDK install location\html5sdk\demo\com.qnx.demo
  • On Linux:
    plugman install --platform blackberry10 --project . 
                    --plugin HTML5 SDK install location/html5sdk/demo/com.qnx.demo
To remove a plugin from, your project, use the following command:
plugman uninstall --platform blackberry10 
                  --project folder to project --plugin id
To list installed plugins for your project:
plugman ls
For information about Plugman, see Using Plugman to Manage Plugins in the Cordova Documentation.

HTML5 SDK files overview

After you unarchived the ZIP file, the following folders appear under the Path you installed the QNX SDK for HTML5/html5sdk:
Contains the library of plugins developed for Cordova, as well as the QNX Cordova runtime and packager. These are the common tools that you require:
Creates a new HTML5 project. The project includes a skeleton project and the required tools for building and packaging an HTML5 app. For more information about the create command, see "Creating an HTML5 project"
Returns the path of the file you specify as a parameter based on a search of the directories in your PATH variable. This command is available only for Windows. For example:
whereis.cmd index.html
Contains the folder structure and file templates for new projects. The default template creates a Cordova app that handles the deviceready event and displays the Cordova logo on the screen.
A sample app that you can build and deploy to your image. You can see more sample HTML5 apps in the QNX SDK for Apps and Media. Ensure that you use the tools from this HTML5 SDK to build and package the tools. The tools are located in the tools folder.
The tools used by the Cordova runtime to create and build Cordova projects for a target.
To use the tools, you add the path to either the Windows or Linux version of the tools to your PATH variable on your host computer where installation path is the location you extracte the HTML5 SDK.

For Windows, the path is:

HTML5 SDK install location\html5sdk\tools\packaging\win32\bin

For Linux, the path is:

HTML5 SDK install location/html5sdk/tools/packaging/linux/bin
You don't use these tools directly, but the Cordova tools have a dependency on these tools:
Packages your compiled binaries for your app as a .bar file.
Creates debug tokens on your computer. Debug tokens are not necessary for packaging your apps.
Signs the app if signing keys are provided. This version of the QNX SDK for Apps and Media doesn't support signed apps. Even though the tools support signing, it isn't necessary to sign your app or provide signing keys in this release.
Deploys the package created for your app.

Other tools

You can edit files using your favorite HTML5 development tools. Here are some tools that can help you with HTML5 development:
  • For CSS development, use Compass and Sass. For more information, see "Install CSS development tools."
  • For debugging your apps, install a Webkit-based browser (such as Google Chrome), which work with Web Inspector. For more information about Web Inspector, see "Debugging Web Apps" in this guide.