Cordova 3,
Apps HTML5 para Android

Jorge del Casar (a.k.a. @JorgeCasar)

What's Apache Cordova?

  • A platform for building native mobile applications using HTML, CSS and JavaScript
  • An open-source mobile development framework

http://cordova.apache.org

Apache Cordova 3.0

19 Jul 2013

Main release Notes:

  • New (lighter) Core
  • New Command Line Tooling (Node.js based)
  • Release Plugman 0.11.0 (new plugin management)
    • Change <plugin> to <feature> in config.xml
    • Breakout Plugins into their own repos
  • Deprecate Froyo

Apache Cordova 3.1

02 Oct 2013

Release notes:

  • Initial (alpha) support for Firefox OS
  • Windows 8 support for CLI project
  • Unified whitelist syntax on iOS and Android
  • Documentation translated into several languages:
    fr, zh, de, it, ja, ko, ru & es

Apache Cordova 3.2

22 Nov 2013

Release notes:

  • Bug fixes and enhancements
  • Fixing Android 4.4 (KitKat) related bugs
  • Unified whitelist syntax on iOS and Android

Apache Cordova 3.3 RC1

06 Dec 2013

Release notes: when it ships

Install or update Cordova and report issues

Release date: 20 Dec 2013

CLI = Command Line Interface

  1. Install Node.js
  2. Install Cordova package:
    sudo npm install -g cordova

Create

cordova create <PATH> [ID] [NAME]

Parameters:

  • PATH: directory to be generated for your project
  • ID: reverse domain-style identifier (optional)
  • NAME: application's display text (optional)

Platform(s)

cordova platform(s) [{add|remove|rm} <PLATFORM>]

Parameters:

  • PLATFORM: platform you want to add
    android, blackberry10, firefoxos, ios, wp7, wp8, ...

Without parameters: list all installed and available platforms

Check Platform Support and Platform Guides Android before add a platform

Plugin(s)

cordova plugin(s) [{add|remove|rm} <PATH|URI>]

Parameters:

  • PATH or URI: from where intall the plugin

Without parameters: list all currently installed plugins

You can find a Apache Cordova Plugin or Create your own one

Prepare

cordova prepare [<PLATFORM>]

Copies files for specified platforms, or all platforms, so that the project is ready to build in each SDK

Compile

cordova compile [<PLATFORM>]

Builds the app for specified platforms, or all platforms

Build

cordova build [<PLATFORM>]

Shortcut for prepare, then compile

Emulate

cordova emulate [<PLATFORM>]

Deploys app in specified (or all) platforms' emulator, opening emulator if necessary

Run

cordova run [<PLATFORM>]

Deploys app on specified (or all) platform devices, which must be properly connected and configured in each SDK

Platform Support

Core: The main platforms supported

  • Android
  • BlackBerry
  • iOS
  • Windows Phone
  • Windows 8

Horizon: next platforms to become core

  • Tizen
  • Qt
  • Firefox OS
  • Ubuntu Mobile (Qt)
  • Windows (Win32)

Sunset: not distribution anymore

  • Symbian
  • webOS
  • Bada

Core Features

Full support Platfom APIs

Platfom APIs warnings

Platform guide: Android

  1. Check the System Requirements
  2. Install Android SDK
  3. Append in the PATH enviroment:
    [adt-path]/sdk/tools
    [adt-path]/sdk/platform-tools
  4. Register as
    Google Play publisher

Apache Cordova Plugins

Make your onw Plugins

You can lern how reading the plugin development guide and read how to implement the native code in Android

Platform Plugins

You can add a plugin to a specific platform using plugman directly

plugman --platform [PLATFORM] --project [PATH] --plugin [URL]

If you don't have plugman you can install globally:

npm install -g plugman

Merges: customize each platform

All you put inside ./merges/[platform] will overide the files placed in ./www/ in the specific platform