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 CDF65BD8D for ; Fri, 20 Jan 2012 19:57:22 +0000 (UTC) Received: (qmail 57726 invoked by uid 500); 20 Jan 2012 19:57:22 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 57686 invoked by uid 500); 20 Jan 2012 19:57:22 -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 57679 invoked by uid 99); 20 Jan 2012 19:57:22 -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:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED 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:17 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C3102318A2A; 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: [27/32] git commit: Adding Battery API Docs Message-Id: <20120120195604.C3102318A2A@tyr.zones.apache.org> Date: Fri, 20 Jan 2012 19:56:04 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Adding Battery API Docs Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/commit/7e450beb Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/tree/7e450beb Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/diff/7e450beb Branch: refs/heads/master Commit: 7e450beb767f9f52f6dcf5e16cb255eddd62b440 Parents: a5a19ef Author: macdonst Authored: Thu Nov 17 11:40:31 2011 -0500 Committer: macdonst Committed: Thu Nov 17 11:40:31 2011 -0500 ---------------------------------------------------------------------- docs/en/1.2.0/config.json | 3 + .../phonegap/events/events.batterycritical.md | 74 +++++++++++++++ docs/en/1.2.0/phonegap/events/events.batterylow.md | 74 +++++++++++++++ .../1.2.0/phonegap/events/events.batterystatus.md | 74 +++++++++++++++ docs/en/1.2.0/phonegap/events/events.md | 3 + docs/en/edge/config.json | 3 + .../edge/phonegap/events/events.batterycritical.md | 74 +++++++++++++++ docs/en/edge/phonegap/events/events.batterylow.md | 74 +++++++++++++++ .../edge/phonegap/events/events.batterystatus.md | 74 +++++++++++++++ docs/en/edge/phonegap/events/events.md | 3 + 10 files changed, 456 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/1.2.0/config.json ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/config.json b/docs/en/1.2.0/config.json index 5b0a92e..5752429 100644 --- a/docs/en/1.2.0/config.json +++ b/docs/en/1.2.0/config.json @@ -79,6 +79,9 @@ "phonegap/events/events.online.md", "phonegap/events/events.offline.md", "phonegap/events/events.backbutton.md", + "phonegap/events/events.batterycritical.md", + "phonegap/events/events.batterylow.md", + "phonegap/events/events.batterystatus.md", "phonegap/events/events.menubutton.md", "phonegap/events/events.searchbutton.md", "phonegap/events/events.startcallbutton.md", http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/1.2.0/phonegap/events/events.batterycritical.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.batterycritical.md b/docs/en/1.2.0/phonegap/events/events.batterycritical.md new file mode 100644 index 0000000..e169a99 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.batterycritical.md @@ -0,0 +1,74 @@ +batterycritical +=========== + +This is an event that fires when a PhoneGap application detects the battery has reached the critical level threshold. + + window.addEventListener("batterycritical", yourCallbackFunction, false); + +Details +------- + +This event that fires when a PhoneGap application detects the percentage of battery has reached the critical battery threshold. This value is device specific. + +The batterycritical handler will be called with an object that contains two properties: + +- __level:__ The percentage of battery (0-100). _(Number)_ +- __isPlugged:__ A boolean that represents whether or not the device is plugged in or not. _(Boolean)_ + +Typically, you will want to attach an event listener with `window.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + window.addEventListener("batterycritical", onBatteryCritical, false); + + function onBatteryCritical(info) { + // Handle the battery critical event + alert("Battery Level Critical " + info.level + "%\nRecharge Soon!"); + } + +Full Example +------------ + + + + + PhoneGap Device Ready Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/1.2.0/phonegap/events/events.batterylow.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.batterylow.md b/docs/en/1.2.0/phonegap/events/events.batterylow.md new file mode 100644 index 0000000..e051be4 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.batterylow.md @@ -0,0 +1,74 @@ +batterylow +=========== + +This is an event that fires when a PhoneGap application detects the battery has reached the low level threshold. + + window.addEventListener("batterylow", yourCallbackFunction, false); + +Details +------- + +This event that fires when a PhoneGap application detects the percentage of battery has reached the low battery threshold. This value is device specific. + +The batterylow handler will be called with an object that contains two properties: + +- __level:__ The percentage of battery (0-100). _(Number)_ +- __isPlugged:__ A boolean that represents whether or not the device is plugged in or not. _(Boolean)_ + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + window.addEventListener("batterylow", onBatteryLow, false); + + function onBatteryLow(info) { + // Handle the battery low event + alert("Battery Level Low " + info.level + "%"); + } + +Full Example +------------ + + + + + PhoneGap Device Ready Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/1.2.0/phonegap/events/events.batterystatus.md ---------------------------------------------------------------------- diff --git a/docs/en/1.2.0/phonegap/events/events.batterystatus.md b/docs/en/1.2.0/phonegap/events/events.batterystatus.md new file mode 100644 index 0000000..1fa5dc0 --- /dev/null +++ b/docs/en/1.2.0/phonegap/events/events.batterystatus.md @@ -0,0 +1,74 @@ +batterystatus +=========== + +This is an event that fires when a PhoneGap application detects a change in the battery status. + + window.addEventListener("batterystatus", yourCallbackFunction, false); + +Details +------- + +This event that fires when a PhoneGap application detects the percentage of battery has changed by at least 1 percent. It is also fired if the device has been plugged in or un-plugged. + +The battery status handler will be called with an object that contains two properties: + +- __level:__ The percentage of battery (0-100). _(Number)_ +- __isPlugged:__ A boolean that represents whether or not the device is plugged in or not. _(Boolean)_ + +Typically, you will want to attach an event listener with `window.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + window.addEventListener("batterystatus", onBatteryStatus, false); + + function onBatteryStatus(info) { + // Handle the online event + console.log("Level: " + info.level + " isPlugged: " + info.isPlugged); + } + +Full Example +------------ + + + + + PhoneGap Device Ready Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/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 index 7267883..831138f 100644 --- a/docs/en/1.2.0/phonegap/events/events.md +++ b/docs/en/1.2.0/phonegap/events/events.md @@ -12,6 +12,9 @@ Event Types - online - offline - backbutton +- batterycritical +- batterylow +- batterystatus - menubutton - searchbutton - startcallbutton http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/edge/config.json ---------------------------------------------------------------------- diff --git a/docs/en/edge/config.json b/docs/en/edge/config.json index 5b0a92e..5752429 100644 --- a/docs/en/edge/config.json +++ b/docs/en/edge/config.json @@ -79,6 +79,9 @@ "phonegap/events/events.online.md", "phonegap/events/events.offline.md", "phonegap/events/events.backbutton.md", + "phonegap/events/events.batterycritical.md", + "phonegap/events/events.batterylow.md", + "phonegap/events/events.batterystatus.md", "phonegap/events/events.menubutton.md", "phonegap/events/events.searchbutton.md", "phonegap/events/events.startcallbutton.md", http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/edge/phonegap/events/events.batterycritical.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/events/events.batterycritical.md b/docs/en/edge/phonegap/events/events.batterycritical.md new file mode 100644 index 0000000..e169a99 --- /dev/null +++ b/docs/en/edge/phonegap/events/events.batterycritical.md @@ -0,0 +1,74 @@ +batterycritical +=========== + +This is an event that fires when a PhoneGap application detects the battery has reached the critical level threshold. + + window.addEventListener("batterycritical", yourCallbackFunction, false); + +Details +------- + +This event that fires when a PhoneGap application detects the percentage of battery has reached the critical battery threshold. This value is device specific. + +The batterycritical handler will be called with an object that contains two properties: + +- __level:__ The percentage of battery (0-100). _(Number)_ +- __isPlugged:__ A boolean that represents whether or not the device is plugged in or not. _(Boolean)_ + +Typically, you will want to attach an event listener with `window.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + window.addEventListener("batterycritical", onBatteryCritical, false); + + function onBatteryCritical(info) { + // Handle the battery critical event + alert("Battery Level Critical " + info.level + "%\nRecharge Soon!"); + } + +Full Example +------------ + + + + + PhoneGap Device Ready Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/edge/phonegap/events/events.batterylow.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/events/events.batterylow.md b/docs/en/edge/phonegap/events/events.batterylow.md new file mode 100644 index 0000000..e051be4 --- /dev/null +++ b/docs/en/edge/phonegap/events/events.batterylow.md @@ -0,0 +1,74 @@ +batterylow +=========== + +This is an event that fires when a PhoneGap application detects the battery has reached the low level threshold. + + window.addEventListener("batterylow", yourCallbackFunction, false); + +Details +------- + +This event that fires when a PhoneGap application detects the percentage of battery has reached the low battery threshold. This value is device specific. + +The batterylow handler will be called with an object that contains two properties: + +- __level:__ The percentage of battery (0-100). _(Number)_ +- __isPlugged:__ A boolean that represents whether or not the device is plugged in or not. _(Boolean)_ + +Typically, you will want to attach an event listener with `document.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + window.addEventListener("batterylow", onBatteryLow, false); + + function onBatteryLow(info) { + // Handle the battery low event + alert("Battery Level Low " + info.level + "%"); + } + +Full Example +------------ + + + + + PhoneGap Device Ready Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/edge/phonegap/events/events.batterystatus.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/events/events.batterystatus.md b/docs/en/edge/phonegap/events/events.batterystatus.md new file mode 100644 index 0000000..1fa5dc0 --- /dev/null +++ b/docs/en/edge/phonegap/events/events.batterystatus.md @@ -0,0 +1,74 @@ +batterystatus +=========== + +This is an event that fires when a PhoneGap application detects a change in the battery status. + + window.addEventListener("batterystatus", yourCallbackFunction, false); + +Details +------- + +This event that fires when a PhoneGap application detects the percentage of battery has changed by at least 1 percent. It is also fired if the device has been plugged in or un-plugged. + +The battery status handler will be called with an object that contains two properties: + +- __level:__ The percentage of battery (0-100). _(Number)_ +- __isPlugged:__ A boolean that represents whether or not the device is plugged in or not. _(Boolean)_ + +Typically, you will want to attach an event listener with `window.addEventListener` once you receive the PhoneGap 'deviceready' event. + +Supported Platforms +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 and higher) + +Quick Example +------------- + + window.addEventListener("batterystatus", onBatteryStatus, false); + + function onBatteryStatus(info) { + // Handle the online event + console.log("Level: " + info.level + " isPlugged: " + info.isPlugged); + } + +Full Example +------------ + + + + + PhoneGap Device Ready Example + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/7e450beb/docs/en/edge/phonegap/events/events.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/phonegap/events/events.md b/docs/en/edge/phonegap/events/events.md index 7267883..831138f 100644 --- a/docs/en/edge/phonegap/events/events.md +++ b/docs/en/edge/phonegap/events/events.md @@ -12,6 +12,9 @@ Event Types - online - offline - backbutton +- batterycritical +- batterylow +- batterystatus - menubutton - searchbutton - startcallbutton