Links

Blackberry 10 (qnx) PhoneGap Plugins

We have two ways to create plugins for our BlackBerry PhoneGap apps ie; PG-BB Native Java and BB WebWorks


Use of BlackBerry WebWorks in-between our js codebase is quite easy (thanks to BlackBerry's documentation) and the PhoneGap plugin is also somehow similar to Android, the trick is in creating new phonegap.jar file with our java plugin (it is not easy as it is for Android's).  

Here are steps to generate a new phonegap.jar with your own Plugin.java inside it:

1) Take checkout from latest BlackBerry PhoneGap repo from https://git-wip-us.apache.org/repos/asf/cordova-blackberry.git

2) Modifying plugins.xml in your project []

3) Write your Plugin.java

4) From terminal go to BB-PG repo inside that go to : framework/ext/src/org/apache/cordova/

5) Here create plugin folder and keep your Plugin.java inside that

6) Go to BB-PG repo's base dir

7) Run terminal command; ant update -Dproject.path="~/path_to_the_BB-PG-repo"

8) After a successful run you get updated phonegap's jar/js inside BB-PG repo you need to replace your projects phonegap.jar/.js with that.
     - delete /www/ext/cordova.jar
     - copy /lib/cordova.x.y.z/ext/cordova.x.y.z.jar
         to /www/ext/cordova.x.y.z.jar
     - delete /www/cordova.js
     - copy /lib/cordova.x.y.z/javascript/cordova-x.y.z.js
         to /www/cordova-x.y.z.js

Post a Comment