You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2017/05/04 15:02:20 UTC

[39/52] [abbrv] [partial] docs commit: CB-12747: added 7.x docs

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5ad93d20/www/docs/en/7.x/cordova/events/events.md
----------------------------------------------------------------------
diff --git a/www/docs/en/7.x/cordova/events/events.md b/www/docs/en/7.x/cordova/events/events.md
new file mode 100644
index 0000000..6af0e17
--- /dev/null
+++ b/www/docs/en/7.x/cordova/events/events.md
@@ -0,0 +1,478 @@
+---
+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.
+
+title: Events
+description: List of Cordova JavaScript run-time events.
+---
+
+# Events
+
+There are various events provided by cordova to be used by the application.
+The application code could add listeners for these events. For example:
+
+**HTML File**
+
+```html
+<!DOCTYPE html>
+<html>
+    <head>
+    <title>Device Ready Example</title>
+
+    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+    <script type="text/javascript" charset="utf-8" src="example.js"></script>
+    </head>
+    <body onload="onLoad()">
+    </body>
+</html>
+```
+
+**JS File**
+
+```javascript
+// example.js file
+// Wait for device API libraries to load
+//
+function onLoad() {
+    document.addEventListener("deviceready", onDeviceReady, false);
+}
+
+// device APIs are available
+//
+function onDeviceReady() {
+    document.addEventListener("pause", onPause, false);
+    document.addEventListener("resume", onResume, false);
+    document.addEventListener("menubutton", onMenuKeyDown, false);
+    // Add similar listeners for other events
+}
+
+function onPause() {
+    // Handle the pause event
+}
+
+function onResume() {
+    // Handle the resume event
+}
+
+function onMenuKeyDown() {
+    // Handle the menubutton event
+}
+
+// Add similar event handlers for other events
+```
+
+**Note**: Applications typically should use `document.addEventListener` to attach an event listener once the [deviceready](#deviceready)
+
+The following table lists the cordova events and the supported platforms:
+
+<!-- START HTML -->
+
+<table class="compat" width="100%">
+
+<thead>
+    <tr>
+        <th>Supported Platforms/<br/>Events</td>
+        <th>android</th>
+        <th>blackberry10</th>
+        <th>ios</th>
+        <th>Windows Phone 8</th>
+        <th>Windows</th>
+    </tr>
+</thead>
+
+<tbody>
+    <tr>
+        <th><a href="#deviceready">deviceready</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="y"></td>
+        <td data-col="winphone8"  class="y"></td>
+        <td data-col="win"       class="y"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#pause">pause</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="y"></td>
+        <td data-col="winphone8"  class="y"></td>
+        <td data-col="win"       class="y"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#resume">resume</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="y"></td>
+        <td data-col="winphone8"  class="y"></td>
+        <td data-col="win"       class="y"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#backbutton">backbutton</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="y"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#menubutton">menubutton</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="n"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#searchbutton">searchbutton</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="n"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="n"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#startcallbutton">startcallbutton</a></th>
+        <td data-col="android"    class="n"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="n"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#endcallbutton">endcallbutton</a></th>
+        <td data-col="android"    class="n"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="n"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#volumedownbutton">volumedownbutton</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="n"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#volumeupbutton">volumeupbutton</a></th>
+        <td data-col="android"    class="y"></td>
+        <td data-col="blackberry10" class="y"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="n"></td>
+    </tr>
+
+    <tr>
+        <th><a href="#activated">activated</a></th>
+        <td data-col="android"    class="n"></td>
+        <td data-col="blackberry10" class="n"></td>
+        <td data-col="ios"        class="n"></td>
+        <td data-col="winphone8"  class="n"></td>
+        <td data-col="win"       class="y"></td>
+    </tr>
+</tbody>
+</table>
+
+<!-- END HTML -->
+
+
+## deviceready
+
+The deviceready event fires when Cordova is fully loaded. This event is
+essential to any application. It signals that Cordova's device APIs have
+loaded and are ready to access.
+
+Cordova consists of two code bases: native and JavaScript. While the
+native code loads, a custom loading image displays. However,
+JavaScript only loads once the DOM loads. This means the web app may
+potentially call a Cordova JavaScript function before the
+corresponding native code becomes available.
+
+The `deviceready` event fires once Cordova has fully loaded. Once the
+event fires, you can safely make calls to Cordova APIs.  Applications
+typically attach an event listener with `document.addEventListener`
+once the HTML document's DOM has loaded.
+
+The `deviceready` event behaves somewhat differently from others.  Any
+event handler registered after the `deviceready` event fires has its
+callback function called immediately.
+
+### Quick Example
+
+```javascript
+document.addEventListener("deviceready", onDeviceReady, false);
+
+function onDeviceReady() {
+    // Now safe to use device APIs
+}
+```
+
+## pause
+
+The pause event fires when the native platform puts the application into the background,
+typically when the user switches to a different application.
+
+### Quick Example
+
+```javascript
+document.addEventListener("pause", onPause, false);
+
+function onPause() {
+    // Handle the pause event
+}
+```
+
+### iOS Quirks
+
+In the `pause` handler, any calls to the Cordova API or to native
+plugins that go through Objective-C do not work, along with any
+interactive calls, such as alerts or `console.log()`. They are only
+processed when the app resumes, on the next run loop.
+
+The iOS-specific `resign` event is available as an alternative to
+`pause`, and detects when users enable the __Lock__ button to lock the
+device with the app running in the foreground.  If the app (and
+device) is enabled for multi-tasking, this is paired with a subsequent
+`pause` event, but only under iOS 5. In effect, all locked apps in iOS
+5 that have multi-tasking enabled are pushed to the background.  For
+apps to remain running when locked under iOS 5, disable the app's
+multi-tasking by setting [UIApplicationExitsOnSuspend][UIApplicationExitsOnSuspend]
+to `YES`. To run when locked on iOS 4, this setting does not matter.
+
+## resume
+
+The `resume` event fires when the native platform pulls the application out from the background.
+
+### Quick Example
+
+```javascript
+document.addEventListener("resume", onResume, false);
+
+function onResume() {
+    // Handle the resume event
+}
+```
+
+### iOS Quirks
+
+Any interactive functions called from a [pause](#pause) event handler execute
+later when the app resumes, as signaled by the `resume` event. These
+include alerts, `console.log()`, and any calls from plugins or the
+Cordova API, which go through Objective-C.
+
+- __active__ event
+
+    The iOS-specific `active` event is available as an alternative to
+`resume`, and detects when users disable the __Lock__ button to unlock
+the device with the app running in the foreground.  If the app (and
+device) is enabled for multi-tasking, this is paired with a subsequent
+`resume` event, but only under iOS 5. In effect, all locked apps in
+iOS 5 that have multi-tasking enabled are pushed to the background.
+For apps to remain running when locked under iOS 5, disable the app's
+multi-tasking by setting [UIApplicationExitsOnSuspend][UIApplicationExitsOnSuspend]
+to `YES`. To run when locked on iOS 4, this setting does not matter.
+
+- __resume__ event
+
+    When called from a `resume` event handler, interactive functions such
+as `alert()` need to be wrapped in a `setTimeout()` call with a
+timeout value of zero, or else the app hangs. For example:
+
+    ```javascript
+    document.addEventListener("resume", onResume, false);
+    function onResume() {
+        setTimeout(function() {
+                // TODO: do your thing!
+            }, 0);
+    }
+    ```
+
+### Android Quirks
+
+Refer [Android Life Cycle Guide][AndroidLifeCycleGuide] for details on android quirks with
+the `resume` event.
+
+## backbutton
+
+The event fires when the user presses the back button. To override the default
+back-button behavior, register an event listener for the `backbutton` event.
+It is no longer necessary to call any other method to override the
+back-button behavior.
+
+### Quick Example
+
+```javascript
+document.addEventListener("backbutton", onBackKeyDown, false);
+
+function onBackKeyDown() {
+    // Handle the back button
+}
+```
+
+### Windows Quirks
+
+Throw an error in a `backbutton` callback to force the default behavior, which is an app exit:
+
+```javascript
+document.addEventListener('backbutton', function (evt) {
+    if (cordova.platformId !== 'windows') {
+        return;
+    }
+
+    if (window.location.href !== firstPageUrl) {
+        window.history.back();
+    } else {
+        throw new Error('Exit'); // This will suspend the app
+    }
+}, false);
+```
+
+## menubutton
+
+The event fires when the user presses the menu button. Applying an event handler
+overrides the default menu button behavior.
+
+### Quick Example
+
+```javascript
+document.addEventListener("menubutton", onMenuKeyDown, false);
+
+function onMenuKeyDown() {
+    // Handle the back button
+}
+```
+
+## searchbutton
+
+The event fires when the user presses the search button on Android. If you need to
+override the default search button behavior on Android you can register an event
+listener for the 'searchbutton' event.
+
+### Quick Example
+
+```javascript
+document.addEventListener("searchbutton", onSearchKeyDown, false);
+
+function onSearchKeyDown() {
+    // Handle the search button
+}
+```
+
+## startcallbutton
+
+The event fires when the user presses the start call button. If you need to override
+the default start call behavior you can register an event listener for the `startcallbutton` event.
+
+### Quick Example
+
+```javascript
+document.addEventListener("startcallbutton", onStartCallKeyDown, false);
+
+function onStartCallKeyDown() {
+    // Handle the start call button
+}
+```
+
+## endcallbutton
+
+This event fires when the user presses the end call button. The event overrides the
+default end call behavior.
+
+### Quick Example
+
+```javascript
+document.addEventListener("endcallbutton", onEndCallKeyDown, false);
+
+function onEndCallKeyDown() {
+    // Handle the end call button
+}
+```
+
+## volumedownbutton
+
+The event fires when the user presses the volume down button. If you need to override
+the default volume down behavior you can register an event listener for the `volumedownbutton` event.
+
+### Quick Example
+
+```javascript
+document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false);
+
+function onVolumeDownKeyDown() {
+    // Handle the volume down button
+}
+```
+
+## volumeupbutton
+
+The event fires when the user presses the volume up button. If you need to override
+the default volume up behavior you can register an event listener for the `volumeupbutton` event.
+
+### Quick Example
+
+```javascript
+document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false);
+
+function onVolumeUpKeyDown() {
+    // Handle the volume up button
+}
+```
+
+## activated
+
+The event fires when Windows Runtime activation has occurred. See [MSDN docs][MSDNActivatedEvent] for further details and activation types.
+
+### Quick Example
+
+```javascript
+document.addEventListener("activated", activated, false);
+
+function activated(args) {
+    if (args && args.kind === Windows.ApplicationModel.Activation.ActivationKind.file) {
+       // Using args.raw to get the native StorageFile object
+        Windows.Storage.FileIO.readTextAsync(args.raw.detail[0].files[0]).done(function (text) {
+            console.log(text);
+        }, function (err) {
+            console.error(err);
+        });
+    }
+}
+```
+
+### Windows Quirks
+
+* Original activated event args are available in `args.raw.detail[0]` property and can be used to get a type information or invoke methods of one of the activation arguments,
+
+* Original activated event args are also cloned to `args.detail[0]` and can be used as a fallback in case an inner args property has been lost.  
+See https://issues.apache.org/jira/browse/CB-10653 for details.
+
+* `activated` event might be fired before `deviceready` so you should save the activation flag and args to the app context in case you need them - for example in the [Share target case](https://issues.apache.org/jira/browse/CB-11924).
+The subscription to the `activated` event should be done before `deviceready` handler (in `app.bindEvents` in terms of the Cordova template).
+
+[UIApplicationExitsOnSuspend]: http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html
+[AndroidLifeCycleGuide]: ../../guide/platforms/android/lifecycle.html
+[MSDNActivatedEvent]: https://msdn.microsoft.com/en-us/library/windows/apps/br212679.aspx
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5ad93d20/www/docs/en/7.x/cordova/storage/storage.md
----------------------------------------------------------------------
diff --git a/www/docs/en/7.x/cordova/storage/storage.md b/www/docs/en/7.x/cordova/storage/storage.md
new file mode 100644
index 0000000..0a63ca7
--- /dev/null
+++ b/www/docs/en/7.x/cordova/storage/storage.md
@@ -0,0 +1,327 @@
+---
+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.
+
+title: Storage
+toc_title: Store data
+description: Storing data on the device.
+---
+
+# Storage
+
+Several storage APIs are available for Cordova applications.
+See html5rocks [storage overview][Html5RocksStorageOverview] and
+[tutorial][Html5RocksStorageTutorial], for a more complete overview and
+examples.
+
+Each API offers advantages and disadvantages, which are summarized here. You
+should choose whichever best suits your needs. You can also use several
+different approaches within a single application for different purposes.
+
+## LocalStorage
+
+Local storage provides simple, synchronous key/value pair storage, and is
+supported by the underlying WebView implementations on all Cordova
+platforms.
+
+### Usage Summary
+
+Local storage can be accessed via `window.localStorage`. The following code
+snippet shows the most important methods exposed by the returned `Storage` object:
+
+```javascript
+var storage = window.localStorage;
+var value = storage.getItem(key); // Pass a key name to get its value.
+storage.setItem(key, value) // Pass a key name and its value to add or update that key.
+storage.removeItem(key) // Pass a key name to remove that key from storage.
+```
+
+For more information, see:
+
+- [W3C: Spec][W3CSpecStorage]
+- [MDN: Storage API][MDNStorage]
+- [MDN: Storage Guide][MDNStorageGuide]
+
+### Advantages
+
+- Supported by all Cordova platforms.
+- Its simple, synchronous API means it is easy to use.
+
+### Disadvantages
+
+- Only stores strings, so complex data structures have to be serialized,
+  and only data that can be serialized can be stored.
+- Performs poorly with large amounts of data. In particular:
+    - The lack of indexing means searches require manually iterating all data.
+    - Storing large or complex items is slow due to the need to serialize/de-serialize.
+    - Synchronous API means calls will lock up the user interface.
+- Limited total amount of storage (typically around 5MB).
+- iOS stores `localStorage` data in a location that may be cleaned out by
+  the OS when space is required.
+
+## WebSQL
+
+WebSQL provides an API for storing data in a structured database that can
+be queried using a standard SQL syntax (specifically, [SQLite][SQLite]).
+As such, it provides all the power (and complexity) of SQL.
+
+It is supported by the underlying WebView on the following Cordova platforms:
+
+- Android
+- BlackBerry 10
+- iOS
+
+### Usage Summary
+
+The entry point into creating or opening a database is the `window.openDatabase()` method:
+
+```javascript
+var db = window.openDatabase(name, version, displayName, estimatedSize);
+```
+
+- **name** (string): The unique name of the database, as it will be stored in disk.
+- **version** (string): The version of the database.
+- **displayName** (string): A human friendly name for the database, which
+  the system will use if it needs to describe your database to the user
+  (for example, when requesting permission to increase the size of the database).
+- **estimatedSize** (number): The expected maximum size of the database, in bytes.
+  As the database increases in size, the user may be prompted for permission. If
+  you make a reasonable first guess, the user is likely to be prompted less often.
+
+The returned `Database` object provides a `transaction()` method (or `readTransaction()`
+to optimize read-only transactions) that let's you create a failure-safe transaction:
+
+```javascript
+var db = window.openDatabase(name, version, displayName, estimatedSize);
+db.transaction(function (tx) {
+    tx.executeSql(sqlStatement, valueArray, function (tx, result) {
+        console.log(result);
+    }, function (error) {
+        console.log(error);
+    });
+});
+```
+
+For more information, see:
+
+- [W3C: Spec][WebSQLDatabaseSpecification]
+- [TutorialsPoint: WebSQL Guide][TutorialsPointWebSQL]
+
+For a good introduction to the SQL language, see:
+
+- [w3schools: Introduction to SQL][w3schoolsSQL]
+
+### Working with database versions
+
+When opening an existing database, if the specified version does not match
+the version of the database, an exception will be thrown and the database
+will not open. However, if you specify an empty string for the version, the
+database will open regardless of its current version (and you can query the
+current version via `db.version`). Be wary, however - if the database is
+being created, it will be created with its version set to an empty string.
+
+### Advantages
+
+- Good performance - data can be indexed to provide fast searches, and
+  asynchronous API means it doesn't lock up the user interface.
+- Robustness from using a transactional database model.
+- Support for versioning.
+
+### Disadvantages
+
+- Not supported by all Cordova platforms.
+- More complex to work with than *LocalStorage* or *IndexedDB*.
+- The API is deprecated. It is unlikely to ever be supported on platforms
+  that don't currently support it, and it may be removed from platforms that do.
+- Imposes a rigid structure that must be defined up-front.
+- Limited total amount of storage (typically around 5MB).
+
+## IndexedDB
+
+The goal of the IndexedDB API is to combine the strengths of the LocalStorage
+and WebSQL APIs, while avoiding their weaknesses. IndexedDB lets you store
+arbitrary JavaScript objects (provided they are supported by the [structured clone algorithm][StructuredCloneAlgorithm]),
+indexed with a key. It provides some of the benefits of SQL tables, without
+constraining the structure or needing to define it up front.
+
+IndexedDB provides a simple and easy to understand data model, much like LocalStorage.
+But unlike LocalStorage, you can create multiple databases, with multiple stores per
+database, and its asynchronous API and search indexes provide performance benefits.
+
+IndexedDB is supported by the underlying WebView on the following Cordova platforms:
+
+- BlackBerry 10
+- Windows (with some limitations)
+- Android (4.4 and above)
+
+### Windows Limitations
+
+Windows platform support for IndexedDB is incomplete. For example, it lacks
+the following features:
+
+- Not available in web workers.
+- Doesn't support array keyPaths.
+- Doesn't support array keys.
+- Doesn't support object lookup via compound index.
+
+### Usage Summary
+
+- IndexedDB works asynchronously - you request a particular database
+  operation, then get notified of the result via a DOM event.
+- When you make a request, you get a request object, which provides `onerror`
+  and `onsuccess` events, as well as properties such as `result`, `error`
+  and `readyState`.
+
+The following code snippet demonstrates some simple usage of IndexedDB:
+
+```javascript
+var db;
+var databaseName = 'myDB';
+var databaseVersion = 1;
+var openRequest = window.indexedDB.open(databaseName, databaseVersion);
+openRequest.onerror = function (event) {
+    console.log(openRequest.errorCode);
+};
+openRequest.onsuccess = function (event) {
+    // Database is open and initialized - we're good to proceed.
+    db = openRequest.result;
+    displayData();
+};
+openRequest.onupgradeneeded = function (event) {
+    // This is either a newly created database, or a new version number
+    // has been submitted to the open() call.
+    var db = event.target.result;
+    db.onerror = function () {
+        console.log(db.errorCode);
+    };
+
+    // Create an object store and indexes. A key is a data value used to organize
+    // and retrieve values in the object store. The keyPath option identifies where
+    // the key is stored. If a key path is specified, the store can only contain
+    // JavaScript objects, and each object stored must have a property with the
+    // same name as the key path (unless the autoIncrement option is true).
+    var store = db.createObjectStore('customers', { keyPath: 'customerId' });
+
+    // Define the indexes we want to use. Objects we add to the store don't need
+    // to contain these properties, but they will only appear in the specified
+    // index of they do.
+    //
+    // syntax: store.createIndex(indexName, keyPath[, parameters]);
+    //
+    // All these values could have duplicates, so set unique to false
+    store.createIndex('firstName', 'firstName', { unique: false });
+    store.createIndex('lastName', 'lastName', { unique: false });
+    store.createIndex('street', 'street', { unique: false });
+    store.createIndex('city', 'city', { unique: false });
+    store.createIndex('zipCode', 'zipCode', { unique: false });
+    store.createIndex('country', 'country', { unique: false });
+
+    // Once the store is created, populate it
+    store.transaction.oncomplete = function (event) {
+        // The transaction method takes an array of the names of object stores
+        // and indexes that will be in the scope of the transaction (or a single
+        // string to access a single object store). The transaction will be
+        // read-only unless the optional 'readwrite' parameter is specified.
+        // It returns a transaction object, which provides an objectStore method
+        // to access one of the object stores that are in the scope of this
+        //transaction.
+        var customerStore = db.transaction('customers', 'readwrite').objectStore('customers');
+        customers.forEach(function (customer) {
+            customerStore.add(customer);
+        });
+    };
+};
+
+function displayData() {
+}
+```
+
+For more information, see:
+
+- [W3C: Spec][W3CIndexedDB]
+- [MDN: IndexedDB API Reference][MDNIndexedDBAPI]
+- [MDN: IndexedDB Basic Concepts][MDNIndexedDBBasicConcepts]
+- [MDN: Using IndexedDB Guide][MDNUsingIndexedDB]
+
+### Advantages
+
+- Good performance - asynchronous API won't block the UI, and indexing provides
+  good search performance.
+- Simple data model easier to learn than SQL.
+- More flexible structure than WebSQL.
+- Multiple databases and object stores provides more structure than LocalStorage.
+- Robustness from using a transactional database model.
+- Support for versioning.
+
+### Disadvantages
+
+- Not supported on iOS.
+- Complex API with nested callbacks.
+- Limited total amount of storage (typically around 5MB).
+
+## Plugin-Based Options
+
+### FileSystem API
+
+The FileSystem API was a W3C spec that was implemented by Chrome, but not other
+browsers. It provides APIs to store and retrieve data on the local file system,
+and is described in some detail in an excellent [html5rocks article][Html5RocksFileSystemTutorial].
+While the API is not supported natively by any Cordova platform, the [File plugin][FileAPI]
+provides an extensive implementation that is available across all Cordova platforms.
+
+### SQLite Plugin
+
+The SQLite plugin provides an API virtually identical to WebSQL described above.
+The main differences are:
+
+- It is available with support for the Windows platform.
+- It effectively has no size limitations.
+
+It is available in the following variations:
+
+* **[cordova-sqlite-storage][SQLiteStorage]** - core version that includes its own sqlite3 implementation. It supports iOS, Android & Windows platforms.
+* **[cordova-sqlite-ext][SQLiteExt]** - extended version with additional
+  features including REGEXP support on Android and iOS.
+* **[cordova-sqlite-evfree][SQLiteEVFree]** - similar to *cordova-sqlite-ext*
+  but with improved memory handling. Available under GPL v3 or commercial license.
+
+### Other Plugins
+
+Search [Cordova plugins][CordovaPlugins] for other plugins that provide
+alternative storage options.
+
+[Html5RocksStorageOverview]: http://www.html5rocks.com/en/features/storage
+[Html5RocksStorageTutorial]: http://www.html5rocks.com/en/tutorials/offline/storage/
+[W3CSpecStorage]: https://html.spec.whatwg.org/multipage/webstorage.html
+[MDNStorage]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
+[MDNStorageGuide]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
+[WebSQLDatabaseSpecification]: http://dev.w3.org/html5/webdatabase/
+[TutorialsPointWebSQL]: http://www.tutorialspoint.com/html5/html5_web_sql.htm
+[w3schoolsSQL]: http://www.w3schools.com/sql/sql_intro.asp
+[SQLite]: https://www.sqlite.org/
+[W3CIndexedDB]: http://www.w3.org/TR/IndexedDB/
+[MDNIndexedDBAPI]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
+[MDNIndexedDBBasicConcepts]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB
+[MDNUsingIndexedDB]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
+[StructuredCloneAlgorithm]: http://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data
+[Html5RocksFileSystemTutorial]: http://www.html5rocks.com/en/tutorials/file/filesystem/
+[FileAPI]: https://github.com/apache/cordova-plugin-file/blob/master/README.md
+[SQLiteStorage]: https://github.com/litehelpers/Cordova-sqlite-storage#readme
+[SQLiteExt]: https://github.com/litehelpers/cordova-sqlite-ext#readme
+[SQLiteEVFree]: https://github.com/litehelpers/Cordova-sqlite-enterprise-free#readme
+[CordovaPlugins]: {{ site.baseurl }}/plugins

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5ad93d20/www/docs/en/7.x/guide/appdev/hooks/index.md
----------------------------------------------------------------------
diff --git a/www/docs/en/7.x/guide/appdev/hooks/index.md b/www/docs/en/7.x/guide/appdev/hooks/index.md
new file mode 100644
index 0000000..2d52f2c
--- /dev/null
+++ b/www/docs/en/7.x/guide/appdev/hooks/index.md
@@ -0,0 +1,449 @@
+---
+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.
+
+title: Hooks Guide
+toc_title: Hooks
+description: List of hooks supported by the Cordova CLI.
+---
+
+# Hooks
+
+## Introduction
+
+Cordova Hooks represent special scripts which could be added by application and
+plugin developers or even by your own build system  to customize cordova commands.
+
+Cordova hooks allow you to perform special activities around cordova commands. For example,
+you may have a custom tool that checks for code formatting in your javascript file. And, you
+would like to run this tool before every build. In such a case, you could use a
+'before_build' hook and instruct the cordova run time to run the custom tool to be invoked
+before every build.
+
+Hooks might be related to your application activities such as such as `before_build`,
+`after_build`, etc. Or, they might be related to the plugins of your application. For example,
+hooks such as `before_plugin_add`, `after_plugin_add`, etc applies to plugin related
+activities. These hooks can be associated with all plugins within your application or
+be specific to only one plugin.
+
+Cordova supports the following hook types:
+
+<!-- START HTML -->
+
+<table class="hooks" width="100%">
+    <col width="20%">
+    <col width="30%">
+    <col width="50%">
+    <thead>
+        <tr>
+            <th>Hook Type</th>
+            <th>Associated Cordova Commands</th>
+            <th>Description</th>
+        </tr>
+    </thead>
+    <tbody>
+        <tr>
+            <th data-col="beforeplatformadd">before_platform_add</th>
+            <td data-col="code" rowspan="2" ><code>cordova platform add</code></td>
+            <td rowspan="2" class="description" data-col="description">To be executed before and after adding a platform.</td>
+        </tr>
+        <tr>
+            <th data-col="afterplatformadd">after_platform_add</th>
+        </tr>
+        <tr>
+            <th data-col="beforeplatformrm">before_platform_rm</th>
+            <td data-col="code" rowspan="2"><code>cordova platform rm</code></td>
+            <td rowspan="2" class="description" data-col="description">To be executed before and after removing a platform.</td>
+        </tr>
+        <tr>
+            <th data-col="afterplatformrm">after_platform_rm</th>
+        </tr>
+        <tr>
+            <th data-col="beforeplatformls">before_platform_ls</th>
+            <td data-col="code" rowspan="2"><code>cordova platform ls</code></td>
+            <td rowspan="2" class="description" data-col="description">To be executed before and after listing the installed and available platforms.</td>
+        </tr>
+        <tr>
+            <th data-col="afterplatformls">after_platform_ls</th>
+        </tr>
+        <tr>
+            <th data-col="beforeprepare">before_prepare</th>
+            <td data-col="code" rowspan="2"><code>cordova prepare</code><br/><code>cordova platform add</code><br/><code>cordova build</code><br/><code>cordova run</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after preparing your application.</td>
+        </tr>
+        <tr>
+            <th data-col="afterprepare">after_prepare</th>
+        </tr>
+        <tr>
+            <th data-col="beforecompile">before_compile</th>
+            <td data-col="code" rowspan="2"><code>cordova compile</code><br/><code>cordova build</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after compiling your application.</td>
+        </tr>
+        <tr>
+            <th data-col="aftercompile">after_compile</th>
+        </tr>
+        <tr>
+            <th data-col="beforedeploy">before_deploy</th>
+            <td data-col="code"><code>cordova emulate</code><br/><code>cordova run</code></td>
+            <td data-col="description">To be executed before deploying your application.</td>
+        </tr>
+        <tr>
+            <th data-col="beforebuild">before_build</th>
+            <td data-col="code" rowspan="2"><code>cordova build</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after building your application.</td>
+        </tr>
+        <tr>
+            <th data-col="afterbuild">after_build</th>
+        </tr>
+        <tr>
+            <th data-col="beforeemulate">before_emulate</th>
+            <td data-col="code" rowspan="2"><code>cordova emulate</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after emulating your application.</td>
+        </tr>
+        <tr>
+            <th data-col="afteremulate">after_emulate</th>
+        </tr>
+        <tr>
+            <th data-col="beforerun">before_run</th>
+            <td data-col="code" rowspan="2"><code>cordova run</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after running your application.</td>
+        </tr>
+        <tr>
+            <th data-col="afterrun">after_run</th>
+        </tr>
+        <tr>
+            <th data-col="beforeserve">before_serve</th>
+            <td data-col="code" rowspan="2"><code>cordova serve</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after serving your application.</td>
+        </tr>
+        <tr>
+            <th data-col="afterserve">after_serve</th>
+        </tr>
+        <tr>
+            <th data-col="beforeclean">before_clean</th>
+            <td data-col="code" rowspan="2"><code>cordova clean</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after cleaning your application.</td>
+        </tr>
+        <tr>
+            <th data-col="afterclean">after_clean</th>
+        </tr>
+        <tr>
+            <th data-col="prepackage">pre_package</td>
+            <td data-col="code">N/A</td>
+            <td data-col="description">Applicable to Windows 8 and Windows Phone only. This hook is deprecated.</td>
+        </tr>
+        <tr>
+            <th data-col="beforepluginadd">before_plugin_add</th>
+            <td data-col="code" rowspan="2"><code>cordova plugin add</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after adding a plugin.</td>
+        </tr>
+        <tr>
+            <th data-col="afterpluginadd">after_plugin_add</th>
+        </tr>
+        <tr>
+            <th data-col="beforepluginrm">before_plugin_rm</th>
+            <td data-col="code" rowspan="2"><code>cordova plugin rm</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after removing a plugin.</td>
+        </tr>
+        <tr>
+            <th data-col="afterpluginrm">after_plugin_rm</th>
+        </tr>
+        <tr>
+            <th data-col="beforepluginls">before_plugin_ls</th>
+            <td data-col="code" rowspan="2"><code>cordova plugin ls</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after listing the plugins in your application.</td>
+        </tr>
+        <tr>
+            <th data-col="afterpluginls">after_plugin_ls</th>
+        </tr>
+        <tr>
+            <th data-col="beforepluginsearch">before_plugin_search</th>
+            <td data-col="code" rowspan="2"><code>cordova plugin search</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after a plugin search.</td>
+        </tr>
+        <tr>
+            <th data-col="afterpluginsearch">after_plugin_search</th>
+        </tr>
+        <tr>
+            <th data-col="beforeplugininstall">before_plugin_install</th>
+            <td data-col="code" rowspan="2"><code>cordova plugin add</code></td>
+            <td rowspan="2" data-col="description">To be executed before and after installing a plugin (to the platforms). Plugin hooks in plugin.xml are executed for a plugin being installed only</td>
+        </tr>
+        <tr>
+            <th data-col="afterplugininstall">after_plugin_install</th>
+        </tr>
+        <tr>
+            <th data-col="beforepluginuninstall">before_plugin_uninstall</th>
+            <td data-col="code" rowspan="2"><code>cordova plugin rm</code></td>
+            <td data-col="description">To be executed before uninstalling a plugin (from the platforms).Plugin hooks in plugin.xml are executed for a plugin being installed only</td>
+        </tr>
+    </tbody>
+</table>
+
+<!-- END HTML -->
+
+## Ways to define hooks
+
+### Config.xml
+
+Hooks could be defined in project's `config.xml` using `<hook>` elements, for example:
+
+```xml
+<hook type="before_build" src="scripts/appBeforeBuild.bat" />
+<hook type="before_build" src="scripts/appBeforeBuild.js" />
+<hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" />
+
+<platform name="android">
+    <hook type="before_build" src="scripts/wp8/appAndroidBeforeBuild.bat" />
+    <hook type="before_build" src="scripts/wp8/appAndroidBeforeBuild.js" />
+    <hook type="before_plugin_install" src="scripts/wp8/appWP8BeforePluginInstall.js" />
+    ...
+</platform>
+
+<platform name="windows">
+    <hook type="before_build" src="scripts/windows/appWinBeforeBuild.bat" />
+    <hook type="before_build" src="scripts/windows/appWinBeforeBuild.js" />
+    <hook type="before_plugin_install" src="scripts/windows/appWinBeforePluginInstall.js" />
+    ...
+</platform>
+```
+
+### Plugin hooks (plugin.xml)
+
+As a plugin developer you can define hook scripts using `<hook>` elements in a `plugin.xml` like that:
+
+```xml
+<hook type="before_plugin_install" src="scripts/beforeInstall.js" />
+<hook type="after_build" src="scripts/afterBuild.js" />
+
+<platform name="android">
+    <hook type="before_plugin_install" src="scripts/androidBeforeInstall.js" />
+    <hook type="before_build" src="scripts/androidBeforeBuild.js" />
+    ...
+</platform>
+```
+
+`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired
+exclusively for the plugin being installed/uninstalled.
+
+### Via `/hooks` directory (Deprecated)
+
+To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example:
+
+```
+# script file will be automatically executed after each build
+hooks/after_build/after_build_custom_action.js
+```
+
+When using these hooks, they will always be run as executable files, not as loadable JavaScript modules.
+
+__Remember__: Make your scripts executable in this case.
+
+__Note__: this method is considered deprecated in favor of the hook elements in config.xml and plugin.xml.
+
+### Order of Hooks execution
+
+#### Based on Hooks Definition
+
+Hook scripts could be defined by adding them to the special predefined folder
+(`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run
+serially in the following order:
+
+* Application hooks from `/hooks`;
+* Application hooks from `config.xml`;
+* Plugin hooks from `plugins/.../plugin.xml`.
+
+#### Based on the Internal order of execution
+
+The internal order of execution of hooks is fixed.
+
+##### Example 1 (cordova platform add)
+If there are hooks associated with `before_platform_add`, `after_platform_add`, `before_prepare`, `after_prepare`,
+`before_plugin_install` and `after_plugin_install` (and assuming you have one plugin installed on your project),
+adding a new platform will execute the hooks in the following order:
+
+```
+before_platform_add
+    before_prepare
+    after_prepare
+    before_plugin_install
+    after_plugin_install
+after_platform_add
+```
+
+##### Example 2 (cordova build)
+If there are hooks associated with `before_prepare`, `after_prepare`, `before_compile`, `after_compile`, `before_build`
+and `after_build` - running a build command will execute the hooks in the following order:
+
+```
+before_build
+    before_prepare
+    after_prepare
+    before_compile
+    after_compile
+after_build
+```
+
+## Script Interface
+### Windows Quirks
+
+If you are working on Windows, and in case your hook (Javascript/Non-Javascript)scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example:
+
+```
+#!/usr/bin/env [name_of_interpreter_executable]
+```
+
+### Javascript
+
+If you are writing hooks using Node.js you should use the following module definition:
+
+```javascript
+module.exports = function(context) {
+    ...
+}
+```
+
+`context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object of the following format:
+
+```json
+{
+  "hook": "before_plugin_install",
+  "scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js",
+  "cmdLine": "The\\exact\\command\\cordova\\run\\with arguments",
+  "opts": {
+    "projectRoot":"C:\\path\\to\\the\\project",
+    "cordova": {
+      "platforms": ["android"],
+      "plugins": ["plugin-withhooks"],
+      "version": "0.21.7-dev"
+    },
+    "plugin": {
+      "id": "plugin-withhooks",
+      "pluginInfo": {
+        ...
+      },
+      "platform": "android",
+      "dir": "C:\\path\\to\\the\\project\\plugins\\plugin-withhooks"
+    }
+  },
+  "cordova": {...}
+}
+
+```
+`context.opts.plugin` object will only be passed to plugin hooks scripts.
+
+You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way:
+
+```javascript
+var Q = context.requireCordovaModule('q');
+```
+
+You can make your scipts async using Q:
+
+```javascript
+module.exports = function(context) {
+    var Q = context.requireCordovaModule('q');
+    var deferral = new Q.defer();
+
+    setTimeout(function(){
+      console.log('hook.js>> end');
+    deferral.resolve();
+    }, 1000);
+
+    return deferral.promise;
+}
+```
+> __Note__:  new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only.
+For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below.
+
+### Non-javascript
+
+Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
+
+Environment Variable Name     | Description
+------------------------------|--------------------------------------------
+CORDOVA_VERSION               | The version of the Cordova-CLI.
+CORDOVA_PLATFORMS             | Comma separated list of platforms that the command applies to (e.g: android, ios).
+CORDOVA_PLUGINS               | Comma separated list of plugin IDs that the command applies to (e.g: cordova-plugin-file-transfer, cordova-plugin-file).
+CORDOVA_HOOK                  | Path to the hook that is being executed.
+CORDOVA_CMDLINE               | The exact command-line arguments passed to cordova (e.g: cordova run ios --emulate).
+
+If a script returns a non-zero exit code, then the parent cordova command will be aborted.
+
+> __Note__: we highly recommend writing your hooks using Node.js so that they are cross-platform, see [Javascript](#link-javascript) section above.
+
+## Sample Usage
+
+This sample demonstrates Cordova hooks usage to trace to the console output the
+size of generated .apk file for Android platform.
+
+Create blank Cordova app and add the following definition to `config.xml` to
+tell Cordova to run `afterBuild.js` script after each platform build.
+
+```xml
+<hook type="after_build" src="scripts/afterBuild.js" />
+```
+
+Create `scripts/afterBuild.js` file and add the following implementation.
+We use async version of `fs.stat` method to demonstrate how async functionality
+could be done via hooks.
+
+```javascript
+module.exports = function(ctx) {
+    // make sure android platform is part of build
+    if (ctx.opts.platforms.indexOf('android') < 0) {
+        return;
+    }
+    var fs = ctx.requireCordovaModule('fs'),
+        path = ctx.requireCordovaModule('path'),
+        deferral = ctx.requireCordovaModule('q').defer();
+
+    var platformRoot = path.join(ctx.opts.projectRoot, 'platforms/android');
+    var apkFileLocation = path.join(platformRoot, 'build/outputs/apk/android-debug.apk');
+
+    fs.stat(apkFileLocation, function(err,stats) {
+        if (err) {
+                deferral.reject('Operation failed');
+        } else {
+            console.log('Size of ' + apkFileLocation + ' is ' + stats.size +' bytes');
+            deferral.resolve();
+        }
+    });
+
+    return deferral.promise;
+};
+```
+
+Parameter `ctx` in example above is passed by Cordova and represents execution
+context such as script full path, target platform, command-line arguments, etc and
+also exposes additional helper functionality. See `Script Interface` section above
+for more details.
+
+You can now add android platform and execute build.
+
+```
+cordova platform add android
+..
+cordova build
+..
+Size of path\to\app\platforms\android\build\outputs\apk\android-debug.apk is 1821193 bytes
+```
+
+More good usage examples could be found in [Three Hooks Your Cordova Phone Gap Project needs][Devgirl_Hooks_Link]
+
+[Devgirl_Hooks_Link]: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5ad93d20/www/docs/en/7.x/guide/appdev/privacy/index.md
----------------------------------------------------------------------
diff --git a/www/docs/en/7.x/guide/appdev/privacy/index.md b/www/docs/en/7.x/guide/appdev/privacy/index.md
new file mode 100644
index 0000000..ff35a96
--- /dev/null
+++ b/www/docs/en/7.x/guide/appdev/privacy/index.md
@@ -0,0 +1,122 @@
+---
+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.
+
+title: Privacy Guide
+toc_title: Manage privacy
+description: Learn about important mobile privacy issues.
+---
+
+# Privacy Guide
+
+Mobile privacy is a critical issue that every app developer must
+address. Your users expect that their private information will be
+collected and treated appropriately by your app. Also, there are an
+increasing number of jurisdictions that now have legal requirements
+regarding mobile privacy practices.
+
+This guide on mobile app privacy should be considered a _primer_
+addressing some the most significant issues. It outlines some broadly
+accepted best practices and provides references to other more detailed
+guides and references.
+
+* __Privacy Policy__: You app should include a privacy policy that
+  addresses topics such as what kind of information the app collects
+  from or about your users, how that information is used, with whom it
+  is shared, and how users can make privacy-related choices within the
+  app. To aid understanding, you should use plain language and avoid
+  technical jargon. You should make your privacy policy available for
+  users to review prior to download, such as in the app description in
+  the app marketplace. In addition, you should make your privacy
+  policy available within the app itself. The limited size of mobile
+  device displays creates challenges for displaying privacy policies
+  to users. Consider developing a _short form_ of the policy that
+  includes the most important information, and then provide a link to
+  the "long form" policy for those interested in more details. Several
+  groups are attempting to develop icon-based standards for
+  communicating privacy practices, which you may want to consider once
+  these standards mature.
+
+* __Collection of sensitive information__: An app's collection of
+  sensitive personal information raises important privacy concerns.
+  Examples of sensitive personal information include financial
+  information, health information, and information from or about
+  children. It also includes information gathered from certain sensors
+  and databases typically found on mobile devices and tablets, such as
+  geolocation information, contacts/phonebook, microphone/camera, and
+  stored pictures/videos. See the following documentation pages for
+  more information: [camera](cordova_camera_camera.md.html),
+  [capture](cordova_media_capture_capture.md.html),
+  [contacts](cordova_contacts_contacts.md.html), and
+  [geolocation](cordova_geolocation_geolocation.md.html). Generally,
+  you should obtain a user's express permission before collecting
+  sensitive information and, if possible, provide a control mechanism
+  that allows a user to easily change permissions. App operating
+  systems can help in some instances by presenting just-in-time dialog
+  boxes that ask for the user's permission before collection. In these
+  cases, be sure to take advantage of any opportunity to customize the
+  dialog box text to clarify how the app uses and, if applicable,
+  shares such information.
+
+* __Avoiding user surprise__: If the app collects or uses information
+  in a way that may be surprising to users in light of the primary
+  purpose of your app (for example, a music player that accesses
+  stored pictures), you should take similar steps as with the
+  collection of sensitive personal information. That is, you should
+  strongly consider the use of just-in-time dialog boxes to inform the
+  user about the collection or use of that information and, if
+  appropriate, provide a corresponding privacy control.
+
+* __Third party data collection or sharing__: If you app collects
+  information that is provided to another company--such as a social
+  networking platform or an ad network (for example, if your app
+  displays advertising)--you should inform your users of that
+  collection and sharing. At a minimum, your privacy policy should
+  describe the information collection and sharing and, if appropriate,
+  offer your users the ability to control or opt-out of such
+  collection or sharing.
+
+* __Collection limitation and security__: Your users entrust your app
+  with their information and they expect that you will take
+  appropriate security precautions to protect it. One of the best ways
+  to avoid security compromises of personal information is not to
+  collect the information in the first place unless your app has a
+  specific and legitimate business reason for the collection. For
+  information that does need to be collected, ensure that you provide
+  appropriate security controls to protect that information, whether
+  it is stored on the device or on your backend servers. You should
+  also develop an appropriate data retention policy that is
+  implemented within the app and on your backend servers.
+
+Following are some additional helpful mobile privacy guides for developers:
+
+* California Attorney General, [Privacy on the Go: Recommendations for the Mobile Ecosystem][1]
+
+* Center for Democracy & Technology, Future of Privacy Forum, [Best Practices for Mobile App Developers][2]
+
+* CTIA-The Wireless Association, [Best Practices and Guidelines for Location Based Services][3]
+
+* Federal Trade Commission, [Mobile Privacy Disclosures: Building Trust Through Transparency][4]
+
+* Future of Privacy Forum, [Application Privacy][5] Website
+
+[1]: http://oag.ca.gov/sites/all/files/pdfs/privacy/privacy_on_the_go.pdf
+[2]: http://www.futureofprivacy.org/wp-content/uploads/Best-Practices-for-Mobile-App-Developers_Final.pdf
+[3]: http://www.ctia.org/business_resources/wic/index.cfm/AID/11300
+[4]: http://www.ftc.gov/os/2013/02/130201mobileprivacyreport.pdf
+[5]: http://www.applicationprivacy.org

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5ad93d20/www/docs/en/7.x/guide/appdev/security/index.md
----------------------------------------------------------------------
diff --git a/www/docs/en/7.x/guide/appdev/security/index.md b/www/docs/en/7.x/guide/appdev/security/index.md
new file mode 100644
index 0000000..6e87d7d
--- /dev/null
+++ b/www/docs/en/7.x/guide/appdev/security/index.md
@@ -0,0 +1,98 @@
+---
+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.
+
+title: Security Guide
+toc_title: Manage security
+description: Information and tips for building a secure application.
+---
+
+# Security Guide
+
+The following guide includes some security best practices that you should consider when developing a Cordova application. Please be aware that security is a very complicated topic and therefore this guide is not exhaustive. If you believe you can contribute to this guide, please feel free to file an issue in Cordova's bug tracker under ["Documentation"](https://issues.apache.org/jira/browse/CB/component/12316407).  This guide is designed to be applicable to general Cordova development (all platforms) but special platform-specific considerations will be noted.
+
+## This guide discusses the following topics:
+* Whitelist
+* Iframes and the Callback Id Mechanism
+* Certificate Pinning
+* Self-signed Certificates
+* Encrypted storage
+* General Tips
+* Recommended Articles and Other Resources
+
+## Whitelist
+
+* Read and understand the [Whitelist Guide](../whitelist/index.html)
+
+* Domain whitelisting does not work on Android API 10 and below, and WP8 for iframes and XMLHttpRequest. This means an attacker can load any domain in an iframe and any script on that page within the iframe can directly access Cordova JavaScript objects and the corresponding native Java objects. You should take this into consideration when building applications for these platforms. In practice this means making sure you target an Android API higher than 10, and that if possible you do not use an iframe to load external content - use the inAppBrowser plugin or other third-party plugins.
+
+## Iframes and the Callback Id Mechanism
+
+If content is served in an iframe from a whitelisted domain, that domain will have access to the native Cordova bridge. This means that if you whitelist a third-party advertising network and serve those ads through an iframe, it is possible that a malicious ad will be able to break out of the iframe and perform malicious actions. Because of this, you should generally not use iframes unless you control the server that hosts the iframe content.  Also note that there are third party plugins available to support advertising networks. Note that this statement is not true for iOS, which intercepts everything including iframe connections.
+
+## Certificate Pinning
+
+Cordova does not support true certificate pinning. The main barrier to this is a lack of native APIs in Android for intercepting SSL connections to perform the check of the server's certificate. (Although it is possible to do certificate pinning on Android in Java using JSSE, the webview on Android is written in C++, and server connections are handled for you by the webview, so it is not possible to use Java and JSSE there.) Since Apache Cordova is meant to offer consistent APIs across multiple platforms, not having a capability in a major platform breaks that consistency.
+
+There are ways to approximate certificate pinning, such as checking the server's public key (fingerprint) is the expected value when your application starts or at other various times during your application's lifetime. There are third-party plugins available for Cordova that can do that. However, this is not the same as true certificate pinning which automatically verifies the expected value on every connection to the server.
+
+There are also plugins that can do true certificate pinning for some platforms, assuming your app is able to do all of its network requests using the plugin (i.e.: no traditional XHR/AJAX requests, etc).
+
+## Self-signed Certificates
+
+Using self-signed certificates on your server is not recommended. If you desire SSL, then it is highly recommended that your server have a certificate that has been properly signed by a well-known CA (certificate authority). The inability to do true certificate pinning makes this important.
+
+The reason is that accepting self-signed certificates bypasses the certificate chain validation, which allows any server certificate to be considered valid by the device. This opens up the communication to man-in-the-middle attacks. It becomes very easy for a hacker to not only intercept and read all communication between the device and the server, but also to modify the communication. The device will never know this is happening because it doesn't verify that the server's certificate is signed by a trusted CA. The device has no proof that the server is who it expects. Because of the ease of doing a man-in-the-middle attack, accepting self-signed certificates is only marginally better than just running http instead of https on an untrusted network. Yes, the traffic would be encrypted, but it could be encrypted with the key from a man-in-the-middle, so the man-in-the-middle can access everything, so encryption is useless except to passive observers. Users trust SSL to be secure, and 
 this would be deliberately making it insecure, so the SSL use becomes misleading. If this will be used on a trusted network (i.e., you are entirely inside a controlled enterprise), then self-signed certs are still not recommended. The two recommendations in a trusted network are to just use http because the network itself is trusted, or to get a certificate signed by a trusted CA (not self-signed). Either the network is trusted or it is not.
+
+The principles described here are not specific to Apache Cordova, they apply to all client-server communication.
+
+When running Cordova on Android, using `android:debuggable="true"` in the application manifest will permit SSL errors such as certificate chain validation errors on self-signed certs. So you can use self-signed certs in this configuration, but this is not a configuration that should be used when your application is in production. It is meant to be used only during application development.
+
+
+## Encrypted storage
+
+(TBD)
+
+## General Tips
+
+### Do not use Android Gingerbread!
+* Set your min-target-sdk level higher than 10. API 10 is Gingerbread, and Gingerbread is no longer supported by Google or device manufacturers, and is therefore not recommend by the Cordova team.
+* Gingerbread has been shown to be insecure and one of the most targeted mobile OSs [http://www.mobilemag.com/2012/11/06/andriod-2-3-gingerbread-security/](http://bgr.com/2012/11/06/android-security-gingerbread-malware/).
+* The Whitelist on Android does not work with Gingerbread or lower. This means an attacker can load malicious code in an iframe that would then have access to all of the Cordova APIs and could use that access to steal personal data, send SMS messages to premium-rate numbers, and perform other malicious acts.
+
+### Use InAppBrowser for outside links
+* Use the InAppBrowser when opening links to any outside website. This is much safer than whitelisting a domain name and including the content directly in your application because the InAppBrowser will use the native browser's security features and will not give the website access to your Cordova environment. Even if you trust the third party website and include it directly in your application, that third party website could link to malicious web content.
+
+### Validate all user input
+* Always validate any and all input that your application accepts. This includes usernames, passwords, dates, uploaded media, etc. Because an attacker could manipulate your HTML and JS assets (either by decompiling your application or using debugging tools like chrome://inspect), this validation should also be performed on your server, especially before handing the data off to any backend service.
+* Other sources where data should be validated: user documents, contacts, push notifications
+
+### Do not cache sensitive data
+* If usernames, password, geolocation information, and other sensitive data is cached, then it could potentially be retrieved later by an unauthorized user or application.
+
+### Don't use eval() unless you know what you're doing
+* The JavaScript function eval() has a long history of being abused. Using it incorrectly can open your code up for injection attacks, debugging difficulties, and slower code execution.
+
+### Do not assume that your source code is secure
+* Since a Cordova application is built from HTML and JavaScript assets that get packaged in a native container, you should not consider your code to be secure. It is possible to reverse engineer a Cordova application.
+
+## Recommended Articles and Other Resources
+
+* [HTML5 Security cheat sheet, detailing how to secure your HTML5 application](https://www.owasp.org/index.php/HTML5_Security_Cheat_Sheet)
+* [Phonegap's article on device security, such as using encrypted data](https://github.com/phonegap/phonegap/wiki/Platform-Security)
+* [Whitepaper about well known security flaws in Webview based hybrid applications](http://www.cis.syr.edu/~wedu/Research/paper/webview_acsac2011.pdf)

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5ad93d20/www/docs/en/7.x/guide/appdev/whitelist/index.md
----------------------------------------------------------------------
diff --git a/www/docs/en/7.x/guide/appdev/whitelist/index.md b/www/docs/en/7.x/guide/appdev/whitelist/index.md
new file mode 100644
index 0000000..3f2af80
--- /dev/null
+++ b/www/docs/en/7.x/guide/appdev/whitelist/index.md
@@ -0,0 +1,182 @@
+---
+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.
+
+title: Whitelist Guide
+toc_title: Whitelisting
+description: Securely grant an application access to external resources.
+---
+
+# Whitelist Guide
+
+Domain whitelisting is a security model that controls access to
+external domains over which your application has no control. Cordova
+provides a configurable security policy to define which external sites may be
+accessed.  By default, new apps are configured to allow access to any site.
+Before moving your application to production, you should formulate a whitelist
+and allow access to specific network domains and subdomains.
+
+For Android (as of its 4.0 release), Cordova's security policy is extensible via a plugin
+interface.  Your app should use the [cordova-plugin-whitelist][wlp], as it provides
+better security and configurability than earlier versions of Cordova.  While
+it is possible to implement your own whitelist plugin, it is not recommended
+unless your app has very specific security policy needs.  See the
+[cordova-plugin-whitelist][wlp] for details on usage and configuration.
+
+For other platforms, Cordova adheres to the [W3C Widget Access][1] specification,
+which relies on the `<access>` element within the app's `config.xml` file to
+enable network access to specific domains. For projects that rely on
+the CLI workflow described in [The Command-Line Interface](../../cli/index.html), this file is
+located in the project's top-level directory. Otherwise for
+platform-specific development paths, locations are listed in the
+sections below.
+
+The following examples demonstrate `<access>` whitelist syntax:
+
+* Access to [google.com][2]:
+
+    ```xml
+    <access origin="http://google.com" />
+    ```
+
+* Access to the secure [google.com][3] (`https://`):
+
+    ```xml
+    <access origin="https://google.com" />
+    ```
+
+* Access to the subdomain [maps.google.com][4]:
+
+    ```xml
+    <access origin="http://maps.google.com" />
+    ```
+
+* Access to all the subdomains on [google.com][2], for example
+  [mail.google.com][5] and [docs.google.com][6]:
+
+    ```xml
+    <access origin="http://*.google.com" />
+    ```
+
+* Access to _all_ domains, for example, [google.com][2] and
+  [developer.mozilla.org][7]:
+
+    ```xml
+    <access origin="*" />
+    ```
+
+  This is the default value for newly created CLI projects.
+
+Be aware that some websites may automatically redirect from their home page to
+a different url, such as using https protocol or to a country-specific
+domain. For example `http://www.google.com` will redirect to use SSL/TLS at
+`https://www.google.com`, and then may further redirect to a geography such as
+`https://www.google.co.uk`. Such scenarios may require modified or additional
+whitelist entries beyond your initial requirement. Please consider this
+as you are building your whitelist.
+
+Note that the whitelist applies only to the main Cordova webview, and does not
+apply to an InAppBrowser webview or opening links in the system web browser.
+
+## Android Whitelisting
+
+As above, see [cordova-plugin-whitelist][wlp] for details.  For cordova-android
+prior to 4.0.0, see older versions of this documentation.
+
+## iOS Whitelisting
+
+`Cordova-ios` version 4.0 and greater does **not** require the [cordova-plugin-whitelist][wlp] plugin to be installed, however its configuration details apply to iOS too. The `<allow-intent>` and `<allow-navigation>` tags are _new_ for cordova-ios 4.x and greater, see the [cordova-plugin-whitelist][wlp] documentation for details on the usage of these tags.
+
+For cordova-ios versions prior to 4.0.0, see the older versions of this documentation.
+
+[Application Transport Security (ATS)](https://developer.apple.com/library/prerelease/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33) is new in iOS 9 (Xcode 7). This new feature acts as a whitelist for your app. The cordova cli will automatically convert `<access>` and `<allow-navigation>` tags to the appropriate ATS directives.
+
+The `<access>` and `<allow-navigation>` tags support these three attributes below, which have their equivalents in ATS:
+
+1. minimum-tls-version (String, defaults to 'TLSv1.2')
+2. requires-forward-secrecy (Boolean, defaults to 'true')
+3. requires-certificate-transparency (Boolean, defaults to 'false', new in iOS 10)
+
+* example:
+
+    ```xml
+    <access origin='https://cordova.apache.org' minimum-tls-version='TLSv1.1' requires-forward-secrecy='false' requires-certificate-transparency='true' />
+    ```
+    
+In iOS 10 and above, the `<access>` tag supports these three attributes below, when paired with the origin wildcard `*`. These attributes also have their equivalents in ATS:
+
+1. allows-arbitrary-loads-in-media (Boolean, defaults to 'false', new in iOS 10)
+2. allows-arbitrary-loads-in-web-content (Boolean, defaults to 'false', new in iOS 10)
+3. allows-local-networking (Boolean, defaults to 'false', new in iOS 10)
+
+* example:
+
+    ```xml
+    <access origin='*' allows-arbitrary-loads-in-media='true' allows-arbitrary-loads-in-web-content='true' allows-local-networking='true' />
+    ```
+
+See the [ATS Technote](https://developer.apple.com/library/prerelease/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33) for more details.
+
+## BlackBerry 10 Whitelisting
+
+The whitelisting rules are found in `www/config.xml`.
+
+BlackBerry 10's use of wildcards differs from other platforms in two
+ways:
+
+* Any content accessed by `XMLHttpRequest` must be declared
+  explicitly. Setting `origin="*"` does not work in this case.
+  Alternatively, all web security may be disabled using the
+  `WebSecurity` preference described in BlackBerry Configuration:
+
+    ```xml
+    <preference name="websecurity" value="disable" />
+    ```
+
+* As an alternative to setting `*.domain`, set an additional
+  `subdomains` attribute to `true`. It should be set to `false` by
+  default.
+
+    ```xml
+    <!-- Narrows access to google.com -->
+    <access origin="http://google.com" subdomains="false" />
+
+    <!-- Allows access to maps.google.com and docs.google.com -->
+    <access origin="http://google.com" subdomains="true" />
+
+    <!-- Allows access to all domains, including the local `file://` protocol -->
+    <access origin="*" subdomains="true" />
+    ```
+
+For more information on support, see BlackBerry's documentation on the
+[access element][8].
+
+## Windows Phone Whitelisting
+
+The whitelisting rules for Windows Phone 8 are found in the
+app's `config.xml` file.
+
+[wlp]: ../../../reference/cordova-plugin-whitelist/
+[1]: http://www.w3.org/TR/widgets-access/
+[2]: http://google.com
+[3]: https://google.com
+[4]: http://maps.google.com
+[5]: http://mail.google.com
+[6]: http://docs.google.com
+[7]: http://developer.mozilla.org
+[8]: https://developer.blackberry.com/html5/documentation/v1_0/access_element_834677_11.html

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5ad93d20/www/docs/en/7.x/guide/cli/index.md
----------------------------------------------------------------------
diff --git a/www/docs/en/7.x/guide/cli/index.md b/www/docs/en/7.x/guide/cli/index.md
new file mode 100644
index 0000000..3958c3a
--- /dev/null
+++ b/www/docs/en/7.x/guide/cli/index.md
@@ -0,0 +1,332 @@
+---
+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.
+
+title: Creating your first Cordova app
+description: Learn how to create your first Cordova hybrid app using Cordova CLI.
+toc_title: Create your first app
+---
+
+# Create your first Cordova app
+
+This guide shows you how to create  a JS/HTML Cordova application and deploy them to
+various native mobile platforms using the `cordova` command-line
+interface (CLI). For detailed reference on Cordova command-line, review the [CLI reference]
+
+## Installing the Cordova CLI
+
+The Cordova command-line tool is distributed as an npm package.
+
+To install the `cordova` command-line tool, follow these steps:
+
+1. Download and install [Node.js](https://nodejs.org/en/download/). On
+   installation you should be able to invoke `node` and `npm` on your
+   command line.
+
+1. (Optional) Download and install a [git client](http://git-scm.com/downloads), if you don't
+   already have one. Following installation, you should be able to invoke `git`
+   on your command line. The CLI uses it to download assets when they are referenced using a url to a git repo.
+
+1. Install the `cordova` module using `npm` utility of Node.js. The `cordova`
+   module will automatically be downloaded by the `npm` utility.
+
+   * on OS X and Linux:
+       ```bash
+       $ sudo npm install -g cordova
+       ```
+
+       On OS X and Linux, prefixing the `npm` command with
+       `sudo` may be necessary to install this development utility in
+       otherwise restricted directories such as
+       `/usr/local/share`. If you are using the optional
+       nvm/nave tool or have write access to the install directory,
+       you may be able to omit the `sudo` prefix. There are
+       [more tips](http://justjs.com/posts/npm-link-developing-your-own-npm-modules-without-tears)
+       available on using `npm` without `sudo`, if you desire to do that.
+
+   * on Windows:
+       ```
+       C:\>npm install -g cordova
+       ```
+
+   The `-g` flag above tells `npm` to install `cordova` globally. Otherwise
+   it will be installed in the `node_modules` subdirectory of the current
+   working directory.
+
+   Following installation, you should be able to run
+   `cordova` on the command line with no arguments and it should
+   print help text.
+
+## Create the App
+
+Go to the directory where you maintain your source code, and create a cordova project:
+
+```bash
+$ cordova create hello com.example.hello HelloWorld
+```
+
+This creates the required directory structure for your cordova app. By default, the `cordova create` script generates a skeletal web-based application whose home page is the project's `www/index.html` file.
+
+###See Also
+- [Cordova create command reference documentation][cdv_create]
+- [Cordova project directory structure][cdv_dir]
+- [Cordova project templates][cdv_template]
+
+## Add Platforms
+
+All subsequent commands need to be run within the project's directory,
+or any subdirectories:
+
+```bash
+$ cd hello
+```
+
+Add the platforms that you want to target your app. We will add the 'ios' and 'android' platform and ensure they get saved to `config.xml` and `package.json`:
+
+```bash
+$ cordova platform add ios
+$ cordova platform add android
+```
+
+To check your current set of platforms:
+
+```bash
+$ cordova platform ls
+```
+
+Running commands to add or remove platforms affects the contents of
+the project's _platforms_ directory, where each specified platform
+appears as a subdirectory.
+
+> Note: When using the CLI to build your application, you should
+_not_ edit any files in the `/platforms/` directory. The files
+in this directory are routinely overwritten when preparing
+applications for building, or when plugins are re-installed.
+
+###See Also
+- [Cordova platform command reference documentation][cdv_platform]
+
+##Install pre-requisites for building
+To build and run apps, you need to install SDKs for each platform you wish to target. Alternatively, if you are using browser for development you can use `browser` platform which does not require any platform SDKs.
+
+To check if you satisfy requirements for building the platform:
+
+```
+$ cordova requirements
+Requirements check results for android:
+Java JDK: installed .
+Android SDK: installed
+Android target: installed android-19,android-21,android-22,android-23,Google Inc.:Google APIs:19,Google Inc.:Google APIs (x86 System Image):19,Google Inc.:Google APIs:23
+Gradle: installed
+
+Requirements check results for ios:
+Apple OS X: not installed
+Cordova tooling for iOS requires Apple OS X
+Error: Some of requirements check failed
+```
+
+###See Also
+- [Android platform requirements](../../guide/platforms/android/index.html#requirements-and-support)
+- [iOS platform requirements](../../guide/platforms/ios/index.html#requirements-and-support)
+- [Windows platform requirements](../../guide/platforms/win8/index.html#requirements-and-support)
+
+## Build the App
+
+By default, `cordova create` script generates a skeletal web-based application whose start page is the project's `www/index.html` file. Any
+initialization should be specified as part of the [deviceready][DeviceReadyEvent] event handler defined in `www/js/index.js`.
+
+Run the following command to build the project for _all_ platforms:
+
+```bash
+$ cordova build
+```
+
+You can optionally limit the scope of each build to specific platforms - 'ios' in this case:
+
+```bash
+$ cordova build ios
+```
+
+###See Also
+- [Cordova build command reference documentation][cdv_build]
+
+##Test the App
+
+SDKs for mobile platforms often come bundled with emulators that
+execute a device image, so that you can launch the app from the home
+screen and see how it interacts with many platform features.  Run a
+command such as the following to rebuild the app and view it within a
+specific platform's emulator:
+
+```bash
+$ cordova emulate android
+```
+
+![]({{ site.baseurl }}/static/img/guide/cli/android_emulate_init.png)
+
+Following up with the `cordova emulate` command refreshes the emulator
+image to display the latest application, which is now available for
+launch from the home screen:
+
+![]({{ site.baseurl }}/static/img/guide/cli/android_emulate_install.png)
+
+Alternately, you can plug the handset into your computer and test the
+app directly:
+
+```bash
+$ cordova run android
+```
+
+Before running this command, you need to set up the device for
+testing, following procedures that vary for each platform.
+
+###See Also
+- [Setting up Android emulator](../../guide/platforms/android/index.html#setting-up-an-emulator)
+- [Cordova run command reference documentation][cdv_run]
+- [Cordova emulate command reference documentation][cdv_emulate]
+
+## Add Plugins
+
+You can modify the default generated app to take advantage of standard web technologies,
+but for the app to access device-level features, you need to add plugins.
+
+A _plugin_ exposes a Javascript API for native SDK functionality. Plugins are typically hosted on
+npm and you can search for them on the [plugin search page](/plugins/). Some key APIs are provided by the Apache Cordova open source project and these are referred to as [Core Plugin APIs]. You can also use the CLI to launch the search page:
+
+```bash
+$ cordova plugin search camera
+```
+
+To add and save the camera plugin to `config.xml` and `package.json`, we will specify the npm package name for the camera plugin:
+
+```
+$ cordova plugin add cordova-plugin-camera
+Fetching plugin "cordova-plugin-camera@~2.1.0" via npm
+Installing "cordova-plugin-camera" for android
+Installing "cordova-plugin-camera" for ios
+```
+
+Plugins can also be added using a directory or a git repo.
+
+> __NOTE__: The CLI adds plugin code as appropriate for each platform.
+If you want to develop with lower-level shell tools or platform SDKs
+as discussed in the [Overview](../overview/index.html), you need to run the Plugman utility to
+add plugins separately for each platform. (For more information, see
+[Using Plugman to Manage Plugins](../../plugin_ref/plugman.html).)
+
+Use `plugin ls` (or `plugin list`, or `plugin` by itself) to view
+currently installed plugins. Each displays by its identifier:
+
+```
+$ cordova plugin ls
+cordova-plugin-camera 2.1.0 "Camera"
+cordova-plugin-whitelist 1.2.1 "Whitelist"
+```
+
+###See Also
+- [Cordova plugin command reference documentation][cdv_plugin]
+- [Cordova plugin search page](/plugins/)
+- [Core Plugin APIs]
+
+## Using _merges_ to Customize Each Platform
+
+While Cordova allows you to easily deploy an app for many different
+platforms, sometimes you need to add customizations.  In that case,
+you don't want to modify the source files in various `www` directories
+within the top-level `platforms` directory, because they're regularly
+replaced with the top-level `www` directory's cross-platform source.
+
+Instead, the top-level `merges` directory offers a place to specify
+assets to deploy on specific platforms. Each platform-specific
+subdirectory within `merges` mirrors the directory structure of the
+`www` source tree, allowing you to override or add files as needed.
+For example, here is how you might use `merges` to boost the default
+font size for Android devices:
+
+* Edit the `www/index.html` file, adding a link to an additional CSS
+  file, `overrides.css` in this case:
+
+    ```html
+    <link rel="stylesheet" type="text/css" href="css/overrides.css" />
+    ```
+
+* Optionally create an empty `www/css/overrides.css` file, which would
+  apply for all non-Android builds, preventing a missing-file error.
+
+* Create a `css` subdirectory within `merges/android`, then add a
+  corresponding `overrides.css` file. Specify CSS that overrides the
+  12-point default font size specified within `www/css/index.css`, for
+  example:
+
+    ```css
+    body { font-size:14px; }
+    ```
+
+When you rebuild the project, the Android version features the custom
+font size, while others remain unchanged.
+
+You can also use `merges` to add files not present in the original
+`www` directory. For example, an app can incorporate a _back button_
+graphic into the iOS interface, stored in
+`merges/ios/img/back_button.png`, while the Android version can
+instead capture [backbutton][BackButtonEvent] events from the corresponding hardware
+button.
+
+
+## Updating Cordova and Your Project
+
+After installing the `cordova` utility, you can always update it to
+the latest version by running the following command:
+
+```bash
+$ sudo npm update -g cordova
+```
+
+Use this syntax to install a specific version:
+
+```bash
+$ sudo npm install -g cordova@3.1.0-0.2.0
+```
+
+Run `cordova -v` to see which version is currently running. To find the latest released cordova version, you can run:
+
+```bash
+$ npm info cordova version
+```
+
+To update platform that you're targeting:
+
+```bash
+$ cordova platform update android --save
+$ cordova platform update ios --save
+...etc.
+```
+
+[DeviceReadyEvent]: ../../cordova/events/events.html#deviceready
+[BackButtonEvent]:  ../../cordova/events/events.html#backbutton
+[Core Plugin APIs]: ../../guide/support/index.html#core-plugin-apis
+[cdv_template]:     ../../guide/cli/template.html#
+
+[CLI reference]: ../../reference/cordova-cli/index.html
+[cdv_create]:    ../../reference/cordova-cli/index.html#cordova-create-command
+[cdv_dir]:       ../../reference/cordova-cli/index.html#directory-structure
+[cdv_platform]:  ../../reference/cordova-cli/index.html#cordova-platform-command
+[cdv_run]:       ../../reference/cordova-cli/index.html#cordova-run-command
+[cdv_emulate]:   ../../reference/cordova-cli/index.html#cordova-emulate-command
+[cdv_plugin]:    ../../reference/cordova-cli/index.html#cordova-plugin-command
+[cdv_build]:     ../../reference/cordova-cli/index.html#cordova-build-command


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org