Notes
Getting started with Cordova
Content of the notes (1)
Page 1
See http://ccoenraets.github.io/cordova-tutorial/index.html for a good tutorial.
The basic steps are:
sudo npm install -g cordova
npm update -g cordova
Browse to the cordova projects folder and create a new project:
cordova create workshop com.yourname.workshop Workshop where workshop is the name of the directory and Workshop is the name of the project. com.yourname.workshop is the name of the base namespace / module.
You want to add platforms (Android / iOS, etc.)
cordova platform add android. You will need the JDK installed as well as the PATH and ANDROID_HOME environment variables set correctly. Probably the best place to set this is in ~/.profile (but they can also be set in ~/.bashrc
You will need to add at least a couple of plugins:
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.console
Then run cordova build android to build the project.
You can then run the project from the command line, either in an attached device or on the Android emulator.
Attached devices:
You need to run adb (Android Device Bridge) and manage installed devices from there.
Emulator devices:
You need to run avd (Android Virtual Device Manager) to add emulators
To build the project in the workshop/platforms/android folder and run it on an Android device connected to your computer using a USB cable, type: cordova run android
To build the project in the workshop/platforms/android folder and run it in the Android emulator, type:
cordova emulate android
Information
- Description
- A-Level Cordova / Ionic Note on Getting started with Cordova, created by James Drummond on 17/02/2015.
- Created by
- James Drummond
- Views
- 3
- Tags
- Rating