Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B0FDFA15 for ; Fri, 31 May 2013 17:58:29 +0000 (UTC) Received: (qmail 23005 invoked by uid 500); 31 May 2013 17:58:29 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 22958 invoked by uid 500); 31 May 2013 17:58:28 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 22902 invoked by uid 99); 31 May 2013 17:58:28 -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, 31 May 2013 17:58:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7E54489ED89; Fri, 31 May 2013 17:58:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Fri, 31 May 2013 17:58:42 -0000 Message-Id: <509e61bf663346adaeb64853f4bf2d91@git.apache.org> In-Reply-To: <8f63d0f76bdf4c9b91a683d7e5cb4c9a@git.apache.org> References: <8f63d0f76bdf4c9b91a683d7e5cb4c9a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [16/23] updated version http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/localstorage/localstorage.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/localstorage/localstorage.md b/docs/en/2.8.0rc1/cordova/storage/localstorage/localstorage.md new file mode 100644 index 0000000..99793e1 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/localstorage/localstorage.md @@ -0,0 +1,121 @@ +--- +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. +--- + +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. + +Note: window.sessionStorage provides the same interface, but is cleared between app launches. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 and higher) +- iPhone +- Windows Phone 7 and 8 +- webOS +- Tizen + +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 +------------ + + + + + Storage Example + + + + + +

Example

+

localStorage

+ + + + +Windows Phone 7 Quirks +------------- + +- dot notation is NOT available on Windows Phone 7. Be sure to use : window.localStorage.setItem/getItem, and not the w3 spec defined calls to window.localStorage.someKey = 'someValue'; http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/parameters/display_name.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/parameters/display_name.md b/docs/en/2.8.0rc1/cordova/storage/parameters/display_name.md new file mode 100644 index 0000000..69af089 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/parameters/display_name.md @@ -0,0 +1,23 @@ +--- +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. +--- + +database_displayname +================== + +The display name of the database. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/parameters/name.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/parameters/name.md b/docs/en/2.8.0rc1/cordova/storage/parameters/name.md new file mode 100644 index 0000000..c39dcbf --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/parameters/name.md @@ -0,0 +1,23 @@ +--- +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. +--- + +database_name +============ + +The name of the database. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/parameters/size.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/parameters/size.md b/docs/en/2.8.0rc1/cordova/storage/parameters/size.md new file mode 100644 index 0000000..9b46993 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/parameters/size.md @@ -0,0 +1,23 @@ +--- +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. +--- + +database_size +============== + +The size of the database in bytes. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/parameters/version.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/parameters/version.md b/docs/en/2.8.0rc1/cordova/storage/parameters/version.md new file mode 100644 index 0000000..2e72923 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/parameters/version.md @@ -0,0 +1,23 @@ +--- +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. +--- + +database_version +============= + +The version of the database. http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/sqlerror/sqlerror.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/sqlerror/sqlerror.md b/docs/en/2.8.0rc1/cordova/storage/sqlerror/sqlerror.md new file mode 100644 index 0000000..b700222 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/sqlerror/sqlerror.md @@ -0,0 +1,47 @@ +--- +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. +--- + +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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/sqlresultset/sqlresultset.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/sqlresultset/sqlresultset.md b/docs/en/2.8.0rc1/cordova/storage/sqlresultset/sqlresultset.md new file mode 100644 index 0000000..3060482 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/sqlresultset/sqlresultset.md @@ -0,0 +1,140 @@ +--- +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. +--- + +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 +- __rowsAffected__: 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 its 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 `rowsAffected` 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 +- webOS +- Tizen + +Execute SQL Quick Example +------------------ + + function queryDB(tx) { + tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB); + } + + function querySuccess(tx, results) { + console.log("Returned rows = " + results.rows.length); + // this will be true since it was a select statement and so rowsAffected was 0 + if (!results.rowsAffected) { + console.log('No rows affected!'); + return false; + } + // for an insert statement, this property will return the ID of the last inserted row + console.log("Last inserted row ID = " + results.insertId); + } + + 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 +------------ + + + + + Storage Example + + + + + +

Example

+

Database

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md b/docs/en/2.8.0rc1/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md new file mode 100644 index 0000000..02b7b28 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md @@ -0,0 +1,137 @@ +--- +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. +--- + +SQLResultSetRowList +======= + +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 SQLResultSetRowList 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 specifying 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 +- webOS +- Tizen + +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 + + + Storage Example + + + + + +

Example

+

Database

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/sqltransaction/sqltransaction.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/sqltransaction/sqltransaction.md b/docs/en/2.8.0rc1/cordova/storage/sqltransaction/sqltransaction.md new file mode 100644 index 0000000..b186767 --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/sqltransaction/sqltransaction.md @@ -0,0 +1,114 @@ +--- +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. +--- + +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 +- webOS +- Tizen + +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 +------------ + + + + + Storage Example + + + + + +

Example

+

SQLTransaction

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/storage.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/storage.md b/docs/en/2.8.0rc1/cordova/storage/storage.md new file mode 100644 index 0000000..d2ecc6c --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/storage.md @@ -0,0 +1,83 @@ +--- +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. +--- + +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 +- SQLResultSetRowList +- SQLError +- localStorage + +Permissions +----------- + +### Android + +#### app/res/xml/config.xml + + + +### Bada + + No permissions are required. + +### BlackBerry WebWorks + +#### www/config.xml + + + +### iOS + + No permissions are required. + +### webOS + + No permissions are required. + +### Windows Phone + + No permissions are required. + +### Tizen + + No permissions are required. http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/cordova/storage/storage.opendatabase.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/cordova/storage/storage.opendatabase.md b/docs/en/2.8.0rc1/cordova/storage/storage.opendatabase.md new file mode 100644 index 0000000..63c787a --- /dev/null +++ b/docs/en/2.8.0rc1/cordova/storage/storage.opendatabase.md @@ -0,0 +1,75 @@ +--- +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. +--- + +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 +- webOS +- Tizen + +Quick Example +------------- + + var db = window.openDatabase("test", "1.0", "Test DB", 1000000); + +Full Example +------------ + + + + + Storage Example + + + + + +

Example

+

Open Database

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/config.json ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/config.json b/docs/en/2.8.0rc1/edge/config.json new file mode 100644 index 0000000..6a62799 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/config.json @@ -0,0 +1,200 @@ +{ + "language": "English", + "merge": { + "accelerometer.md": [ + "cordova/accelerometer/accelerometer.md", + "cordova/accelerometer/accelerometer.getCurrentAcceleration.md", + "cordova/accelerometer/accelerometer.watchAcceleration.md", + "cordova/accelerometer/accelerometer.clearWatch.md", + "cordova/accelerometer/acceleration/acceleration.md", + "cordova/accelerometer/parameters/accelerometerSuccess.md", + "cordova/accelerometer/parameters/accelerometerError.md", + "cordova/accelerometer/parameters/accelerometerOptions.md" + ], + "camera.md": [ + "cordova/camera/camera.md", + "cordova/camera/camera.getPicture.md", + "cordova/camera/parameter/cameraSuccess.md", + "cordova/camera/parameter/cameraError.md", + "cordova/camera/parameter/cameraOptions.md", + "cordova/camera/parameter/CameraPopoverOptions.md", + "cordova/camera/parameter/CameraPopoverHandle.md" + ], + "capture.md": [ + "cordova/media/capture/capture.md", + "cordova/media/capture/captureAudio.md", + "cordova/media/capture/captureAudioOptions.md", + "cordova/media/capture/captureImage.md", + "cordova/media/capture/captureImageOptions.md", + "cordova/media/capture/captureVideo.md", + "cordova/media/capture/captureVideoOptions.md", + "cordova/media/capture/CaptureError.md", + "cordova/media/capture/CaptureCB.md", + "cordova/media/capture/CaptureErrorCB.md", + "cordova/media/capture/ConfigurationData.md", + "cordova/media/capture/MediaFile.md", + "cordova/media/capture/MediaFile.getFormatData.md", + "cordova/media/capture/MediaFileData.md" + ], + "compass.md": [ + "cordova/compass/compass.md", + "cordova/compass/compass.getCurrentHeading.md", + "cordova/compass/compass.watchHeading.md", + "cordova/compass/compass.clearWatch.md", + "cordova/compass/compass.watchHeadingFilter.md", + "cordova/compass/compass.clearWatchFilter.md", + "cordova/compass/parameters/compassSuccess.md", + "cordova/compass/parameters/compassError.md", + "cordova/compass/parameters/compassOptions.md", + "cordova/compass/parameters/compassHeading.md", + "cordova/compass/compassError/compassError.md" + ], + "contacts.md": [ + "cordova/contacts/contacts.md", + "cordova/contacts/contacts.create.md", + "cordova/contacts/contacts.find.md", + "cordova/contacts/Contact/contact.md", + "cordova/contacts/ContactAddress/contactaddress.md", + "cordova/contacts/ContactField/contactfield.md", + "cordova/contacts/ContactFindOptions/contactfindoptions.md", + "cordova/contacts/ContactName/contactname.md", + "cordova/contacts/ContactOrganization/contactorganization.md", + "cordova/contacts/ContactError/contactError.md", + "cordova/contacts/parameters/contactSuccess.md", + "cordova/contacts/parameters/contactError.md", + "cordova/contacts/parameters/contactFields.md", + "cordova/contacts/parameters/contactFindOptions.md" + ], + "device.md": [ + "cordova/device/device.md", + "cordova/device/device.name.md", + "cordova/device/device.cordova.md", + "cordova/device/device.platform.md", + "cordova/device/device.uuid.md", + "cordova/device/device.version.md" + ], + "events.md": [ + "cordova/events/events.md", + "cordova/events/events.deviceready.md", + "cordova/events/events.pause.md", + "cordova/events/events.resume.md", + "cordova/events/events.online.md", + "cordova/events/events.offline.md", + "cordova/events/events.backbutton.md", + "cordova/events/events.batterycritical.md", + "cordova/events/events.batterylow.md", + "cordova/events/events.batterystatus.md", + "cordova/events/events.menubutton.md", + "cordova/events/events.searchbutton.md", + "cordova/events/events.startcallbutton.md", + "cordova/events/events.endcallbutton.md", + "cordova/events/events.volumedownbutton.md", + "cordova/events/events.volumeupbutton.md" + ], + "file.md": [ + "cordova/file/file.md", + "cordova/file/fileobj/fileobj.md", + "cordova/file/filereader/filereader.md", + "cordova/file/filewriter/filewriter.md", + "cordova/file/filesystem/filesystem.md", + "cordova/file/fileentry/fileentry.md", + "cordova/file/directoryentry/directoryentry.md", + "cordova/file/directoryreader/directoryreader.md", + "cordova/file/filetransfer/filetransfer.md", + "cordova/file/fileuploadoptions/fileuploadoptions.md", + "cordova/file/fileuploadresult/fileuploadresult.md", + "cordova/file/flags/flags.md", + "cordova/file/localfilesystem/localfilesystem.md", + "cordova/file/metadata/metadata.md", + "cordova/file/fileerror/fileerror.md", + "cordova/file/filetransfererror/filetransfererror.md" + ], + "geolocation.md": [ + "cordova/geolocation/geolocation.md", + "cordova/geolocation/geolocation.getCurrentPosition.md", + "cordova/geolocation/geolocation.watchPosition.md", + "cordova/geolocation/geolocation.clearWatch.md", + "cordova/geolocation/Coordinates/coordinates.md", + "cordova/geolocation/Position/position.md", + "cordova/geolocation/PositionError/positionError.md", + "cordova/geolocation/parameters/geolocationSuccess.md", + "cordova/geolocation/parameters/geolocationError.md", + "cordova/geolocation/parameters/geolocation.options.md" + ], + "globalization.md": [ + "cordova/globalization/globalization.md", + "cordova/globalization/globalization.getPreferredLanguage.md", + "cordova/globalization/globalization.getLocaleName.md", + "cordova/globalization/globalization.dateToString.md", + "cordova/globalization/globalization.stringToDate.md", + "cordova/globalization/globalization.getDatePattern.md", + "cordova/globalization/globalization.getDateNames.md", + "cordova/globalization/globalization.isDayLightSavingsTime.md", + "cordova/globalization/globalization.getFirstDayOfWeek.md", + "cordova/globalization/globalization.numberToString.md", + "cordova/globalization/globalization.stringToNumber.md", + "cordova/globalization/globalization.getNumberPattern.md", + "cordova/globalization/globalization.getCurrencyPattern.md", + "cordova/globalization/GlobalizationError/globalizationerror.md" + ], + "media.md": [ + "cordova/media/media.md", + "cordova/media/media.getCurrentPosition.md", + "cordova/media/media.getDuration.md", + "cordova/media/media.pause.md", + "cordova/media/media.play.md", + "cordova/media/media.release.md", + "cordova/media/media.seekTo.md", + "cordova/media/media.setVolume.md", + "cordova/media/media.startRecord.md", + "cordova/media/media.stop.md", + "cordova/media/media.stopRecord.md", + "cordova/media/MediaError/mediaError.md", + "cordova/media/Parameters/mediaError.md" + ], + "network.md": [ + "cordova/network/network.md", + "cordova/network/network.isReachable.md", + "cordova/network/NetworkStatus/NetworkStatus.md", + "cordova/network/parameters/reachableCallback.md", + "cordova/network/parameters/reachableHostname.md", + "cordova/network/parameters/reachableOptions.md" + ], + "connection.md": [ + "cordova/connection/connection.md", + "cordova/connection/connection.type.md" + ], + "notification.md": [ + "cordova/notification/notification.md", + "cordova/notification/notification.alert.md", + "cordova/notification/notification.confirm.md", + "cordova/notification/notification.prompt.md", + "cordova/notification/notification.beep.md", + "cordova/notification/notification.vibrate.md" + ], + "splashscreen.md": [ + "cordova/splashscreen/splashscreen.md", + "cordova/splashscreen/splashscreen.show.md", + "cordova/splashscreen/splashscreen.hide.md" + ], + "storage.md": [ + "cordova/storage/storage.md", + "cordova/storage/storage.opendatabase.md", + "cordova/storage/parameters/name.md", + "cordova/storage/parameters/version.md", + "cordova/storage/parameters/display_name.md", + "cordova/storage/parameters/size.md", + "cordova/storage/database/database.md", + "cordova/storage/sqltransaction/sqltransaction.md", + "cordova/storage/sqlresultset/sqlresultset.md", + "cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md", + "cordova/storage/sqlerror/sqlerror.md", + "cordova/storage/localstorage/localstorage.md" + ], + "inappbrowser.md": [ + "cordova/inappbrowser/inappbrowser.md", + "cordova/inappbrowser/window.open.md" + ] + + } +} http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/acceleration/acceleration.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/acceleration/acceleration.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/acceleration/acceleration.md new file mode 100644 index 0000000..9b81fe8 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/acceleration/acceleration.md @@ -0,0 +1,109 @@ +--- +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. +--- + +Acceleration +============ + +Contains `Accelerometer` data captured at a specific point in time. + +Properties +---------- + +- __x:__ Amount of acceleration on the x-axis. (in m/s^2) (`Number`) +- __y:__ Amount of acceleration on the y-axis. (in m/s^2) (`Number`) +- __z:__ Amount of acceleration on the z-axis. (in m/s^2) (`Number`) +- __timestamp:__ Creation timestamp in milliseconds. (`DOMTimeStamp`) + +Description +----------- + +This object is created and populated by Cordova, and returned by an `Accelerometer` method. The x, y, z acceleration values include the effect of gravity (9.81 m/s^2), so at when a device is lying flat on a table facing up, the value returned should be x=0, y=0, z=9.81. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS +- Windows Phone 7 and 8 +- Bada 1.2 & 2.x +- webOS +- Tizen +- Windows 8 + + +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

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.clearWatch.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.clearWatch.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.clearWatch.md new file mode 100644 index 0000000..54e34fe --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.clearWatch.md @@ -0,0 +1,114 @@ +--- +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. +--- + +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 +- Windows Phone 7 and 8 +- Bada 1.2 & 2.x +- Tizen +- Windows 8 + +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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.getCurrentAcceleration.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.getCurrentAcceleration.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.getCurrentAcceleration.md new file mode 100644 index 0000000..ba2c701 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.getCurrentAcceleration.md @@ -0,0 +1,110 @@ +--- +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. +--- + +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 +- Windows Phone 7 and 8 +- Bada 1.2 & 2.x +- Tizen +- Windows 8 + +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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.md new file mode 100644 index 0000000..3f68d04 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.md @@ -0,0 +1,90 @@ +--- +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. +--- + +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 + +Permissions +----------- + +### Android + +#### app/res/xml/config.xml + + + +### Bada + + No permissions are required. + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + +### iOS + +#### config.xml + + + +### webOS + + No permissions are required. + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + +Reference: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + + No permissions are required. http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.watchAcceleration.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.watchAcceleration.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.watchAcceleration.md new file mode 100644 index 0000000..985105a --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/accelerometer.watchAcceleration.md @@ -0,0 +1,138 @@ +--- +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. +--- + +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 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 +- Windows Phone 7 and 8 +- Bada 1.2 & 2.x +- Tizen +- Windows 8 + +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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerError.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerError.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerError.md new file mode 100644 index 0000000..c908c16 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerError.md @@ -0,0 +1,27 @@ +--- +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. +--- + +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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerOptions.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerOptions.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerOptions.md new file mode 100644 index 0000000..197f416 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerOptions.md @@ -0,0 +1,28 @@ +--- +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. +--- + +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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerSuccess.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerSuccess.md b/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerSuccess.md new file mode 100644 index 0000000..277fca8 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/accelerometer/parameters/accelerometerSuccess.md @@ -0,0 +1,42 @@ +--- +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. +--- + +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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/camera/camera.cleanup.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/camera/camera.cleanup.md b/docs/en/2.8.0rc1/edge/cordova/camera/camera.cleanup.md new file mode 100644 index 0000000..fbf9e13 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/camera/camera.cleanup.md @@ -0,0 +1,50 @@ +--- +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. +--- + +camera.cleanup +================= + +Cleans up the image files that were taken by the camera, that were stored in a temporary storage location. + + navigator.camera.cleanup( cameraSuccess, cameraError ); + +Description +----------- + +Cleans up the image files stored in the temporary storage location, when the function `camera.getPicture` is used with `Camera.sourceType = Camera.PictureSourceType.CAMERA` and `Camera.destinationType = Camera.DestinationType.FILE_URI` + + +Supported Platforms +------------------- + +- iOS + + +Example +------------- + + navigator.camera.cleanup(onSuccess, onFail); + + function onSuccess() { + console.log("Camera cleanup success.") + } + + function onFail(message) { + alert('Failed because: ' + message); + } http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/camera/camera.getPicture.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/camera/camera.getPicture.md b/docs/en/2.8.0rc1/edge/cordova/camera/camera.getPicture.md new file mode 100644 index 0000000..181bb87 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/camera/camera.getPicture.md @@ -0,0 +1,220 @@ +--- +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. +--- + +camera.getPicture +================= + +Takes a photo using the camera or retrieves a photo from the device's album. +The image is passed to the success callback as a base64 encoded `String` or as the URI of an image file. +The method itself returns a CameraPopoverHandle object, which can be used to reposition the file selection popover. + + 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. A `CameraPopoverHandle` object, which can be used to reposition the photo chooser dialog (eg. when the device orientation changes) is returned by `camera.getPicture`. + +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. +- A `String` representing the image file location on local storage (default). + +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, and images from the Photo Album will not be downscaled to a lower quality, even if a quality parameter is specified. ___Encoding such images using Base64 has caused memory issues on many newer devices. Therefore, using FILE\_URI as the 'Camera.destinationType' is highly recommended.___ + +Supported Platforms +------------------- + +- Android +- Blackberry WebWorks (OS 5.0 and higher) +- iOS +- Windows Phone 7 and 8 +- Bada 1.2 +- webOS +- Tizen +- Windows 8 + +iOS Quirks +---------- + +Including a JavaScript alert() in either of the callback functions can cause problems. Wrap the alert in a setTimeout() to allow the iOS image picker or popover to fully close before the alert is displayed: + + setTimeout(function() { + // do your thing here! + }, 0); + +Windows Phone 7 Quirks +---------------------- + +Invoking the native camera application while your device is connected +via Zune will not work, and the error callback will be triggered. + +Tizen Quirks +---------------------- + +Only 'destinationType: Camera.DestinationType.FILE_URI' and 'sourceType: Camera.PictureSourceType.PHOTOLIBRARY' are supported. + +Quick Example +------------- + +Take photo and retrieve Base64-encoded image: + + navigator.camera.getPicture(onSuccess, onFail, { quality: 50, + destinationType: Camera.DestinationType.DATA_URL + }); + + 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/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/camera/camera.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/camera/camera.md b/docs/en/2.8.0rc1/edge/cordova/camera/camera.md new file mode 100644 index 0000000..5ec1f4e --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/camera/camera.md @@ -0,0 +1,99 @@ +--- +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. +--- + +Camera +====== + +> The `camera` object provides access to the device's default camera application. + +**Important privacy note:** Collection and use of images from a device's camera raises important privacy issues. Your app's [privacy policy](guide_getting-started_index.md.html) should discuss how the app uses the camera and whether the images recorded are shared with any other parties. In addition, if the app's use of the camera is not apparent in the user interface, you should provide a just-in-time notice prior to your app accessing the camera (if the device operating system doesn't do so already). That notice should provide the same information noted above, as well as obtaining the user's permission (e.g., by presenting choices for "OK" and "No Thanks"). For more information, please see the Privacy Guide. + +Methods +------- + +- camera.getPicture +- camera.cleanup + +Permissions +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest + + + +### Bada + +#### manifest.xml + + + CAMERA + + + RECORDING + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + + use_camera + + +### iOS + +#### config.xml + + + +### webOS + + No permissions are required. + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + + +Reference: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + +#### config.xml + + + + +Reference: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures) http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverHandle.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverHandle.md b/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverHandle.md new file mode 100644 index 0000000..94ab149 --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverHandle.md @@ -0,0 +1,68 @@ +--- +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. +--- + +CameraPopoverHandle +=================== + +A handle to the popover dialog created by `camera.getPicture`. + +Methods +------- + +- __setPosition:__ Set the position of the popover. + +Supported Platforms +------------------- + +- iOS + +setPosition +----------- + +Set the position of the popover. + +__Parameters:__ +- cameraPopoverOptions - the CameraPopoverOptions specifying the new position + +Quick Example +------------- + + var cameraPopoverOptions = new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); + cameraPopoverHandle.setPosition(cameraPopoverOptions); + +Full Example +------------ + + function onSuccess(imageData) { + // Do stuff with the image! + } + + function onFail(message) { + alert('Failed to get the picture: ' + message); + } + + var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, + { destinationType: Camera.DestinationType.FILE_URI, + sourceType: Camera.PictureSourceType.PHOTOLIBRARY }); + + // Reposition the popover if the orientation changes. + window.onorientationchange = function() { + var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, 0); + cameraPopoverHandle.setPosition(cameraPopoverOptions); + } http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/40331cf8/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverOptions.md ---------------------------------------------------------------------- diff --git a/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverOptions.md b/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverOptions.md new file mode 100644 index 0000000..6314e8a --- /dev/null +++ b/docs/en/2.8.0rc1/edge/cordova/camera/parameter/CameraPopoverOptions.md @@ -0,0 +1,71 @@ +--- +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. +--- + +CameraPopoverOptions +==================== + +Parameters only used by iOS to specify the anchor element location and arrow direction of popover used on iPad when selecting images from the library or album. + + { x : 0, + y : 32, + width : 320, + height : 480, + arrowDir : Camera.PopoverArrowDirection.ARROW_ANY + }; + +CameraPopoverOptions +-------------------- + +- __x:__ x pixel coordinate of element on the screen to anchor popover onto. (`Number`) + +- __y:__ y pixel coordinate of element on the screen to anchor popover onto. (`Number`) + +- __width:__ width, in pixels, of the element on the screen to anchor popover onto. (`Number`) + +- __height:__ height, in pixels, of the element on the screen to anchor popover onto. (`Number`) + +- __arrowDir:__ Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection (`Number`) + + Camera.PopoverArrowDirection = { + ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants + ARROW_DOWN : 2, + ARROW_LEFT : 4, + ARROW_RIGHT : 8, + ARROW_ANY : 15 + }; + +Note that the size of the popover may change to adjust to the direction of the arrow and orientation of the screen. Make sure to account for orientation changes when specifying the anchor element location. + +Quick Example +------------- + + var popover = new CameraPopoverOptions(300,300,100,100,Camera.PopoverArrowDirection.ARROW_ANY); + var options = { quality: 50, destinationType: Camera.DestinationType.DATA_URL,sourceType: Camera.PictureSource.SAVEDPHOTOALBUM, popoverOptions : popover }; + + navigator.camera.getPicture(onSuccess, onFail, options); + + function onSuccess(imageData) { + var image = document.getElementById('myImage'); + image.src = "data:image/jpeg;base64," + imageData; + } + + function onFail(message) { + alert('Failed because: ' + message); + } +