The Cordova PPS demo is delivered as a separate Cordova component. You can build the demo to learn how to create a project, install a plugin, and use Persistent Publish/Subscribe(PPS) objects with an HTML5 app.
If you are using a QNX SDK for Apps and Media image, the steps regarding configuring the sys.acl, sys.res, and pps.conf files are already completed for you. In fact, the image contains the Cordova PPS Demo app installed. If you choose, you can recreate the application and deploy it onto the image. Before you deploy the app you build, it's a good idea to remove the previous version of the Cordova PPS Demo using the bar-uninstall command.
To run this demo, ensure that you have installed both the QNX SDK for Apps and Media, and the HTML5 SDK. The code for the HTML5 SDK is located at: HTML5 SDK install location/html5sdk/demo.
For more information, see The HTML5 Development Environment.
The instructions below describe how to create, deploy, and launch the Cordova PPS Demo app. After you have completed these tasks, you can use the instructions you followed as a model for other HTML5 projects.
On your host system, use the files in the demo folder as a template to create the demo app:
cd HTML5 SDK install location\html5sdk
cd HTML5 SDK install location/html5sdk
cordova\cordova-qnxcar\bin\create CordovaPPSdemo
./cordova/cordova-qnxcar/bin/create CordovaPPSdemo
xcopy /E demo\www CordovaPPSdemo\www
cp -R ./demo/www/* CordovaPPSdemo/www
plugman install --platform blackberry10 --project ./CordovaPPSdemo --plugin ./demo/com.qnx.demo
plugman install --platform blackberry10 --project ./CordovaPPSdemo --plugin ./demo/com.qnx.demo
.\CordovaPPSdemo\cordova\build debug
./CordovaPPSdemo/cordova/build debug
The generated BAR file is located at .\CordovaPPSdemo\build\device\qnxcarapp.bar (on Windows) and ./CordovaPPSdemo/build/device/qnxcarapp.bar (on Linux).
The .bar file is called qnxcarapp by default. If you manage multiple projects, consider renaming the .bar file to match your app name . For more information, see Packaging an HTML5 app.
On your target system:
/scripts/bar-install /fs/usb0/qnxcarapp.bar
/scripts/bar-install /tmp/qnxcarapp.bar
>> Added PPS entry CordovaPPSdemo.testDev_dovaPPSdemod339185a::native/default-icon.png, Cordova PPS Demo,,,auto,,Make sure you record the filename (in this example: CordovaPPSdemo.testDev_dovaPPSdemod339185a). You will need it when you specify the access.
qnx/demo 0:0:0660:O_CREAT user::rw group::rw other::rw mask::rw
access_demo ACL opt rwx:rw /pps/qnx/ ACL opt rwx:rw /pps/qnx/demo
access_demo deny * allow CordovaPPSdemo.testDev_dovaPPSdemod339185a
# launch CordovaPPSdemo