Upgrading Cordova BlackBerry
This document describes the process of upgrading Cordova projects to the latest released version
Upgrading Cordova 2.7.0 projects to 2.8.0
BlackBerry10
BlackBerry10 uses the new CLI tooling and manages core api's as plugins. The instructions migrate your project to a new project, rather than updating an existing project, due to the complexity of updating an old project. Also note that the cordova js script file is now called 'cordova.js' and no longer contains a version string.
- Download and extract the Cordova 2.8.0 source to a permanent folder location on your hard drive (say to ~/Cordova-2.8.0)
- Quit any running IDE's Eclipse, Momentics and the like.
- Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc.
- Create a new project from the command-line tools - this will be the home of your updated project
- Copy your projects source from the old project's /www folder to the new project's /www folder
- Update the Cordova script reference in your www/index.html file (and any other files that contain the script reference) to point to the new cordova.js file
BlackBerryOS/Playbook
- Download and extract the Cordova 2.8.0 source to a permanent folder location on your hard drive (say to ~/Cordova-2.8.0)
- Quit any running IDE's Eclipse, Momentics and the like.
- Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc.
- Create a new project from the command-line tools - you will have to grab the assets from this new project
- Copy the www/cordova-2.7.0.js file from the new project into your www folder, and delete your www/cordova-2.6.0.js file
- Update the Cordova script reference in your www/index.html file (and any other files that contain the script reference) to point to the new cordova.js file
- Copy the native folder from the new project into the existing project, overwriting the old native folder
- Copy the lib folder from the new project into the existing project, overwriting the old lib folder
- Copy the cordova folder from the new project into the existing project, overwriting the old cordova folder
Upgrading Cordova 2.6.0 projects to 2.7.0
- Download and extract the Cordova 2.7.0 source to a permanent folder location on your hard drive (say to ~/Cordova-2.7.0)
- Quit any running IDE's Eclipse, Momentics and the like.
- Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc.
- Create a new project from the command-line tools - you will have to grab the assets from this new project
- Copy the www/cordova-2.7.0.js file from the new project into your www folder, and delete your www/cordova-2.6.0.js file
- Update the Cordova script reference in your www/index.html file (and any other files that contain the script reference) to point to the new cordova-2.7.0.js file
- Copy the native folder from the new project into the existing project, overwriting the old native folder
- Copy the lib folder from the new project into the existing project, overwriting the old lib folder
- Copy the cordova folder from the new project into the existing project, overwriting the old cordova folder
Upgrade to 2.6.0 from 2.5.0
Updating the PhoneGap download folder:
It is recommended that you download a fresh copy of the entire folder.
However, here are the new parts needed for the piecemeal update:
- Update the cordova.blackberry.js file in the ‘Phonegap-2.6.0/lib/blackberry/javascript’ folder
- Update the ‘ext’, ‘ext-air’, and ‘ext-qnx’ in the ‘Phonegap-2.6.0/lib/blackberry/framework’ folder
- Update the ‘build.xml’ file in the ‘Phonegap-2.6.0/lib/blackberry’ folder
- Update the the ‘Phonegap-2.6.0/lib/blackberry/bin’ folder
- Update the ‘VERSION’ file in the ‘Phonegap-2.6.0/lib/blackberry’ folder
Updating the example/ folder or migrating an existing project:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Update the contents of the
ext-qnx/
folder. - Copy the new
cordova-2.6.0.js
into your project. - Update your HTML to use the new
cordova-2.6.0.js
file.
Upgrade to 2.5.0 from 2.4.0
Updating the PhoneGap download folder:
It is recommended that you download a fresh copy of the entire folder.
However, here are the new parts needed for the piecemeal update:
- Update the cordova.blackberry.js file in the ‘Phonegap-2.5.0/lib/blackberry/javascript’ folder
- Update the ‘ext’, ‘ext-air’, and ‘ext-qnx’ in the ‘Phonegap-2.5.0/lib/blackberry/framework’ folder
- Update the ‘build.xml’ file in the ‘Phonegap-2.5.0/lib/blackberry’ folder
- Update the the ‘Phonegap-2.5.0/lib/blackberry/bin’ folder
- Update the ‘VERSION’ file in the ‘Phonegap-2.5.0/lib/blackberry’ folder
Updating the example/ folder or migrating an existing project:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Update the contents of the
ext-qnx/
folder. - Copy the new
cordova-2.5.0.js
into your project. - Update your HTML to use the new
cordova-2.5.0.js
file.
Upgrade to 2.4.0 from 2.3.0
Updating just the www folder:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Copy the new
cordova-2.4.0.js
into your project.- If playbook, then update the .js file in the
playbook/
folder. - If BlackBerry10, then update the .js file in the
qnx/
folder.
- If playbook, then update the .js file in the
- Update your HTML to use the new
cordova-2.4.0.js
file.
Updating the sample folder (ie, updating using the ant tools):
- Open the
sample/lib/
folder. - Update the .jar file in the
cordova.2.3.0/ext/
folder. - Update the contents of the
cordova.2.3.0/ext-air/
folder. - Update the contents of the
cordova.2.3.0/ext-qnx/
folder. - Update the .js file in the
cordova.2.3.0/javascript/
folder. - Open the
sample/lib/
folder and rename thecordova.2.3.0/
folder tocordova.2.4.0/
. - Type
ant blackberry build
orant playbook build
to update thewww/
folder with updated Cordova. - Open the
www/
folder and update your HTML to use the newcordova-2.4.0.js
file
Upgrade to 2.3.0 from 2.2.0
Updating just the www folder:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Copy the new
cordova-2.3.0.js
into your project.- If playbook, then update the .js file in the
playbook/
folder. - If BlackBerry10, then update the .js file in the
qnx/
folder.
- If playbook, then update the .js file in the
- Update your HTML to use the new
cordova-2.3.0.js
file.
Updating the sample folder (ie, updating using the ant tools):
- Open the
sample/lib/
folder. - Update the .jar file in the
cordova.2.2.0/ext/
folder. - Update the contents of the
cordova.2.2.0/ext-air/
folder. - Update the contents of the
cordova.2.2.0/ext-qnx/
folder. - Update the .js file in the
cordova.2.2.0/javascript/
folder. - Open the
sample/lib/
folder and rename thecordova.2.2.0/
folder tocordova.2.3.0/
. - Type
ant blackberry build
orant playbook build
to update thewww/
folder with updated Cordova. - Open the
www/
folder and update your HTML to use the newcordova-2.3.0.js
file
Upgrade to 2.2.0 from 2.1.0
Updating just the www folder:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Copy the new
cordova-2.2.0.js
into your project.- If playbook, then update the .js file in the
playbook/
folder. - If BlackBerry10, then update the .js file in the
qnx/
folder.
- If playbook, then update the .js file in the
- Update your HTML to use the new
cordova-2.2.0.js
file.
Updating the sample folder (ie, updating using the ant tools):
- Open the
sample/lib/
folder. - Update the .jar file in the
cordova.2.1.0/ext/
folder. - Update the contents of the
cordova.2.1.0/ext-air/
folder. - Update the contents of the
cordova.2.1.0/ext-qnx/
folder. - Update the .js file in the
cordova.2.1.0/javascript/
folder. - Open the
sample/lib/
folder and rename thecordova.2.1.0/
folder tocordova.2.2.0/
. - Type
ant blackberry build
orant playbook build
to update thewww/
folder with updated Cordova. - Open the
www/
folder and update your HTML to use the newcordova-2.2.0.js
file.
Upgrade to 2.1.0 from 2.0.0
Updating just the www folder:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Copy the new
cordova-2.1.0.js
into your project.- If playbook, then update the .js file in the
playbook/
folder.
- If playbook, then update the .js file in the
- Update your HTML to use the new
cordova-2.1.0.js
file.
Updating the sample folder (ie, updating using the ant tools):
- Open the
sample/lib/
folder. - Update the .jar file in the
cordova.2.0.0/ext/
folder. - Update the contents of the
cordova.2.0.0/ext-air/
folder. - Update the .js file in the
cordova.2.0.0/javascript/
folder. - Open the
sample/lib/
folder and rename thecordova.2.0.0/
folder tocordova.2.1.0/
. - Type
ant blackberry build
orant playbook build
to update thewww/
folder with updated Cordova. - Open the
www/
folder and update your HTML to use the newcordova-2.1.0.js
file.
Upgrade to 2.0.0 from 1.9.0
Updating just the www folder:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Copy the new
cordova-2.0.0.js
into your project.- If playbook, then update the .js file in the
playbook/
folder.
- If playbook, then update the .js file in the
- Update your HTML to use the new
cordova-2.0.0.js
file. -
Update your
www/plugins.xml
file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from:<plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> <plugin name="Contact" value="org.apache.cordova.pim.Contact"/>
To:
<plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/>
Updating the sample folder (ie, updating using the ant tools):
- Open the
sample/lib/
folder. - Update the .jar file in the
cordova.1.9.0/ext/
folder. - Update the contents of the
cordova.1.9.0/ext-air/
folder. - Update the .js file in the
cordova.1.9.0/javascript/
folder. - Open the
sample/lib/
folder and rename thecordova.1.9.0/
folder tocordova.2.0.0/
. - Type
ant blackberry build
orant playbook build
to update thewww/
folder with updated Cordova. - Open the
www/
folder and update your HTML to use the newcordova-2.0.0.js
file. -
Open the
www/
folder and update theplugins.xml
file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from:<plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> <plugin name="Contact" value="org.apache.cordova.pim.Contact"/>
To:
<plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/>
- To upgrade to 1.8.0, please go from 1.7.0
Upgrade to 1.8.0 from 1.7.0
Updating just the www folder:
- Open your
www/
folder, which contains your app. - Remove and update the .jar file in the
ext/
folder. - Update the contents of the
ext-air/
folder. - Copy the new
cordova-1.8.0.js
into your project.- If playbook, then update the .js file in the
playbook/
folder.
- If playbook, then update the .js file in the
- Update your HTML to use the new
cordova-1.8.0.js
file. -
Update your
www/plugins.xml
file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from:<plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> <plugin name="Contact" value="org.apache.cordova.pim.Contact"/>
To:
<plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/>
Updating the sample folder (ie, updating using the ant tools):
- Open the
sample/lib/
folder. - Update the .jar file in the
cordova.1.7.0/ext/
folder. - Update the contents of the
cordova.1.7.0/ext-air/
folder. - Update the .js file in the
cordova.1.7.0/javascript/
folder. - Open the
sample/lib/
folder and rename thecordova.1.7.0/
folder tocordova.1.8.0/
. - Type
ant blackberry build
orant playbook build
to update thewww/
folder with updated Cordova. - Open the
www/
folder and update your HTML to use the newcordova-1.8.0.js
file. -
Open the
www/
folder and update theplugins.xml
file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from:<plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> <plugin name="Contact" value="org.apache.cordova.pim.Contact"/>
To:
<plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/>