Packaging an HTML5 app

To run an HTML5 app on a target running QNX Neutrino, you must package it as a .bar file.

Build options

The build command interprets your HTML5 and JavaScript code, builds the binaries, and packages the web assets into a .bar file.

You can use the following options with the build command:

--debug
Build in debug mode. This option allows Web Inspector to connect to your application on the target for debugging purposes and console logs to appear.
--release
Build in release mode and signs the app if signing keys are provided. This version of the QNX SDK for Apps and Media doesn't support signing. Even though the tools support signing, it isn't necessary to sign your app or provide signing keys for apps running on this release.
--web-inspector
Enables web-inspector for debugging apps on the target. This option is included when you use the --debug option.
Note: It's a good idea to use the debug option when you are testing, because it allows you to run Web Inspector.

Building the app

To create a .bar file for an HTML5 app, run the build command in your HTML5 project folder. The .bar file can be deployed to your target using these steps:

  1. Navigate to the folder where your HTML5 project was created when you ran the create command.
  2. Ensure that all the resources and permissions your application needs are specified in the config.xml file.
    Note: The create command produces a basic config.xml file that defines the app's properties, features and functionality, and behavior. You may need to edit this file depending on the features or permissions required by your app. For more information, see "Working with the configuration file."
  3. Navigate to the cordova folder.
  4. Run the build command:
    build --debug
  5. The default name of the .bar file is qnxcarapp.bar. If you will work with multiple .bar files on a target system, rename the file to a unique name.

The output from an HTML5 app build looks like the following. The warnings about not having a debug token when you build is expected because debug tokens aren't used for apps on this platform:

[WARN]    Using legacy signing keys
[INFO]    Populating application source
[INFO]    Parsing config.xml
[INFO]    Generating output files
[WARN]    Failed to find debug token. If you have an existing debug token, 
          please copy it to C:\Users\qnxuser\.cordova\blackberry10debugtoken.bar. 
          To generate a new debug token, execute the 'run' command.
[INFO]    Package created: 
          C:\AppsMedia_html5sdk_141022_1646\html5sdk\CordovaPPSdemo\build\simulator\qnxcarapp.bar
[WARN]    Failed to find debug token. If you have an existing debug token, please
          copy it to C:\Users\qnxuser\.cordova\blackberry10debugtoken.bar.
          To generate a new debug token, execute the 'run' command.
[INFO]    Package created: 
          C:\AppsMedia_html5sdk_141022_1646\html5sdk\CordovaPPSdemo\build\device\qnxcarapp.bar
[INFO]    BAR packaging complete
                                        

After the build command is finished, the .bar file is found in the following folders:

You can use copy the file to a USB stick and mount it to your target board or use a tool to transfer the file to the target. If you choose the latter, your target must be connected to the same network as your computer. You must get your file to the target to deploy it.

For information about creating a simple HTML5 app using Cordova, see "Creating an HTML5 project." For information about installing the app on your target, see "Installing packaged apps on the target" in Application and Window Management.