This project is an experimentation on refactoring the Cordova BlackBerry framework to convert all the API to plugins. Some potential benefits of this refactoring are:
- Separation of core framework from features.
- Ability for an application to only include required features.
- Formal definition of Cordova plugin framework.
- Future ability to centralize plugin installation.
This refactoring is heavily dependent on the BlackBerry WebWorks Framework including the use of some potentially unsupported API/behavior.
exec interface into them. All the native code, including plugins, is packaged into a single source jar which must be included in a projects
The intent of this project is to make greater use of the features available in the BlackBerry WebWorks Framework while maintaining existing Cordova Plugin API to accomplish the goals of providing all Cordova API as feature based plugins. The BlackBerry WebWorks Framework provides the ability to define extensions to the framework and provides packaging and build tools which support them. The build tools automatically detect what extensions a project is building and only include the necessary code in the build.
- cordova - Cordova base framework
- cordova.accelerometer - Accelerometer plugin
- cordova.app - Application management plugin
- cordova.battery - Battery plugin
- cordova.camera - Camera plugin
- cordova.capture - Capture plugin
- cordova.contact - Contacts plugin
- cordova.device - Device plugin
- cordova.file - File plugin
- cordova.filetransfer - FileTransfer plugin
- cordova.geolocation - Geolocation plugin
- cordova.network - NetworkStatus plugin
- cordova.notification - Notification plugin
Beneath each folder is a
library.xml file which is the WebWorks Extension configuration file defining the extension and the location of the resources that compose it.
- sample/ - This contains a sample application project.
To install, simply download the contents of this project and copy/move/link the folders in the
ext folder to your BlackBerry WebWorks SDK
ext folder. Note,you need to install in the SDK
ext folder and not your projects
ext folder. Installing into the SDK
ext folder allows the extensions to be used across all your BlackBerry WebWorks projects.
Enabling a project to use the Cordova API requires modification of the projects
config.xml. Cordova API are exposed as the following WebWorks feature ids:
- cordova (required)
- cordova.core (required)
Any project which needs to use the Cordova API must at a minimum include the following two feature ids:
<feature id="cordova" required="true" version="1.0.0" /> <feature id="cordova.core" required="true" version="1.0.0" />
Additional API can be enabled by adding entries for the feature id into the
Note: Certain BlackBerry feature ids are also required in the
config.xml file. Its recommended to use the sample project and modify the
config.xml as needed.
- plugins.xml is no longer needed as the
config.xmlfeature ids determine what plugins are used.
- Sample expects the extensions to be installed in WebWorks SDK
extfolder. This appears to be the strategy that RIM is advocating as oppose to a projects
extfolder. Should be possible to build individual source jars for each extension and place in projects
extfolder but I have not tried.
- An extension
library.xmlsupports defining dependencies but this only affects the build and not runtime. Would be nice to be able to specify extension dependencies to force an extension to load before another one.
- Would be nice to be able to specify additional resource dependencies (ie. images) that automatically get bundled with the application. Currently images which are bundled with in the java source tree will be packaged up but would be better to have a way of declaratively defining via library.xml.