HTML5 application framework

The HTML5 application framework provides the components needed to support apps that are written with web technologies and that access native services.

Using this framework, developers can create and deploy web applications—built with technologies such as HTML5, CSS3, and JavaScript—that use plugins to access device hardware and native services (just like native C/C++ applications). The plugins are written with Apache Cordova, an open-source framework for developing mobile apps.

Figure 1. Architecture of the HTML5 application framework

As Figure 1 illustrates, the Cordova plugins provide JavaScript interfaces for accessing middleware services such as media, navigation, radio, and phone. The app code uses these interfaces to send requests and read results. The requests are sent through URLs to the Web Controller, which executes the plugin code. In the Web Controller, the Cordova plugins talk to plugins based on the Netscape Plugin Application Programming Interface (NPAPI), which access native services. The Web Controller exposes the interfaces for the NPAPI plugins but their code runs in the native layer of the browser. The browser supports the following NPAPI plugins:

PPS plugin
Provides the HTML5 domain with access to the full PPS API.
SQL plugin
Provides QDB database access, including a complete API for opening, querying, and modifying databases.
Screen plugin
Used by the Navigator application, this plugin provides window and buffer management and supports the event notification system. Navigator can use this plugin to set properties for window, context, and display, and to handle events received from the low-level graphics components.
Player plugin
Provides access to the mm-player media browsing and playback engine.
Note: Developers can add NPAPI plugins as required.

Sample application

The Communications app uses the qnx.message Cordova plugin to read email and text messages and the qnx.bluetooth.pbap plugin to read address book information found on Bluetooth devices. When the devices are paired with your system, their message contents and address information gets stored in QDB databases. The Cordova plugins talk to the SQL plugin in the browser engine, which then accesses the databases. To manage phone calls on paired devices, the app uses the plugin, which in turn uses the PPS plugin to communicate through PPS with the Bluetooth services (pps-bluetooth and io-bluetooth).

Figure 2. The reference Communications app