license: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This guide shows how to modify Android projects to upgrade from older versions of Cordova. Most of these instructions apply to projects created with an older set of command-line tools that precede the cordova
CLI utility. See The Command-Line Interface for information how to update the version of the CLI.
For projects that were created with the cordova CLI:
Update the cordova
CLI version. See The Command-Line Interface.
Run cordova platform update android
For projects not created with the cordova CLI, run:
bin/update <project_path>
For projects that were created with the cordova CLI:
Update the cordova
CLI version. See The Command-Line Interface.
Run cordova platform update android
For projects not created with the cordova CLI, run:
bin/update <project_path>
Create a new Apache Cordova 3.0.0 project using the cordova CLI, as described in The Command-Line Interface.
Add your platforms the cordova project, for example: cordova platform add android
.
Copy the contents of your project's www
directory to the www
directory at the root of the cordova project you just created.
Copy any native assets from your old project into the appropriate directories under platforms/android
: this directory is where your native cordova-android project exists.
Use the cordova CLI tool to install any plugins you need. Note that the CLI handles all core APIs as plugins, so they may need to be added. Only 3.0.0 plugins are compatible with the CLI.
Create a new Apache Cordova Android project.
Copy the contents of your www
directory to the new project.
Copy any native Android assets from your res
directory to the new project.
Copy over any plugins you installed from the src
subdirectories into the new project.
Make sure to upgrade any deprecated <plugin>
references from your old config.xml
file to the new <feature>
specification.
Update any references to the org.apache.cordova.api
package to be org.apache.cordova
.
NOTE: all core APIs have been removed and must be installed as plugins. Please see the Using Plugman to Manage Plugins Guide for details.
bin/update <project_path>
.Remove cordova-2.7.0.jar
from the project's libs
directory.
Add cordova-2.8.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova.js
into your project.
Update your HTML to use the new cordova.js
file.
Copy the res/xml/config.xml
file to match framework/res/xml/config.xml
.
Update framework/res/xml/config.xml
to have similar settings as it did previously.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Remove cordova-2.6.0.jar
from the project's libs
directory.
Add cordova-2.7.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.7.0.js
into your project.
Update your HTML to use the new cordova-2.7.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
Update framework/res/xml/config.xml
to have similar settings as it did previously.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Remove cordova-2.5.0.jar
from the project's libs
directory.
Add cordova-2.6.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.6.0.js
into your project.
Update your HTML to use the new cordova-2.6.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
Update framework/res/xml/config.xml
to have similar settings as it did previously.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Run bin/update <project>
with the project path listed in the Cordova Source directory.
Remove cordova-2.4.0.jar
from the project's libs
directory.
Add cordova-2.5.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.5.0.js
into your project.
Update your HTML to use the new cordova-2.5.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
Update framework/res/xml/config.xml
to have similar settings as it did previously.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Remove cordova-2.3.0.jar
from the project's libs
directory.
Add cordova-2.4.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.4.0.js
into your project.
Update your HTML to use the new cordova-2.4.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Remove cordova-2.2.0.jar
from the project's libs
directory.
Add cordova-2.3.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.3.0.js
into your project.
Update your HTML to use the new cordova-2.3.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Remove cordova-2.1.0.jar
from the project's libs
directory.
Add cordova-2.2.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.2.0.js
into your project.
Update your HTML to use the new cordova-2.2.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Remove cordova-2.0.0.jar
from the project's libs
directory.
Add cordova-2.1.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.1.0.js
into your project.
Update your HTML to use the new cordova-2.1.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
Copy files from bin/templates/cordova
to the project's cordova
directory.
Remove cordova-1.9.0.jar
from the project's libs
directory.
Add cordova-2.0.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-2.0.0.js
into your project.
Update your HTML to use the new cordova-2.0.0.js
file.
Copy the res/xml/config.xml
to match framework/res/xml/config.xml
.
In the 2.0.0 release, the config.xml
file combines and replaces cordova.xml
and plugins.xml
. The old files are deprecated, and while they still work in 2.0.0, will stop working in a future release.
Remove cordova-1.8.0.jar
from the project's libs
directory.
Add cordova-1.9.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.9.0.js
into your project.
Update your HTML to use the new cordova-1.9.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Due to the introduction of the CordovaWebView
in the 1.9.0 release, third-Party plugins may not work. These plugins need to get a context from the CordovaInterface
using getContext()
or getActivity()
. If you are not an experienced Android developer, please contact the plugin maintainer and add this task to their bug tracker.
Remove cordova-1.8.0.jar
from the project's libs
directory.
Add cordova-1.8.1.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.8.1.js
into your project.
Update your HTML to use the new cordova-1.8.1.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Remove cordova-1.7.0.jar
from the project's libs
directory.
Add cordova-1.8.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.8.0.js
into your project.
Update your HTML to use the new cordova-1.8.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Remove cordova-1.7.0.jar
from the project's libs
directory.
Add cordova-1.8.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.8.0.js
into your project.
Update your HTML to use the new cordova-1.8.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Remove cordova-1.6.1.jar
from the project's libs
directory.
Add cordova-1.7.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.7.0.js
into your project.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Remove cordova-1.6.0.jar
from the project's libs
directory.
Add cordova-1.6.1.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.6.1.js
into your project.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Remove cordova-1.5.0.jar
from the project's libs
directory.
Add cordova-1.6.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.6.0.js
into your project.
Update your HTML to use the new cordova-1.6.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Replace res/xml/phonegap.xml
with res/xml/cordova.xml
to match framework/res/xml/cordova.xml
.
Remove phonegap-1.4.0.jar
from the project's libs
directory.
Add cordova-1.5.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new cordova-1.5.0.js
into your project.
Update your HTML to use the new cordova-1.5.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Replace res/xml/phonegap.xml
with res/xml/cordova.xml
to match framework/res/xml/cordova.xml
.
Remove phonegap-1.3.0.jar
from the project's libs
directory.
Add phonegap-1.4.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new phonegap-1.4.0.js
into your project.
Update your HTML to use the new phonegap-1.4.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Update res/xml/phonegap.xml
to match framework/res/xml/phonegap.xml
.
Remove phonegap-1.2.0.jar
from the project's libs
directory.
Add phonegap-1.3.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new phonegap-1.3.0.js
into your project.
Update your HTML to use the new phonegap-1.2.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Update res/xml/phonegap.xml
to match framework/res/xml/phonegap.xml
.
Remove phonegap-1.1.0.jar
from the project's libs
directory.
Add phonegap-1.2.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new phonegap-1.2.0.js
into your project.
Update your HTML to use the new phonegap-1.2.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Update res/xml/phonegap.xml
to match framework/res/xml/phonegap.xml
.
Remove phonegap-1.0.0.jar
from the project's libs
directory.
Add phonegap-1.1.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new phonegap-1.1.0.js
into your project.
Update your HTML to use the new phonegap-1.1.0.js
file.
Update res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.
Remove phonegap-0.9.6.jar
from the project's libs
directory.
Add phonegap-1.0.0.jar
to the project's libs
directory.
If you use Eclipse, please refresh your Eclipse project and do a clean.
Copy the new phonegap-1.0.0.js
into your project.
Update your HTML to use the new phonegap-1.0.0.js
file.
Add the res/xml/plugins.xml
to match framework/res/xml/plugins.xml
.