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 81727BD91 for ; Fri, 20 Jan 2012 19:57:29 +0000 (UTC) Received: (qmail 57910 invoked by uid 500); 20 Jan 2012 19:57:29 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 57891 invoked by uid 500); 20 Jan 2012 19:57:29 -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 57884 invoked by uid 99); 20 Jan 2012 19:57:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jan 2012 19:57:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jan 2012 19:57:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D2C03318A2E; Fri, 20 Jan 2012 19:56:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [29/32] Add English version 1.2.0 Message-Id: <20120120195604.D2C03318A2E@tyr.zones.apache.org> Date: Fri, 20 Jan 2012 19:56:04 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/ContactAddress/contactaddress.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/ContactAddress/contactaddress.md b/docs/en/1.2.0/phonegap/contacts/ContactAddress/contactaddress.md new file mode 100644 index 0000000..c84c15a --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/ContactAddress/contactaddress.md @@ -0,0 +1,145 @@ +ContactAddress +============== + +Contains address properties for a `Contact` object. + +Properties +---------- +- __pref:__ Set to `true` if this `ContactAddress` contains the user's preferred value. _(boolean)_ +- __type:__ A string that tells you what type of field this is (example: 'home'). _(DOMString) +- __formatted:__ The full address formatted for display. _(DOMString)_ +- __streetAddress:__ The full street address. _(DOMString)_ +- __locality:__ The city or locality. _(DOMString)_ +- __region:__ The state or region. _(DOMString)_ +- __postalCode:__ The zip code or postal code. _(DOMString)_ +- __country:__ The country name. _(DOMString)_ + +Details +------- + +The `ContactAddress` object stores the properties of a single address of a contact. A `Contact` object can have one or more addresses in a `ContactAddress[]` array. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + // display the address information for all contacts + function onSuccess(contacts) { + for (var i=0; i + + + Contact Example + + + + + +

Example

+

Find Contacts

+ + + +Android 2.X Quirks +------------------ + +- __pref:__ This property is not supported by Android 2.X devices and will always return `false`. + +Android 1.X Quirks +------------------ + +- __pref:__ This property is not supported by Android 1.X devices and will always return `false`. +- __type:__ This property is not supported by Android 1.X devices and will always return `null`. +- __streetAddress:__ This property is not support by Android 1.X devices, and will always return `null`. +- __locality:__ This property is not support by Android 1.X devices, and will always return `null`. +- __region:__ This property is not support by Android 1.X devices, and will always return `null`. +- __postalCode:__ This property is not support by Android 1.X devices, and will always return `null`. +- __country:__ This property is not support by Android 1.X devices, and will always return `null`. + +BlackBerry WebWorks (OS 5.0 and higher) Quirks +-------------------------------------------- +- __pref:__ This property is not supported on Blackberry devices and will always return `false`. +- __type:__ Partially supported. Only one each of "Work" and "Home" type addresses can be stored per contact. +- __formatted:__ Partially supported. Will return concatenation of all BlackBerry address fields. +- __streetAddress:__ Supported. Will return concatenation of BlackBerry __address1__ and __address2__ address fields. +- __locality:__ Supported. Stored in BlackBerry __city__ address field. +- __region:__ Supported. Stored in BlackBerry __stateProvince__ address field. +- __postalCode:__ Supported. Stored in BlackBerry __zipPostal__ address field. +- __country:__ Supported. + +iOS Quirks +---------- +- __pref:__ This property is not supported on iOS devices and will always return `false`. +- __formatted:__ Not currently supported. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/ContactError/contactError.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/ContactError/contactError.md b/docs/en/1.2.0/phonegap/contacts/ContactError/contactError.md new file mode 100644 index 0000000..62bd9fe --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/ContactError/contactError.md @@ -0,0 +1,26 @@ +ContactError +======== + +A `ContactError` object is returned to the `contactError` callback when an error occurs. + +Properties +---------- + +- __code:__ One of the predefined error codes listed below. + +Constants +--------- + +- `ContactError.UNKNOWN_ERROR` +- `ContactError.INVALID_ARGUMENT_ERROR` +- `ContactError.TIMEOUT_ERROR` +- `ContactError.PENDING_OPERATION_ERROR` +- `ContactError.IO_ERROR` +- `ContactError.NOT_SUPPORTED_ERROR` +- `ContactError.PERMISSION_DENIED_ERROR` + +Description +----------- + +The `ContactError` object is returned to the user through the `contactError` callback function when an error occurs. + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/ContactField/contactfield.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/ContactField/contactfield.md b/docs/en/1.2.0/phonegap/contacts/ContactField/contactfield.md new file mode 100644 index 0000000..8eb0a8b --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/ContactField/contactfield.md @@ -0,0 +1,122 @@ +ContactField +============ + +Supports generic fields in a `Contact` object. Some properties that are stored as `ContactField` objects include email addresses, phone numbers, and urls. + +Properties +---------- + +- __type:__ A string that tells you what type of field this is (example: 'home'). _(DOMString)_ +- __value:__ The value of the field (such as a phone number or email address). _(DOMString)_ +- __pref:__ Set to `true` if this `ContactField` contains the user's preferred value. _(boolean)_ + +Details +------- + +The `ContactField` object is a reusable component that is used to support contact fields in a generic fashion. Each `ContactField` object contains a value property, a type property, and a pref property. A `Contact` object stores several properties in `ContactField[]` arrays, such as phone numbers and email addresses. + +In most instances, there are no pre-determined values for the __type__ attribute of a `ContactField` object. For example, a phone number can have __type__ values of 'home', 'work', 'mobile', 'iPhone', or any other value that is supported by the contact database on a particular device platform. However, in the case of the `Contact` __photos__ field, PhoneGap makes use of the __type__ field to indicate the format of the returned image. PhoneGap will return __type: 'url'__ when the __value__ attribute contains a URL to the photo image, or __type: 'base64'__ when the returned __value__ attribute contains a Base64 encoded image string. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + // create a new contact + var contact = navigator.contacts.create(); + + // store contact phone numbers in ContactField[] + var phoneNumbers = [3]; + phoneNumbers[0] = new ContactField('work', '212-555-1234', false); + phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number + phoneNumbers[2] = new ContactField('home', '203-555-7890', false); + contact.phoneNumbers = phoneNumbers; + + // save the contact + contact.save(); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

Find Contacts

+ + + +Android Quirks +-------------- + +- __pref:__ This property is not support by Android devices, and will always return `false`. + +BlackBerry WebWorks (OS 5.0 and higher) Quirks +-------------------------------------------- + +- __type:__ Partially supported. Used for phone numbers. +- __value:__ Supported. +- __pref:__ This property is not supported, and will always return `false`. + +iOS Quirks +----------- +- __pref:__ This property is not supported on iOS devices and will always return `false`. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/ContactFindOptions/contactfindoptions.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/ContactFindOptions/contactfindoptions.md b/docs/en/1.2.0/phonegap/contacts/ContactFindOptions/contactfindoptions.md new file mode 100644 index 0000000..586ba67 --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/ContactFindOptions/contactfindoptions.md @@ -0,0 +1,93 @@ +ContactFindOptions +================== + +Contains properties that can be used to filter the results of a `contacts.find` operation. + +Properties +---------- + +- __filter:__ The search string used to find contacts. _(DOMString)_ (Default: "") +- __multiple:__ Determines if the find operation should return multiple contacts. _(Boolean)_ (Default: false) + + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + // success callback + function onSuccess(contacts) { + for (var i=0; i + + + Contact Example + + + + + +

Example

+

Find Contacts

+ + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/ContactName/contactname.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/ContactName/contactname.md b/docs/en/1.2.0/phonegap/contacts/ContactName/contactname.md new file mode 100644 index 0000000..6399d3d --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/ContactName/contactname.md @@ -0,0 +1,118 @@ +ContactName +=========== + +Contains name properties of a `Contact` object. + +Properties +---------- + +- __formatted:__ The complete name of the contact. _(DOMString)_ +- __familyName:__ The contacts family name. _(DOMString)_ +- __givenName:__ The contacts given name. _(DOMString)_ +- __middleName:__ The contacts middle name. _(DOMString)_ +- __honorificPrefix:__ The contacts prefix (example Mr. or Dr.) _(DOMString)_ +- __honorificSuffix:__ The contacts suffix (example Esq.). _(DOMString)_ + +Details +------- + +The `ContactName` object stores name properties of a contact. + +Supported Platforms +------------------- + +- Android 2.X +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + function onSuccess(contacts) { + for (var i=0; i + + + Contact Example + + + + + +

Example

+

Find Contacts

+ + + +Android Quirks +------------ +- __formatted:__ Partially supported. Will return the concatenation of honorificPrefix, givenName, middleName, familyName and honorificSuffix but will not store. + +BlackBerry WebWorks (OS 5.0 and higher) Quirks +--------------------------------------------- + +- __formatted:__ Partially supported. Will return concatenation of BlackBerry __firstName__ and __lastName__ fields. +- __familyName:__ Supported. Stored in BlackBerry __lastName__ field. +- __givenName:__ Supported. Stored in BlackBerry __firstName__ field. +- __middleName:__ This property is not supported, and will always return `null`. +- __honorificPrefix:__ This property is not supported, and will always return `null`. +- __honorificSuffix:__ This property is not supported, and will always return `null`. + +iOS Quirks +------------ +- __formatted:__ Partially supported. Will return iOS Composite Name but will not store. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/ContactOrganization/contactorganization.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/ContactOrganization/contactorganization.md b/docs/en/1.2.0/phonegap/contacts/ContactOrganization/contactorganization.md new file mode 100644 index 0000000..9f64f09 --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/ContactOrganization/contactorganization.md @@ -0,0 +1,131 @@ +ContactOrganization +=================== + +Contains organization properties of a `Contact` object. + +Properties +---------- +- __pref:__ Set to `true` if this `ContactOrganization` contains the user's preferred value. _(boolean)_ +- __type:__ A string that tells you what type of field this is (example: 'home'). _(DOMString) +- __name:__ The name of the organization. _(DOMString)_ +- __department:__ The department the contract works for. _(DOMString)_ +- __title:__ The contacts title at the organization. _(DOMString)_ + +Details +------- + +The `ContactOrganization` object stores a contact's organization properties. A `Contact` object stores one or more `ContactOrganization` objects in an array. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + function onSuccess(contacts) { + for (var i=0; i + + + Contact Example + + + + + +

Example

+

Find Contacts

+ + + + +Android 2.X Quirks +------------------ + +- __pref:__ This property is not supported by Android 2.X devices and will always return `false`. + +Android 1.X Quirks +------------------ + +- __pref:__ This property is not supported by Android 1.X devices and will always return `false`. +- __type:__ This property is not supported by Android 1.X devices and will always return `null`. +- __title:__ This property is not supported by Android 1.X devices, and will always be returned as `null`. + +BlackBerry WebWorks (OS 5.0 and higher) Quirks +-------------------------------------------- +- __pref:__ This property is not supported by Blackberry devices and will always return `false`. +- __type:__ This property is not supported by Blackberry devices and will always return `null`. +- __name:__ Partially supported. The first organization name will be stored in the BlackBerry __company__ field. +- __department:__ This property is not supported, and will always be returned as `null`. +- __title:__ Partially supported. The first organization title will be stored in the BlackBerry __jobTitle__ field. + +iOS Quirks +----------- +- __pref:__ This property is not supported on iOS devices and will always return `false`. +- __type:__ This property is not supported on iOS devices and will always return `null`. +- __name:__ Partially supported. The first organization name will be stored in the iOS __kABPersonOrganizationProperty__ field. +- __department__: Partially supported. The first department name will be stored in the iOS __kABPersonDepartmentProperty__ field. +- __title__: Partially supported. The first title will be stored in the iOS __kABPersonJobTitleProperty__ field. + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/contacts.create.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/contacts.create.md b/docs/en/1.2.0/phonegap/contacts/contacts.create.md new file mode 100644 index 0000000..c9634f6 --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/contacts.create.md @@ -0,0 +1,57 @@ +contacts.create +=============== + +Returns a new Contact object. + + var contact = navigator.contacts.create(properties); + +Description +----------- + +contacts.create is a synchronous function that returns a new `Contact` object. + +This method does not persist the Contact object to the device contacts database. To persist the Contact object to the device, invoke the `Contact.save` method. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + var myContact = navigator.contacts.create({"displayName": "Test User"}); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

Create Contact

+ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/contacts.find.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/contacts.find.md b/docs/en/1.2.0/phonegap/contacts/contacts.find.md new file mode 100644 index 0000000..e50cef3 --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/contacts.find.md @@ -0,0 +1,96 @@ +contacts.find +============= + +Queries the device contacts database and returns one or more `Contact` objects, each containing the fields specified. + + navigator.contacts.find(contactFields, contactSuccess, contactError, contactFindOptions); + +Description +----------- + +contacts.find is an asynchronous function that queries the device contacts database and returns an array of `Contact` objects. The resulting objects are passed to the `contactSuccess` callback function specified by the __contactSuccess__ parameter. + +Users must specify the contact fields to be used as a search qualifier in the __contactFields__ parameter. Only the fields specified in the __contactFields__ parameter will be returned as properties of the `Contact` objects that are passed to the __contactSuccess__ callback function. A zero-length __contactFields__ parameter will result in an array of `Contact` objects with only the `id` property populated. A __contactFields__ value of ["*"] will return all contact fields. + +The __contactFindOptions.filter__ string can be used as a search filter when querying the contacts database. If provided, a case-insensitive, partial value match is applied to each field specified in the __contactFields__ parameter. If a match is found in a comparison with _any_ of the specified fields, the contact is returned. + +Parameters +---------- + +- __contactFields:__ Contact fields to be used as search qualifier. Only these fields will have values in the resulting `Contact` objects. _(DOMString[])_ [Required] +- __contactSuccess:__ Success callback function that is invoked with the contacts returned from the contacts database. [Required] +- __contactError:__ Error callback function. Invoked when error occurs. [Optional] +- __contactFindOptions:__ Search options to filter contacts. [Optional] + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + function onSuccess(contacts) { + alert('Found ' + contacts.length + ' contacts.'); + }; + + function onError(contactError) { + alert('onError!'); + }; + + // find all contacts with 'Bob' in any name field + var options = new ContactFindOptions(); + options.filter="Bob"; + var fields = ["displayName", "name"]; + navigator.contacts.find(fields, onSuccess, onError, options); + +Full Example +------------ + + + + + Contact Example + + + + + +

Example

+

Find Contacts

+ + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/contacts.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/contacts.md b/docs/en/1.2.0/phonegap/contacts/contacts.md new file mode 100644 index 0000000..d6078ae --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/contacts.md @@ -0,0 +1,29 @@ +Contacts +======== + +> The `contacts` object provides access to the device contacts database. + +Methods +------- + +- contacts.create +- contacts.find + +Arguments +--------- + +- contactFields +- contactSuccess +- contactError +- contactFindOptions + +Objects +------- + +- Contact +- ContactName +- ContactField +- ContactAddress +- ContactOrganization +- ContactFindOptions +- ContactError \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/parameters/contactError.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/parameters/contactError.md b/docs/en/1.2.0/phonegap/contacts/parameters/contactError.md new file mode 100644 index 0000000..5d1af51 --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/parameters/contactError.md @@ -0,0 +1,8 @@ +contactError +============ + +Error callback function for contact functions. + + function(error) { + // Handle the error + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/parameters/contactFields.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/parameters/contactFields.md b/docs/en/1.2.0/phonegap/contacts/parameters/contactFields.md new file mode 100644 index 0000000..9d6005c --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/parameters/contactFields.md @@ -0,0 +1,6 @@ +contactFields +============= + +Required parameter of the `contacts.find` method. Use this parameter to specify which fields should be included in the `Contact` objects resulting from a find operation. + + ["name", "phoneNumbers", "emails"] http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/parameters/contactFindOptions.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/parameters/contactFindOptions.md b/docs/en/1.2.0/phonegap/contacts/parameters/contactFindOptions.md new file mode 100644 index 0000000..4a88e42 --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/parameters/contactFindOptions.md @@ -0,0 +1,16 @@ +contactFindOptions +================== + +Optional parameter of the `contacts.find` method. Use this parameter to filter the contacts returned from the contacts database. + + { + filter: "", + multiple: true, + }; + +Options +------- + +- __filter:__ The search string used to filter contacts. _(DOMString)_ (Default: "") +- __multiple:__ Determines if the find operation should return multiple contacts. _(Boolean)_ (Default: false) + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/contacts/parameters/contactSuccess.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/contacts/parameters/contactSuccess.md b/docs/en/1.2.0/phonegap/contacts/parameters/contactSuccess.md new file mode 100644 index 0000000..3625294 --- /dev/null +++ b/docs/en/1.2.0/phonegap/contacts/parameters/contactSuccess.md @@ -0,0 +1,21 @@ +contactSuccess +============== + +Success callback function that provides the `Contact` array resulting from a `contacts.find` operation. + + function(contacts) { + // Do something + } + +Parameters +---------- + +- __contacts:__ The contact array resulting from a find operation. (`Contact`) + +Example +------- + + function contactSuccess(contacts) { + for (var i=0; i + + + Device Properties Example + + + + + +

Loading device properties...

+ + + + +Android Quirks +-------------- + +- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL). + - The product name is often the code name given during production. + - e.g. Nexus One returns "Passion", Motorola Droid returns "voles" + +iPhone Quirks +------------- + +- Gets the [device's custom name](http://developer.apple.com/iphone/library/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/doc/uid/TP40006902-CH3-SW13) instead of the [device model name](http://developer.apple.com/iphone/library/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/doc/uid/TP40006902-CH3-SW1). + - The custom name is set by the owner in iTunes. + - e.g. "Joe's iPhone" \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/device/device.phonegap.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/device/device.phonegap.md b/docs/en/1.2.0/phonegap/device/device.phonegap.md new file mode 100644 index 0000000..80da863 --- /dev/null +++ b/docs/en/1.2.0/phonegap/device/device.phonegap.md @@ -0,0 +1,60 @@ +device.phonegap +=============== + +Get the version of phonegap running on the device. + + var string = device.phonegap; + +Description +----------- + +`device.phonegap` returns the version of phonegap running on the device. + +Supported Platforms +------------------- + +- Android +- BlackBerry +- BlackBerry WebWorks (OS 5.0 and higher) +- iPhone +- Windows Phone 7 ( Mango ) + +Quick Example +------------- + + var name = device.phonegap; + +Full Example +------------ + + + + + Device Properties Example + + + + + +

Loading device properties...

+ + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/device/device.platform.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/device/device.platform.md b/docs/en/1.2.0/phonegap/device/device.platform.md new file mode 100644 index 0000000..ba38f86 --- /dev/null +++ b/docs/en/1.2.0/phonegap/device/device.platform.md @@ -0,0 +1,70 @@ +device.platform +=============== + +Get the device's operating system name. + + var string = device.platform; + +Supported Platforms +------------------- + +- Android +- BlackBerry +- BlackBerry WebWorks (OS 5.0 and higher) +- iPhone +- Windows Phone 7 ( Mango ) + +Quick Example +------------- + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry" + // - "iPhone" + // - "webOS" + // - "WinCE" + var devicePlatform = device.platform; + +Full Example +------------ + + + + + Device Properties Example + + + + + +

Loading device properties...

+ + + +iPhone Quirks +------------- + +All devices return `iPhone` as the platform. This is inaccurate because Apple has rebranded the iPhone operating system as `iOS`. + +BlackBerry Quirks +----------------- + +Devices may return the device platform version instead of the platform name. For example, the Storm2 9550 would return '2.13.0.95' or similar. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/device/device.uuid.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/device/device.uuid.md b/docs/en/1.2.0/phonegap/device/device.uuid.md new file mode 100644 index 0000000..7082d93 --- /dev/null +++ b/docs/en/1.2.0/phonegap/device/device.uuid.md @@ -0,0 +1,72 @@ +device.uuid +=========== + +Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + + var string = device.uuid; + +Description +----------- + +The details of how a UUID is generated are determined by the device manufacturer and specific to the device's platform or model. + +Supported Platforms +------------------- + +- Android +- BlackBerry +- BlackBerry WebWorks (OS 5.0 and higher) +- iPhone +- Windows Phone 7 ( Mango ) + +Quick Example +------------- + + // Android: Returns a random 64-bit integer (as a string, again!) + // The integer is generated on the device's first boot + // + // BlackBerry: Returns the PIN number of the device + // This is a nine-digit unique integer (as a string, though!) + // + // iPhone: (Paraphrased from the UIDevice Class documentation) + // Returns a string of hash values created from multiple hardware identifies. + // It is guaranteed to be unique for every device and cannot be tied + // to the user account. + // Windows Phone 7 : Returns a hash of device+current user, + // if the user is not defined, a guid is generated and will persist until the app is uninstalled + // + var deviceID = device.uuid; + +Full Example +------------ + + + + + Device Properties Example + + + + + +

Loading device properties...

+ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/device/device.version.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/device/device.version.md b/docs/en/1.2.0/phonegap/device/device.version.md new file mode 100644 index 0000000..cf41777 --- /dev/null +++ b/docs/en/1.2.0/phonegap/device/device.version.md @@ -0,0 +1,63 @@ +device.version +============== + +Get the operating system version. + + var string = device.version; + +Supported Platforms +------------------- + +- Android 2.1+ +- BlackBerry +- BlackBerry WebWorks (OS 5.0 and higher) +- iPhone +- Windows Phone 7 ( Mango ) + +Quick Example +------------- + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Bold 9000 using OS 4.6 would return "4.6.0.282" + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + var deviceVersion = device.version; + +Full Example +------------ + + + + + Device Properties Example + + + + + +

Loading device properties...

+ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.backbutton.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.backbutton.md b/docs/en/1.2.0/phonegap/events/events.backbutton.md new file mode 100644 index 0000000..3949a7e --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.backbutton.md @@ -0,0 +1,67 @@ +backbutton +=========== + +This is an event that fires when the user presses the back button. + + document.addEventListener("backbutton", yourCallbackFunction, false); + +Details +------- + +If you need to override the default back button behaviour you can register an event listener for the 'backbutton' event. It is no longer necessary to call any other method to over ride the back button behaviour. Now, you only need to register an event listener for 'backbutton'. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + document.addEventListener("backbutton", onBackKeyDown, false); + + function onBackKeyDown() { + // Handle the back button + } + +Full Example +------------ + + + + + PhoneGap Back Button Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.deviceready.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.deviceready.md b/docs/en/1.2.0/phonegap/events/events.deviceready.md new file mode 100644 index 0000000..743e305 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.deviceready.md @@ -0,0 +1,92 @@ +deviceready +=========== + +This is an event that fires when PhoneGap is fully loaded. + + document.addEventListener("deviceready", yourCallbackFunction, false); + +Details +------- + +This is a very important event that every PhoneGap application should use. + +PhoneGap consists of two code bases: native and JavaScript. While the native code is loading, a custom loading image is displayed. However, JavaScript is only loaded once the DOM loads. This means your web application could, potentially, call a PhoneGap JavaScript function before it is loaded. + +The PhoneGap `deviceready` event fires once PhoneGap has fully loaded. After the device has fired, you can safely make calls to PhoneGap function. + +Typically, you will want to attach an event listener with `document.addEventListener` once the HTML document's DOM has loaded. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + document.addEventListener("deviceready", onDeviceReady, false); + + function onDeviceReady() { + // Now safe to use the PhoneGap API + } + +Full Example +------------ + + + + + PhoneGap Device Ready Example + + + + + + + + +BlackBerry (OS 4.6) Quirks +-------------------------- + +Custom events are not supported in the RIM BrowserField (web browser view), so the `deviceready` event will never fire. + +A workaround is to manually query `PhoneGap.available` until PhoneGap has fully loaded. + + function onLoad() { + // BlackBerry OS 4 browser does not support events. + // So, manually wait until PhoneGap is available. + // + var intervalID = window.setInterval( + function() { + if (PhoneGap.available) { + window.clearInterval(intervalID); + onDeviceReady(); + } + }, + 500 + ); + } + + function onDeviceReady() { + // Now safe to use the PhoneGap API + } http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.endcallbutton.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.endcallbutton.md b/docs/en/1.2.0/phonegap/events/events.endcallbutton.md new file mode 100644 index 0000000..48db299 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.endcallbutton.md @@ -0,0 +1,67 @@ +endcallbutton +=========== + +This is an event that fires when the user presses the end call button. + + document.addEventListener("endcallbutton", yourCallbackFunction, false); + +Details +------- + +If you need to override the default end call behaviour you can register an event listener for the 'endcallbutton' event. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + document.addEventListener("endcallbutton", onEndCallKeyDown, false); + + function onEndCallKeyDown() { + // Handle the end call button + } + +Full Example +------------ + + + + + PhoneGap End Call Button Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.md b/docs/en/1.2.0/phonegap/events/events.md new file mode 100644 index 0000000..7267883 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.md @@ -0,0 +1,21 @@ +Events +====== + +> PhoneGap lifecycle events. + +Event Types +----------- + +- deviceready +- pause +- resume +- online +- offline +- backbutton +- menubutton +- searchbutton +- startcallbutton +- endcallbutton +- volumedownbutton +- volumeupbutton + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.menubutton.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.menubutton.md b/docs/en/1.2.0/phonegap/events/events.menubutton.md new file mode 100644 index 0000000..d23faae --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.menubutton.md @@ -0,0 +1,68 @@ +menubutton +=========== + +This is an event that fires when the user presses the menu button. + + document.addEventListener("menubutton", yourCallbackFunction, false); + +Details +------- + +If you need to override the default menu button behaviour you can register an event listenter for the 'menubutton' event. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + document.addEventListener("menubutton", onMenuKeyDown, false); + + function onMenuKeyDown() { + // Handle the back button + } + +Full Example +------------ + + + + + PhoneGap Menu Button Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.offline.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.offline.md b/docs/en/1.2.0/phonegap/events/events.offline.md new file mode 100644 index 0000000..6ca27d8 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.offline.md @@ -0,0 +1,71 @@ +offline +=========== + +This is an event that fires when a PhoneGap application is offline (not connected to the Internet). + + document.addEventListener("offline", yourCallbackFunction, false); + +Details +------- + +When the application's network connection changes to being offline, the offline event is fired. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + document.addEventListener("offline", onOffline, false); + + function onOffline() { + // Handle the offline event + } + +Full Example +------------ + + + + + PhoneGap Offline Example + + + + + + + + +iOS Quirks +-------------------------- +During initial startup, the first offline event (if applicable) will take at least a second to fire. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.online.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.online.md b/docs/en/1.2.0/phonegap/events/events.online.md new file mode 100644 index 0000000..549245b --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.online.md @@ -0,0 +1,71 @@ +online +=========== + +This is an event that fires when a PhoneGap application is online (connected to the Internet). + + document.addEventListener("online", yourCallbackFunction, false); + +Details +------- + +When the application's network connection changes to being online, the online event is fired. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + document.addEventListener("online", onOnline, false); + + function onOnline() { + // Handle the online event + } + +Full Example +------------ + + + + + PhoneGap Online Example + + + + + + + + +iOS Quirks +-------------------------- +During initial startup, the first online event (if applicable) will take at least a second to fire. http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.pause.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.pause.md b/docs/en/1.2.0/phonegap/events/events.pause.md new file mode 100644 index 0000000..67a0a64 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.pause.md @@ -0,0 +1,71 @@ +pause +=========== + +This is an event that fires when a PhoneGap application is put into the background. + + document.addEventListener("pause", yourCallbackFunction, false); + +Details +------- + +PhoneGap consists of two code bases: native and JavaScript. While the native code puts the application into the background the pause event is fired. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + document.addEventListener("pause", onPause, false); + + function onPause() { + // Handle the pause event + } + +Full Example +------------ + + + + + PhoneGap Pause Example + + + + + + + + +iOS Quirks +-------------------------- +In the pause handler, any calls that go through Objective-C will not work, nor will any calls that are interactive, like alerts. This means that you cannot call console.log (and its variants), or any calls from Plugins or the PhoneGap API. These will only be processed when the app resumes (processed on the next run-loop). http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.resume.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.resume.md b/docs/en/1.2.0/phonegap/events/events.resume.md new file mode 100644 index 0000000..88ff8d6 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.resume.md @@ -0,0 +1,67 @@ +resume +=========== + +This is an event that fires when a PhoneGap application is retrieved from the background. + + document.addEventListener("resume", yourCallbackFunction, false); + +Details +------- + +PhoneGap consists of two code bases: native and JavaScript. While the native code pulls the application from the background the resume event is fired. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS + +Quick Example +------------- + + document.addEventListener("resume", onResume, false); + + function onResume() { + // Handle the resume event + } + +Full Example +------------ + + + + + PhoneGap Resume Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.searchbutton.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.searchbutton.md b/docs/en/1.2.0/phonegap/events/events.searchbutton.md new file mode 100644 index 0000000..4533b57 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.searchbutton.md @@ -0,0 +1,67 @@ +searchbutton +=========== + +This is an event that fires when the user presses the search button on Android. + + document.addEventListener("searchbutton", yourCallbackFunction, false); + +Details +------- + +If you need to override the default search button behaviour on Android you can register an event listener for the 'searchbutton' event. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- Android + +Quick Example +------------- + + document.addEventListener("searchbutton", onSearchKeyDown, false); + + function onSearchKeyDown() { + // Handle the search button + } + +Full Example +------------ + + + + + PhoneGap Search Button Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.startcallbutton.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.startcallbutton.md b/docs/en/1.2.0/phonegap/events/events.startcallbutton.md new file mode 100644 index 0000000..b8ec55f --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.startcallbutton.md @@ -0,0 +1,67 @@ +startcallbutton +=========== + +This is an event that fires when the user presses the start call button. + + document.addEventListener("startcallbutton", yourCallbackFunction, false); + +Details +------- + +If you need to override the default start call behaviour you can register an event listener for the 'startcallbutton' event. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + document.addEventListener("startcallbutton", onStartCallKeyDown, false); + + function onStartCallKeyDown() { + // Handle the start call button + } + +Full Example +------------ + + + + + PhoneGap Start Call Button Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.volumedownbutton.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.volumedownbutton.md b/docs/en/1.2.0/phonegap/events/events.volumedownbutton.md new file mode 100644 index 0000000..ca36dc7 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.volumedownbutton.md @@ -0,0 +1,67 @@ +volumedownbutton +=========== + +This is an event that fires when the user presses the volume down button. + + document.addEventListener("volumedownbutton", yourCallbackFunction, false); + +Details +------- + +If you need to override the default volume down behaviour you can register an event listener for the 'volumedownbutton' event. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false); + + function onVolumeDownKeyDown() { + // Handle the volume down button + } + +Full Example +------------ + + + + + PhoneGap Volume Down Button Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/a5a19ef2/docs/en/1.2.0/phonegap/events/events.volumeupbutton.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.volumeupbutton.md b/docs/en/1.2.0/phonegap/events/events.volumeupbutton.md new file mode 100644 index 0000000..92a15fb --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.volumeupbutton.md @@ -0,0 +1,67 @@ +volumeupbutton +=========== + +This is an event that fires when the user presses the volume up button. + + document.addEventListener("volumeupbutton", yourCallbackFunction, false); + +Details +------- + +If you need to override the default volume up behaviour you can register an event listener for the 'volumeupbutton' event. + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false); + + function onVolumeUpKeyDown() { + // Handle the volume up button + } + +Full Example +------------ + + + + + PhoneGap Volume Up Button Example + + + + + + +