Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 48F9D9F87 for ; Fri, 30 Mar 2012 23:47:23 +0000 (UTC) Received: (qmail 49178 invoked by uid 500); 30 Mar 2012 23:47:23 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 49128 invoked by uid 500); 30 Mar 2012 23:47:23 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 48950 invoked by uid 99); 30 Mar 2012 23:47:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 23:47:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AC2E6A531; Fri, 30 Mar 2012 23:47:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: mwbrooks@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [5/12] Update build script to support cordova namespace. Message-Id: <20120330234722.AC2E6A531@tyr.zones.apache.org> Date: Fri, 30 Mar 2012 23:47:22 +0000 (UTC) http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/notification/notification.vibrate.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/notification/notification.vibrate.md b/docs/en/edge/cordova/notification/notification.vibrate.md new file mode 100644 index 0000000..089190c --- /dev/null +++ b/docs/en/edge/cordova/notification/notification.vibrate.md @@ -0,0 +1,83 @@ +notification.vibrate +==================== + +Vibrates the device for the specified amount of time. + + navigator.notification.vibrate(milliseconds) + +- __time:__ Milliseconds to vibrate the device. 1000 milliseconds equals 1 second (`Number`) + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iPhone +- Windows Phone 7 + +Quick Example +------------- + + // Vibrate for 2.5 seconds + // + navigator.notification.vibrate(2500); + +Full Example +------------ + + + + + Notification Example + + + + + +

Show Alert

+

Play Beep

+

Vibrate

+ + + +iPhone Quirks +------------- + +- __time:__ Ignores the time and vibrates for a pre-set amount of time. + + navigator.notification.vibrate(); + navigator.notification.vibrate(2500); // 2500 is ignored http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/database/database.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/database/database.md b/docs/en/edge/cordova/storage/database/database.md new file mode 100644 index 0000000..9643375 --- /dev/null +++ b/docs/en/edge/cordova/storage/database/database.md @@ -0,0 +1,104 @@ +Database +======= + +Contains methods that allow the user to manipulate the Database + +Methods +------- + +- __transaction__: Runs a database transaction. +- __changeVersion__: method allows scripts to atomically verify the version number and change it at the same time as doing a schema update. + +Details +------- + +A Database object is returned from a call to `window.openDatabase()`. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 and higher) +- iPhone + +Transaction Quick Example +------------------ + function populateDB(tx) { + tx.executeSql('DROP TABLE IF EXISTS DEMO'); + tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)'); + tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")'); + tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")'); + } + + function errorCB(err) { + alert("Error processing SQL: "+err.code); + } + + function successCB() { + alert("success!"); + } + + var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000); + db.transaction(populateDB, errorCB, successCB); + +Change Version Quick Example +------------------- + + var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000); + db.changeVersion("1.0", "1.1"); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

Database

+ + + +Android 1.X Quirks +------------------ + +- __changeVersion:__ This method is not support by Android 1.X devices. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/localstorage/localstorage.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/localstorage/localstorage.md b/docs/en/edge/cordova/storage/localstorage/localstorage.md new file mode 100644 index 0000000..b8601ec --- /dev/null +++ b/docs/en/edge/cordova/storage/localstorage/localstorage.md @@ -0,0 +1,91 @@ +localStorage +=============== + +Provides access to a W3C Storage interface (http://dev.w3.org/html5/webstorage/#the-localstorage-attribute) + + var storage = window.localStorage; + +Methods +------- + +- __key__: Returns the name of the key at the position specified. +- __getItem__: Returns the item identified by it's key. +- __setItem__: Saves and item at the key provided. +- __removeItem__: Removes the item identified by it's key. +- __clear__: Removes all of the key value pairs. + +Details +----------- + +localStorage provides an interface to a W3C Storage interface. It allows one to save data as key-value pairs. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 and higher) +- iPhone + +Key Quick Example +------------- + + var keyName = window.localStorage.key(0); + +Set Item Quick Example +------------- + + window.localStorage.setItem("key", "value"); + +Get Item Quick Example +------------- + + var value = window.localStorage.getItem("key"); + // value is now equal to "value" + +Remove Item Quick Example +------------- + + window.localStorage.removeItem("key"); + +Clear Quick Example +------------- + + window.localStorage.clear(); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

localStorage

+ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/parameters/display_name.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/parameters/display_name.md b/docs/en/edge/cordova/storage/parameters/display_name.md new file mode 100644 index 0000000..cf99b51 --- /dev/null +++ b/docs/en/edge/cordova/storage/parameters/display_name.md @@ -0,0 +1,4 @@ +database_displayname +================== + +The display name of the database. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/parameters/name.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/parameters/name.md b/docs/en/edge/cordova/storage/parameters/name.md new file mode 100644 index 0000000..6184633 --- /dev/null +++ b/docs/en/edge/cordova/storage/parameters/name.md @@ -0,0 +1,4 @@ +database_name +============ + +The name of the database. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/parameters/size.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/parameters/size.md b/docs/en/edge/cordova/storage/parameters/size.md new file mode 100644 index 0000000..1e96ccc --- /dev/null +++ b/docs/en/edge/cordova/storage/parameters/size.md @@ -0,0 +1,4 @@ +database_size +============== + +The size of the database in bytes. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/parameters/version.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/parameters/version.md b/docs/en/edge/cordova/storage/parameters/version.md new file mode 100644 index 0000000..712dc78 --- /dev/null +++ b/docs/en/edge/cordova/storage/parameters/version.md @@ -0,0 +1,4 @@ +database_version +============= + +The version of the database. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/sqlerror/sqlerror.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/sqlerror/sqlerror.md b/docs/en/edge/cordova/storage/sqlerror/sqlerror.md new file mode 100644 index 0000000..9f12197 --- /dev/null +++ b/docs/en/edge/cordova/storage/sqlerror/sqlerror.md @@ -0,0 +1,28 @@ +SQLError +======== + +A `SQLError` object is thrown when an error occurs. + +Properties +---------- + +- __code:__ One of the predefined error codes listed below. +- __message:__ A description of the error. + +Constants +--------- + +- `SQLError.UNKNOWN_ERR` +- `SQLError.DATABASE_ERR` +- `SQLError.VERSION_ERR` +- `SQLError.TOO_LARGE_ERR` +- `SQLError.QUOTA_ERR` +- `SQLError.SYNTAX_ERR` +- `SQLError.CONSTRAINT_ERR` +- `SQLError.TIMEOUT_ERR` + +Description +----------- + +The `SQLError` object is thrown when an error occurs when manipulating a database. + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md b/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md new file mode 100644 index 0000000..4fb46c8 --- /dev/null +++ b/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md @@ -0,0 +1,115 @@ +SQLResultSet +======= + +When the executeSql method of a SQLTransaction is called it will invoke it's callback with a SQLResultSet. + +Properties +------- + +- __insertId__: the row ID of the row that the SQLResultSet object's SQL statement inserted into the database +- __rowAffected__: the number of rows that were changed by the SQL statement. If the statement did not affect any rows then it is set to 0. +- __rows__: a SQLResultSetRowList representing the rows returned. If no rows are returned the object will be empty. + +Details +------- + +When you call the SQLTransaction executeSql method it's callback methods will be called with a SQLResultSet object. The result object has three properties. The first is the `insertId` which will return the row number of a success SQL insert statement. If the SQL statement is not an insert then the `insertId` is not set. The `rowAffected` is always 0 for a SQL select statement. For insert or update statements it returns the number of rows that have been modified. The final property is of type SQLResultSetList and it contains the data returned from a SQL select statement. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 and higher) +- iPhone + +Execute SQL Quick Example +------------------ + + function queryDB(tx) { + tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB); + } + + function querySuccess(tx, results) { + // this will be empty since no rows were inserted. + console.log("Insert ID = " + results.insertId); + // this will be 0 since it is a select statement + console.log("Rows Affected = " + results.rowAffected); + // the number of rows returned by the select statement + console.log("Insert ID = " + results.rows.length); + } + + function errorCB(err) { + alert("Error processing SQL: "+err.code); + } + + var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000); + db.transaction(queryDB, errorCB); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

Database

+ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/sqlresultsetlist/sqlresultsetlist.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/sqlresultsetlist/sqlresultsetlist.md b/docs/en/edge/cordova/storage/sqlresultsetlist/sqlresultsetlist.md new file mode 100644 index 0000000..9886ecf --- /dev/null +++ b/docs/en/edge/cordova/storage/sqlresultsetlist/sqlresultsetlist.md @@ -0,0 +1,116 @@ +SQLResultSetList +======= + +One of the properties of the SQLResultSet containing the rows returned from a SQL query. + +Properties +------- + +- __length__: the number of rows returned by the SQL query + +Methods +------- + +- __item__: returns the row at the specified index represented by a JavaScript object. + +Details +------- + +The SQLResultSetList contains the data returned from a SQL select statement. The object contains a length property letting you know how many rows the select statement has been returned. To get a row of data you would call the `item` method specifing an index. The item method returns a JavaScript Object who's properties are the columns of the database the select statement was executed against. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 and higher) +- iPhone + +Execute SQL Quick Example +------------------ + + function queryDB(tx) { + tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB); + } + + function querySuccess(tx, results) { + var len = results.rows.length; + ��� console.log("DEMO table: " + len + " rows found."); + ��� for (var i=0; i + + + Contact Example + + + + + +

Example

+

Database

+ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md b/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md new file mode 100644 index 0000000..20989c8 --- /dev/null +++ b/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md @@ -0,0 +1,93 @@ +SQLTransaction +======= + +Contains methods that allow the user to execute SQL statements against the Database. + +Methods +------- + +- __executeSql__: executes a SQL statement + +Details +------- + +When you call a Database objects transaction method it's callback methods will be called with a SQLTransaction object. The user can build up a database transaction by calling the executeSql method multiple times. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 and higher) +- iPhone + +Execute SQL Quick Example +------------------ + + function populateDB(tx) { + tx.executeSql('DROP TABLE IF EXISTS DEMO'); + tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)'); + tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")'); + tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")'); + } + + function errorCB(err) { + alert("Error processing SQL: "+err); + } + + function successCB() { + alert("success!"); + } + + var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000); + db.transaction(populateDB, errorCB, successCB); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

SQLTransaction

+ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/storage.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/storage.md b/docs/en/edge/cordova/storage/storage.md new file mode 100644 index 0000000..1ce586e --- /dev/null +++ b/docs/en/edge/cordova/storage/storage.md @@ -0,0 +1,29 @@ +Storage +========== + +> Provides access to the devices storage options. + +This API is based on the [W3C Web SQL Database Specification](http://dev.w3.org/html5/webdatabase/) and [W3C Web Storage API Specification](http://dev.w3.org/html5/webstorage/). Some devices already provide an implementation of this spec. For those devices, the built-in support is used instead of replacing it with Cordova's implementation. For devices that don't have storage support, Cordova's implementation should be compatible with the W3C specification. + +Methods +------- + +- openDatabase + +Arguments +--------- + +- database_name +- database_version +- database_displayname +- database_size + +Objects +------- + +- Database +- SQLTransaction +- SQLResultSet +- SQLResultSetList +- SQLError +- localStorage \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/cordova/storage/storage.opendatabase.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/storage/storage.opendatabase.md b/docs/en/edge/cordova/storage/storage.opendatabase.md new file mode 100644 index 0000000..7493081 --- /dev/null +++ b/docs/en/edge/cordova/storage/storage.opendatabase.md @@ -0,0 +1,54 @@ +openDatabase +=============== + +Returns a new Database object. + + var dbShell = window.openDatabase(database_name, database_version, database_displayname, database_size); + +Description +----------- + +window.openDatabase returns a new Database object. + +This method will create a new SQL Lite Database and return a Database object. Use the Database Object to manipulate the data. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 and higher) +- iPhone + +Quick Example +------------- + + var db = window.openDatabase("test", "1.0", "Test DB", 1000000); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

Open Database

+ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/acceleration/acceleration.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/acceleration/acceleration.md b/docs/en/edge/phonegap/accelerometer/acceleration/acceleration.md deleted file mode 100644 index 580e202..0000000 --- a/docs/en/edge/phonegap/accelerometer/acceleration/acceleration.md +++ /dev/null @@ -1,85 +0,0 @@ -Acceleration -============ - -Contains `Accelerometer` data captured at a specific point in time. - -Properties ----------- - -- __x:__ Amount of motion on the x-axis. Range [0, 1] (`Number`) -- __y:__ Amount of motion on the y-axis. Range [0, 1] (`Number`) -- __z:__ Amount of motion on the z-axis. Range [0, 1] (`Number`) -- __timestamp:__ Creation timestamp in milliseconds. (`DOMTimeStamp`) - -Description ------------ - -This object is created and populated by Cordova, and returned by an `Accelerometer` method. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iPhone -- Windows Phone 7 ( Mango ) - -Quick Example -------------- - - function onSuccess(acceleration) { - alert('Acceleration X: ' + acceleration.x + '\n' + - 'Acceleration Y: ' + acceleration.y + '\n' + - 'Acceleration Z: ' + acceleration.z + '\n' + - 'Timestamp: ' + acceleration.timestamp + '\n'); - }; - - function onError() { - alert('onError!'); - }; - - navigator.accelerometer.getCurrentAcceleration(onSuccess, onError); - -Full Example ------------- - - - - - Acceleration Example - - - - - -

Example

-

getCurrentAcceleration

- - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/accelerometer.clearWatch.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/accelerometer.clearWatch.md b/docs/en/edge/phonegap/accelerometer/accelerometer.clearWatch.md deleted file mode 100644 index 9d70da7..0000000 --- a/docs/en/edge/phonegap/accelerometer/accelerometer.clearWatch.md +++ /dev/null @@ -1,91 +0,0 @@ -accelerometer.clearWatch -======================== - -Stop watching the `Acceleration` referenced by the watch ID parameter. - - navigator.accelerometer.clearWatch(watchID); - -- __watchID__: The ID returned by `accelerometer.watchAcceleration`. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iPhone - -Quick Example -------------- - - var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); - - // ... later on ... - - navigator.accelerometer.clearWatch(watchID); - -Full Example ------------- - - - - - Acceleration Example - - - - - -
Waiting for accelerometer...
- - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/accelerometer.getCurrentAcceleration.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/accelerometer.getCurrentAcceleration.md b/docs/en/edge/phonegap/accelerometer/accelerometer.getCurrentAcceleration.md deleted file mode 100644 index 09ea085..0000000 --- a/docs/en/edge/phonegap/accelerometer/accelerometer.getCurrentAcceleration.md +++ /dev/null @@ -1,87 +0,0 @@ -accelerometer.getCurrentAcceleration -==================================== - -Get the current acceleration along the x, y, and z axis. - - navigator.accelerometer.getCurrentAcceleration(accelerometerSuccess, accelerometerError); - -Description ------------ - -The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current device orientation. The accelerometer can detect 3D movement along the x, y, and z axis. - -The acceleration is returned using the `accelerometerSuccess` callback function. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iPhone - -Quick Example -------------- - - function onSuccess(acceleration) { - alert('Acceleration X: ' + acceleration.x + '\n' + - 'Acceleration Y: ' + acceleration.y + '\n' + - 'Acceleration Z: ' + acceleration.z + '\n' + - 'Timestamp: ' + acceleration.timestamp + '\n'); - }; - - function onError() { - alert('onError!'); - }; - - navigator.accelerometer.getCurrentAcceleration(onSuccess, onError); - -Full Example ------------- - - - - - Acceleration Example - - - - - -

Example

-

getCurrentAcceleration

- - - -iPhone Quirks -------------- - -- iPhone doesn't have the concept of getting the current acceleration at any given point. -- You must watch the acceleration and capture the data at given time intervals. -- Thus, the `getCurrentAcceleration` function will give you the last value reported from a Cordova `watchAccelerometer` call. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/accelerometer.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/accelerometer.md b/docs/en/edge/phonegap/accelerometer/accelerometer.md deleted file mode 100644 index ccb6812..0000000 --- a/docs/en/edge/phonegap/accelerometer/accelerometer.md +++ /dev/null @@ -1,23 +0,0 @@ -Accelerometer -============= - -> Captures device motion in the x, y, and z direction. - -Methods -------- - -- accelerometer.getCurrentAcceleration -- accelerometer.watchAcceleration -- accelerometer.clearWatch - -Arguments ---------- - -- accelerometerSuccess -- accelerometerError -- accelerometerOptions - -Objects (Read-Only) -------------------- - -- Acceleration \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/accelerometer.watchAcceleration.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/accelerometer.watchAcceleration.md b/docs/en/edge/phonegap/accelerometer/accelerometer.watchAcceleration.md deleted file mode 100644 index 4bc2484..0000000 --- a/docs/en/edge/phonegap/accelerometer/accelerometer.watchAcceleration.md +++ /dev/null @@ -1,116 +0,0 @@ -accelerometer.watchAcceleration -=============================== - -At a regular interval, get the acceleration along the x, y, and z axis. - - var watchID = navigator.accelerometer.watchAcceleration(accelerometerSuccess, - accelerometerError, - [accelerometerOptions]); - -Description ------------ - -The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis. - -The `accelerometer.watchAcceleration` gets the device's current acceleration at a regular interval. Each time the `Acceleration` is retrieved, the `accelerometerSuccess` callback function is executed. Specify the interval in milliseconds via the `frequency` parameter in the `acceleratorOptions` object. - -The returned watch ID references references the accelerometer watch interval. The watch ID can be used with `accelerometer.clearWatch` to stop watching the accelerometer. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iPhone - - -Quick Example -------------- - - function onSuccess(acceleration) { - alert('Acceleration X: ' + acceleration.x + '\n' + - 'Acceleration Y: ' + acceleration.y + '\n' + - 'Acceleration Z: ' + acceleration.z + '\n' + - 'Timestamp: ' + acceleration.timestamp + '\n'); - }; - - function onError() { - alert('onError!'); - }; - - var options = { frequency: 3000 }; // Update every 3 seconds - - var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); - -Full Example ------------- - - - - - Acceleration Example - - - - - -
Waiting for accelerometer...
- - - - iPhone Quirks -------------- - -- At the interval requested, Cordova will call the success callback function and pass the accelerometer results. -- However, in requests to the device Cordova restricts the interval to minimum of every 40ms and a maximum of every 1000ms. - - For example, if you request an interval of 3 seconds (3000ms), Cordova will request an interval of 1 second from the device but invoke the success callback at the requested interval of 3 seconds. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/parameters/accelerometerError.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/parameters/accelerometerError.md b/docs/en/edge/phonegap/accelerometer/parameters/accelerometerError.md deleted file mode 100644 index 0765bfb..0000000 --- a/docs/en/edge/phonegap/accelerometer/parameters/accelerometerError.md +++ /dev/null @@ -1,8 +0,0 @@ -accelerometerError -================== - -onError callback function for acceleration functions. - - function() { - // Handle the error - } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/parameters/accelerometerOptions.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/parameters/accelerometerOptions.md b/docs/en/edge/phonegap/accelerometer/parameters/accelerometerOptions.md deleted file mode 100644 index 82066ac..0000000 --- a/docs/en/edge/phonegap/accelerometer/parameters/accelerometerOptions.md +++ /dev/null @@ -1,9 +0,0 @@ -accelerometerOptions -==================== - -An optional parameter to customize the retrieval of the accelerometer. - -Options -------- - -- __frequency:__ How often to retrieve the `Acceleration` in milliseconds. _(Number)_ (Default: 10000) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/accelerometer/parameters/accelerometerSuccess.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/accelerometer/parameters/accelerometerSuccess.md b/docs/en/edge/phonegap/accelerometer/parameters/accelerometerSuccess.md deleted file mode 100644 index 23e7a43..0000000 --- a/docs/en/edge/phonegap/accelerometer/parameters/accelerometerSuccess.md +++ /dev/null @@ -1,23 +0,0 @@ -accelerometerSuccess -==================== - -onSuccess callback function that provides the Acceleration information. - - function(acceleration) { - // Do something - } - -Parameters ----------- - -- __acceleration:__ The acceleration at a single moment in time. (Acceleration) - -Example -------- - - function onSuccess(acceleration) { - alert('Acceleration X: ' + acceleration.x + '\n' + - 'Acceleration Y: ' + acceleration.y + '\n' + - 'Acceleration Z: ' + acceleration.z + '\n' + - 'Timestamp: ' + acceleration.timestamp + '\n'); - }; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/camera/camera.getPicture.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/camera/camera.getPicture.md b/docs/en/edge/phonegap/camera/camera.getPicture.md deleted file mode 100644 index 1b13131..0000000 --- a/docs/en/edge/phonegap/camera/camera.getPicture.md +++ /dev/null @@ -1,171 +0,0 @@ -camera.getPicture -================= - -Takes a photo using the camera or retrieves a photo from the device's album. The image is returned as a base64 encoded `String` or as the URI of an image file. - - navigator.camera.getPicture( cameraSuccess, cameraError, [ cameraOptions ] ); - -Description ------------ - -Function `camera.getPicture` opens the device's default camera application so that the user can take a picture (if `Camera.sourceType = Camera.PictureSourceType.CAMERA`, which is the default). Once the photo is taken, the camera application closes and your application is restored. - -If `Camera.sourceType = Camera.PictureSourceType.PHOTOLIBRARY` or `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a photo chooser dialog is shown, from which a photo from the album can be selected. - -The return value will be sent to the `cameraSuccess` function, in one of the following formats, depending on the `cameraOptions` you specify: - -- A `String` containing the Base64 encoded photo image (default). -- A `String` representing the image file location on local storage. - -You can do whatever you want with the encoded image or URI, for example: - -- Render the image in an `` tag _(see example below)_ -- Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc) -- Post the data to a remote server - -Note: The image quality of pictures taken using the camera on newer devices is quite good. _Encoding such images using Base64 has caused memory issues on some of these devices (iPhone 4, BlackBerry Torch 9800)._ Therefore, using FILE_URI as the 'Camera.destinationType' is highly recommended. - -Supported Platforms -------------------- - -- Android -- Blackberry WebWorks (OS 5.0 and higher) -- iPhone -- Windows Phone 7 ( Mango ) - -Quick Example -------------- - -Take photo and retrieve Base64-encoded image: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50 }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - -Take photo and retrieve image file location: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Full Example ------------- - - - - - Capture Photo - - - - - -
-
-
-
- - - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/camera/camera.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/camera/camera.md b/docs/en/edge/phonegap/camera/camera.md deleted file mode 100644 index e8ec1d8..0000000 --- a/docs/en/edge/phonegap/camera/camera.md +++ /dev/null @@ -1,9 +0,0 @@ -Camera -====== - -> The `camera` object provides access to the device's default camera application. - -Methods -------- - -- camera.getPicture \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/camera/parameter/cameraError.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/camera/parameter/cameraError.md b/docs/en/edge/phonegap/camera/parameter/cameraError.md deleted file mode 100644 index cc219eb..0000000 --- a/docs/en/edge/phonegap/camera/parameter/cameraError.md +++ /dev/null @@ -1,13 +0,0 @@ -cameraError -=========== - -onError callback function that provides an error message. - - function(message) { - // Show a helpful message - } - -Parameters ----------- - -- __message:__ The message is provided by the device's native code. (`String`) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/camera/parameter/cameraOptions.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/camera/parameter/cameraOptions.md b/docs/en/edge/phonegap/camera/parameter/cameraOptions.md deleted file mode 100644 index 6c2414b..0000000 --- a/docs/en/edge/phonegap/camera/parameter/cameraOptions.md +++ /dev/null @@ -1,90 +0,0 @@ -cameraOptions -============= - -Optional parameters to customize the camera settings. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100 }; - -Options -------- - -- __quality:__ Quality of saved image. Range is [0, 100]. (`Number`) - -- __destinationType:__ Choose the format of the return value. Defined in navigator.camera.DestinationType (`Number`) - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64 encoded string - FILE_URI : 1 // Return image file URI - }; - -- __sourceType:__ Set the source of the picture. Defined in nagivator.camera.PictureSourceType (`Number`) - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - -- __allowEdit:__ Allow simple editing of image before selection. (`Boolean`) - -- __EncodingType:__ Choose the encoding of the returned image file. Defined in navigator.camera.EncodingType (`Number`) - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - -- __targetWidth:__ Width in pixels to scale image. Must be used with targetHeight. Aspect ratio is maintained. (`Number`) -- __targetHeight:__ Height in pixels to scale image. Must be used with targetWidth. Aspect ratio is maintained. (`Number`) - -- __MediaType:__ Set the type of media to select from. Only works when PictureSourceType is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType (`Number`) - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types -}; - -Android Quirks --------------- - -- Ignores the `allowEdit` parameter. -- Camera.PictureSourceType.PHOTOLIBRARY and Camera.PictureSourceType.SAVEDPHOTOALBUM both display the same photo album. -- Camera.EncodingType is not supported. - -BlackBerry Quirks ------------------ - -- Ignores the `quality` parameter. -- Ignores the `sourceType` parameter. -- Ignores the `allowEdit` parameter. -- Application must have key injection permissions to close native Camera application after photo is taken. -- Using Large image sizes may result in inability to encode image on later model devices with high resolution cameras (e.g. Torch 9800). -- Camera.MediaType is not supported. - -Palm Quirks ------------ - -- Ignores the `quality` parameter. -- Ignores the `sourceType` parameter. -- Ignores the `allowEdit` parameter. -- Camera.MediaType is not supported. - -iPhone Quirks --------------- - -- Set `quality` below 50 to avoid memory error on some devices. -- When `destinationType.FILE_URI` is used, photos are saved in the application's temporary directory. -- The contents of the application's temporary directory is deleted when the application ends. Developers may also delete the contents of this directory using the navigator.fileMgr APIs if storage space is a concern. - -Windows Phone 7 Quirks --------------- - -- Ignores the `allowEdit` parameter. - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/camera/parameter/cameraSuccess.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/camera/parameter/cameraSuccess.md b/docs/en/edge/phonegap/camera/parameter/cameraSuccess.md deleted file mode 100644 index a64a8ef..0000000 --- a/docs/en/edge/phonegap/camera/parameter/cameraSuccess.md +++ /dev/null @@ -1,23 +0,0 @@ -cameraSuccess -============= - -onSuccess callback function that provides the image data. - - function(imageData) { - // Do something with the image - } - -Parameters ----------- - -- __imageData:__ Base64 encoding of the image data, OR the image file URI, depending on `cameraOptions` used. (`String`) - -Example -------- - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/compass.clearWatch.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/compass.clearWatch.md b/docs/en/edge/phonegap/compass/compass.clearWatch.md deleted file mode 100755 index 4422f88..0000000 --- a/docs/en/edge/phonegap/compass/compass.clearWatch.md +++ /dev/null @@ -1,90 +0,0 @@ -compass.clearWatch -======================== - -Stop watching the compass referenced by the watch ID parameter. - - navigator.compass.clearWatch(watchID); - -- __watchID__: The ID returned by `compass.watchHeading`. - -Supported Platforms -------------------- - -- Android -- iPhone -- Windows Phone 7 ( Mango ) if available in hardware - -Quick Example -------------- - - var watchID = navigator.compass.watchHeading(onSuccess, onError, options); - - // ... later on ... - - navigator.compass.clearWatch(watchID); - -Full Example ------------- - - - - - Compass Example - - - - - -
Waiting for heading...
- - - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/compass.clearWatchFilter.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/compass.clearWatchFilter.md b/docs/en/edge/phonegap/compass/compass.clearWatchFilter.md deleted file mode 100644 index 44d200f..0000000 --- a/docs/en/edge/phonegap/compass/compass.clearWatchFilter.md +++ /dev/null @@ -1,88 +0,0 @@ -compass.clearWatchFilter -======================== - -Stop watching the compass referenced by the watch ID parameter. - - navigator.compass.clearWatchFilter(watchID); - -- __watchID__: The ID returned by `compass.watchHeadingFilter`. - -Supported Platforms -------------------- - -- iPhone - -Quick Example -------------- - - var watchID = navigator.compass.watchHeadingFilter(onSuccess, onError, options); - - // ... later on ... - - navigator.compass.clearWatchFilter(watchID); - -Full Example ------------- - - - - - Compass Example - - - - - -
Waiting for heading...
- - - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/compass.getCurrentHeading.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/compass.getCurrentHeading.md b/docs/en/edge/phonegap/compass/compass.getCurrentHeading.md deleted file mode 100755 index 940955c..0000000 --- a/docs/en/edge/phonegap/compass/compass.getCurrentHeading.md +++ /dev/null @@ -1,75 +0,0 @@ -compass.getCurrentHeading -========================= - -Get the current compass heading. - - navigator.compass.getCurrentHeading(compassSuccess, compassError, compassOptions); - -Description ------------ - -The compass is a sensor that detects the direction or heading that the device is pointed. It measures the heading in degrees from 0 to 359.99. - -The compass heading information is returned via a CompassHeading object using the `compassSuccess` callback function. - -Supported Platforms -------------------- - -- Android -- iPhone -- Windows Phone 7 ( Mango ) if available in hardware - -Quick Example -------------- - - function onSuccess(heading) { - alert('Heading: ' + heading.magneticHeading); - }; - - function onError(error) { - alert('CompassError: ' error.code); - }; - - navigator.compass.getCurrentHeading(onSuccess, onError); - -Full Example ------------- - - - - - Compass Example - - - - - -

Example

-

getCurrentHeading

- - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/compass.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/compass.md b/docs/en/edge/phonegap/compass/compass.md deleted file mode 100755 index 82470c5..0000000 --- a/docs/en/edge/phonegap/compass/compass.md +++ /dev/null @@ -1,21 +0,0 @@ -Compass -======= - -> Obtains the direction that the device is pointing. - -Methods -------- - -- compass.getCurrentHeading -- compass.watchHeading -- compass.clearWatch -- compass.watchHeadingFilter -- compass.clearWatchFilter - -Arguments ---------- - -- compassSuccess -- compassError -- compassOptions -- compassHeading http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/compass.watchHeading.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/compass.watchHeading.md b/docs/en/edge/phonegap/compass/compass.watchHeading.md deleted file mode 100755 index 71c9170..0000000 --- a/docs/en/edge/phonegap/compass/compass.watchHeading.md +++ /dev/null @@ -1,105 +0,0 @@ -compass.watchHeading -==================== - -At a regular interval, get the compass heading in degrees. - - var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]); - -Description ------------ - -The compass is a sensor that detects the direction or heading that the device is pointed. It measures the heading in degrees from 0 to 359.99. - -The `compass.watchHeading` gets the device's current heading at a regular interval. Each time the heading is retrieved, the `headingSuccess` callback function is executed. Specify the interval in milliseconds via the `frequency` parameter in the `compassOptions` object. - -The returned watch ID references references the compass watch interval. The watch ID can be used with `compass.clearWatch` to stop watching the compass. - -Supported Platforms -------------------- - -- Android -- iPhone -- Windows Phone 7 ( Mango ) if available in hardware - - -Quick Example -------------- - - function onSuccess(heading) { - var element = document.getElementById('heading'); - element.innerHTML = 'Heading: ' + heading.magneticHeading; - }; - - function onError(compassError) { - alert('Compass error: ' + compassError.code); - }; - - var options = { frequency: 3000 }; // Update every 3 seconds - - var watchID = navigator.compass.watchHeading(onSuccess, onError, options); - -Full Example ------------- - - - - - Compass Example - - - - - -
Waiting for heading...
- - - - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/compass.watchHeadingFilter.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/compass.watchHeadingFilter.md b/docs/en/edge/phonegap/compass/compass.watchHeadingFilter.md deleted file mode 100644 index 2333d8f..0000000 --- a/docs/en/edge/phonegap/compass/compass.watchHeadingFilter.md +++ /dev/null @@ -1,103 +0,0 @@ -compass.watchHeadingFilter -========================== - -Get the compass heading in degrees when it changes by at least a certain number of degrees. - - var watchID = navigator.compass.watchHeadingFilter(compassSuccess, compassError, compassOptions); - -Description ------------ - -The compass is a sensor that detects the direction or heading that the device is pointed. It measures the heading in degrees from 0 to 359.99. - -The `compass.watchHeadingFilter` gets the device's current heading when it changes by a specified number of degrees. Each time the heading changes by the specified number of degrees or more, the `headingSuccess` callback function is called. Specify the degrees of change via the `filter` parameter in the `compassOptions` object. - -The returned watch ID references references the compass watch interval. The watch ID can be used with `compass.clearWatchFilter` to stop watching the compass via a degree filter. Only one watchHeadingFilter can be in effect at one time. If a watchHeadingFilter is in effect, calling getCurrentHeading or watchHeading will use the existing filter value for specifying heading changes. On iOS this method is more efficient than compass.watchFilter() based on the iOS mechanism for monitoring compass heading changes. - -Supported Platforms -------------------- - -- iPhone - - -Quick Example -------------- - - function onSuccess(heading) { - var element = document.getElementById('heading'); - element.innerHTML = 'Heading: ' + heading.magneticHeading; - }; - - function onError(compassError) { - alert('Compass error: ' + compassError.code); - }; - - var options = { filter: 10 }; // Get notified on compass heading changes or 10 degrees or more - - var watchID = navigator.compass.watchHeadingFilter(onSuccess, onError, options); - -Full Example ------------- - - - - - Compass Example - - - - - -
Waiting for heading...
- - - - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/compassError/compassError.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/compassError/compassError.md b/docs/en/edge/phonegap/compass/compassError/compassError.md deleted file mode 100644 index 2e1a24d..0000000 --- a/docs/en/edge/phonegap/compass/compassError/compassError.md +++ /dev/null @@ -1,21 +0,0 @@ -CompassError -========== - -A `CompassError` object is returned to the `compassError` callback function when an error occurs. - -Properties ----------- - -- __code:__ One of the predefined error codes listed below. - -Constants ---------- -- `CompassError.COMPASS_INTERNAL_ERR` -- `CompassError.COMPASS_NOT_SUPPORTED` - -Description ------------ - -The `CompassError` object is returned to the user through the `compassError` callback function when an error occurs. - - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/parameters/compassError.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/parameters/compassError.md b/docs/en/edge/phonegap/compass/parameters/compassError.md deleted file mode 100755 index c150f29..0000000 --- a/docs/en/edge/phonegap/compass/parameters/compassError.md +++ /dev/null @@ -1,11 +0,0 @@ -compassError -========== - -onError callback function for compass functions. - -Example -------- - -function(CompassError) { - // Handle the error -} http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/parameters/compassHeading.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/parameters/compassHeading.md b/docs/en/edge/phonegap/compass/parameters/compassHeading.md deleted file mode 100644 index 4557e57..0000000 --- a/docs/en/edge/phonegap/compass/parameters/compassHeading.md +++ /dev/null @@ -1,33 +0,0 @@ -compassHeading -========== - -A `CompassHeading` object is returned to the `compassSuccess` callback function when an error occurs. - -Properties ----------- -- __magneticHeading:__ The heading in degrees from 0 - 359.99 at a single moment in time. _(Number)_ -- __trueHeading:__ The heading relative to the geographic North Pole in degrees 0 - 359.99 at a single moment in time. A negative value indicates that the true heading could not be determined. _(Number)_ -- __headingAccuracy:__ The deviation in degrees between the reported heading and the true heading. _(Number)_ -- __timestamp:__ The time at which this heading was determined. _(milliseconds)_ - -Description ------------ - -The `CompassHeading` object is returned to the user through the `compassSuccess` callback function. - -Android Quirks --------------- -- trueHeading is not supported. It will report the same value as magneticHeading -- headingAccuracy will always be 0 as there is no difference between the magneticHeading and trueHeading on Android. - -iOS Quirks ----------- - -- trueHeading is only returned when location services are running via `navigator.geolocation.watchLocation()` -- For iOS > 4 devices, if the device is rotated and the app supports that orientation, the heading values will be reported -back with respect to the current orientation. - -Windows Phone 7 Quirks -------------- - -- returns trueHeading only, note that this code is largely untested because of a lack of devices that support compass. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/parameters/compassOptions.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/parameters/compassOptions.md b/docs/en/edge/phonegap/compass/parameters/compassOptions.md deleted file mode 100755 index 38e8bda..0000000 --- a/docs/en/edge/phonegap/compass/parameters/compassOptions.md +++ /dev/null @@ -1,19 +0,0 @@ -compassOptions -============== - -An optional parameter to customize the retrieval of the compass. - -Options -------- - -- __frequency:__ How often to retrieve the compass heading in milliseconds. _(Number)_ (Default: 100) -- __filter:__ The change in degrees required to initiate a watchHeadingFilter success callback. _(Number)_ - -Android Quirks -______________ -- filter is not supported. - -Windows Phone 7 Quirks --------------- - -- filter is not supported. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/compass/parameters/compassSuccess.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/compass/parameters/compassSuccess.md b/docs/en/edge/phonegap/compass/parameters/compassSuccess.md deleted file mode 100644 index 9e12a64..0000000 --- a/docs/en/edge/phonegap/compass/parameters/compassSuccess.md +++ /dev/null @@ -1,21 +0,0 @@ -compassSuccess -============== - -onSuccess callback function that provides the compass heading information via a compassHeading object. - - function(heading) { - // Do something - } - -Parameters ----------- - - -- __heading:__ The heading information. _(compassHeading)_ - -Example -------- - - function onSuccess(heading) { - alert('Heading: ' + heading.magneticHeading); - }; http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/connection/connection.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/connection/connection.md b/docs/en/edge/phonegap/connection/connection.md deleted file mode 100644 index 1702e96..0000000 --- a/docs/en/edge/phonegap/connection/connection.md +++ /dev/null @@ -1,23 +0,0 @@ -Connection -========== - -> The `connection` object gives access to the device's cellular and wifi connection information. - -This object is accessed under the navigator.network interface. - -Properties ----------- - -- connection.type - -Constants ---------- - -- Connection.UNKNOWN -- Connection.ETHERNET -- Connection.WIFI -- Connection.CELL_2G -- Connection.CELL_3G -- Connection.CELL_4G -- Connection.NONE - http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/e9b00f53/docs/en/edge/phonegap/connection/connection.type.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/connection/connection.type.md b/docs/en/edge/phonegap/connection/connection.type.md deleted file mode 100644 index 6155894..0000000 --- a/docs/en/edge/phonegap/connection/connection.type.md +++ /dev/null @@ -1,82 +0,0 @@ -connection.type -=================== - -Checks the active network connection that is being used. - -Description ------------ - -This property is a fast way to determine the device's network connection state, and type of connection. - - -Supported Platforms -------------------- - -- iOS -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- Windows Phone 7 ( Mango ) - -Quick Example -------------- - - function checkConnection() { - var networkState = navigator.network.connection.type; - - var states = {}; - states[Connection.UNKNOWN] = 'Unknown connection'; - states[Connection.ETHERNET] = 'Ethernet connection'; - states[Connection.WIFI] = 'WiFi connection'; - states[Connection.CELL_2G] = 'Cell 2G connection'; - states[Connection.CELL_3G] = 'Cell 3G connection'; - states[Connection.CELL_4G] = 'Cell 4G connection'; - states[Connection.NONE] = 'No network connection'; - - alert('Connection type: ' + states[networkState]); - } - - checkConnection(); - - -Full Example ------------- - - - - - navigator.network.connection.type Example - - - - - -

A dialog box will report the network state.

- -