You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2013/10/01 05:56:01 UTC
svn commit: r1527865 [6/25] - in /cordova/site/public/docs/en/3.1.0: ./ img/
img/guide/ img/guide/cli/ img/guide/platforms/ img/guide/platforms/android/
img/guide/platforms/bada/ img/guide/platforms/blackberry10/
img/guide/platforms/ios/ img/guide/plat...
Added: cordova/site/public/docs/en/3.1.0/cordova_events_events.md.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/3.1.0/cordova_events_events.md.html?rev=1527865&view=auto
==============================================================================
--- cordova/site/public/docs/en/3.1.0/cordova_events_events.md.html (added)
+++ cordova/site/public/docs/en/3.1.0/cordova_events_events.md.html Tue Oct 1 03:55:57 2013
@@ -0,0 +1,1579 @@
+<!DOCTYPE html>
+<!--
+ 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.
+--><html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
+<meta name="generator" content="joDoc">
+<title>Apache Cordova API Documentation</title>
+<link rel="stylesheet" type="text/css" href="index.css">
+<link rel="stylesheet" type="text/css" href="mobile.css" media="only screen and (max-device-width: 1024px)">
+<link rel="stylesheet" type="text/css" href="prettify/prettify.css">
+</head>
+<body>
+ <div id="header">
+ <h1><a href="index.html">Apache <strong>Cordova</strong> Documentation</a></h1>
+ <small>
+ <select><optgroup label="Chinese" value="zh"><option value="edge">edge</option></optgroup>
+<optgroup label="English" value="en">
+<option value="edge">edge</option>
+<option selected value="3.1.0">3.1.0</option>
+<option value="3.0.0">3.0.0</option>
+<option value="2.9.0">2.9.0</option>
+<option value="2.8.0">2.8.0</option>
+<option value="2.7.0">2.7.0</option>
+<option value="2.6.0">2.6.0</option>
+<option value="2.5.0">2.5.0</option>
+<option value="2.4.0">2.4.0</option>
+<option value="2.3.0">2.3.0</option>
+<option value="2.2.0">2.2.0</option>
+<option value="2.1.0">2.1.0</option>
+<option value="2.0.0">2.0.0</option>
+<option value="1.9.0">1.9.0</option>
+<option value="1.8.1">1.8.1</option>
+<option value="1.8.0">1.8.0</option>
+<option value="1.7.0">1.7.0</option>
+<option value="1.6.1">1.6.1</option>
+<option value="1.6.0">1.6.0</option>
+<option value="1.5.0">1.5.0</option>
+</optgroup>
+<optgroup label="French" value="fr"><option value="edge">edge</option></optgroup>
+<optgroup label="German" value="de"><option value="edge">edge</option></optgroup>
+<optgroup label="Italian" value="it"><option value="edge">edge</option></optgroup>
+<optgroup label="Japanese" value="ja">
+<option value="edge">edge</option>
+<option value="2.2.0">2.2.0</option>
+<option value="2.1.0">2.1.0</option>
+<option value="2.0.0">2.0.0</option>
+<option value="1.9.0">1.9.0</option>
+<option value="1.8.1">1.8.1</option>
+<option value="1.7.0">1.7.0</option>
+</optgroup>
+<optgroup label="Korean" value="ko">
+<option value="edge">edge</option>
+<option value="2.0.0">2.0.0</option>
+</optgroup>
+<optgroup label="Russian" value="ru"><option value="edge">edge</option></optgroup>
+<optgroup label="Spanish" value="es"><option value="edge">edge</option></optgroup></select></small>
+ </div>
+ <div id="subheader">
+ <h1>Events</h1>
+ <small><select><option value="Events">Events</option>
+<option value="Events_event_types">Â Â Â Â Â Â - Event Types</option>
+<option value="Events_accessing_the_feature">Â Â Â Â Â Â - Accessing the Feature</option>
+<option value="deviceready">deviceready</option>
+<option value="deviceready_details">Â Â Â Â Â Â - Details</option>
+<option value="deviceready_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="deviceready_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="deviceready_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="pause">pause</option>
+<option value="pause_details">Â Â Â Â Â Â - Details</option>
+<option value="pause_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="pause_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="pause_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="pause_ios_quirks">Â Â Â Â Â Â - iOS Quirks</option>
+<option value="resume">resume</option>
+<option value="resume_details">Â Â Â Â Â Â - Details</option>
+<option value="resume_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="resume_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="resume_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="resume_ios_quirks">Â Â Â Â Â Â - iOS Quirks</option>
+<option value="online">online</option>
+<option value="online_details">Â Â Â Â Â Â - Details</option>
+<option value="online_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="online_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="online_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="online_ios_quirks">Â Â Â Â Â Â - iOS Quirks</option>
+<option value="online_windows_phone_7_quirks">Â Â Â Â Â Â - Windows Phone 7 Quirks</option>
+<option value="online_windows_phone_8_quirks">Â Â Â Â Â Â - Windows Phone 8 Quirks</option>
+<option value="offline">offline</option>
+<option value="offline_details">Â Â Â Â Â Â - Details</option>
+<option value="offline_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="offline_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="offline_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="offline_ios_quirks">Â Â Â Â Â Â - iOS Quirks</option>
+<option value="offline_windows_phone_7_quirks">Â Â Â Â Â Â - Windows Phone 7 Quirks</option>
+<option value="offline_windows_phone_8_quirks">Â Â Â Â Â Â - Windows Phone 8 Quirks</option>
+<option value="backbutton">backbutton</option>
+<option value="backbutton_details">Â Â Â Â Â Â - Details</option>
+<option value="backbutton_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="backbutton_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="backbutton_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="batterycritical">batterycritical</option>
+<option value="batterycritical_details">Â Â Â Â Â Â - Details</option>
+<option value="batterycritical_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="batterycritical_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="batterycritical_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="batterylow">batterylow</option>
+<option value="batterylow_details">Â Â Â Â Â Â - Details</option>
+<option value="batterylow_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="batterylow_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="batterylow_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="batterystatus">batterystatus</option>
+<option value="batterystatus_details">Â Â Â Â Â Â - Details</option>
+<option value="batterystatus_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="batterystatus_windows_phone_7_and_8_quirks">Â Â Â Â Â Â - Windows Phone 7 and 8 Quirks</option>
+<option value="batterystatus_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="batterystatus_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="menubutton">menubutton</option>
+<option value="menubutton_details">Â Â Â Â Â Â - Details</option>
+<option value="menubutton_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="menubutton_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="menubutton_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="searchbutton">searchbutton</option>
+<option value="searchbutton_details">Â Â Â Â Â Â - Details</option>
+<option value="searchbutton_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="searchbutton_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="searchbutton_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="startcallbutton">startcallbutton</option>
+<option value="startcallbutton_details">Â Â Â Â Â Â - Details</option>
+<option value="startcallbutton_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="startcallbutton_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="startcallbutton_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="endcallbutton">endcallbutton</option>
+<option value="endcallbutton_details">Â Â Â Â Â Â - Details</option>
+<option value="endcallbutton_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="endcallbutton_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="endcallbutton_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="volumedownbutton">volumedownbutton</option>
+<option value="volumedownbutton_details">Â Â Â Â Â Â - Details</option>
+<option value="volumedownbutton_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="volumedownbutton_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="volumedownbutton_full_example">Â Â Â Â Â Â - Full Example</option>
+<option value="volumeupbutton">volumeupbutton</option>
+<option value="volumeupbutton_details">Â Â Â Â Â Â - Details</option>
+<option value="volumeupbutton_supported_platforms">Â Â Â Â Â Â - Supported Platforms</option>
+<option value="volumeupbutton_quick_example">Â Â Â Â Â Â - Quick Example</option>
+<option value="volumeupbutton_full_example">Â Â Â Â Â Â - Full Example</option></select></small>
+ </div>
+
+ <div id="sidebar">
+ <div class="vertical_divider"></div>
+ <h1>Guides</h1>
+<ul>
+<li><a href="guide_overview_index.md.html#Overview">Overview</a></li>
+<li><a href="guide_cli_index.md.html#The%20Command-line%20Interface">The Command-line Interface</a></li>
+<li><a href="guide_platforms_index.md.html#Platform%20Guides">Platform Guides</a></li>
+<li><a href="config_ref_index.md.html#The%20config.xml%20File">The config.xml File</a></li>
+<li><a href="guide_hybrid_webviews_index.md.html#Embedding%20WebViews">Embedding WebViews</a></li>
+<li><a href="guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide">Plugin Development Guide</a></li>
+<li><a href="guide_appdev_privacy_index.md.html#Privacy%20Guide">Privacy Guide</a></li>
+<li><a href="guide_appdev_whitelist_index.md.html#Domain%20Whitelist%20Guide">Domain Whitelist Guide</a></li>
+<li><a href="_index.html">Keyword Index</a></li>
+</ul>
+<h1>API Reference</h1>
+<ul>
+<li><a href="cordova_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></li>
+<li><a href="cordova_camera_camera.md.html#Camera">Camera</a></li>
+<li><a href="cordova_media_capture_capture.md.html#Capture">Capture</a></li>
+<li><a href="cordova_compass_compass.md.html#Compass">Compass</a></li>
+<li><a href="cordova_connection_connection.md.html#Connection">Connection</a></li>
+<li><a href="cordova_contacts_contacts.md.html#Contacts">Contacts</a></li>
+<li><a href="cordova_device_device.md.html#Device">Device</a></li>
+<li><a href="cordova_events_events.md.html#Events">Events</a></li>
+<li><a href="cordova_file_file.md.html#File">File</a></li>
+<li><a href="cordova_geolocation_geolocation.md.html#Geolocation">Geolocation</a></li>
+<li><a href="cordova_globalization_globalization.md.html#Globalization">Globalization</a></li>
+<li><a href="cordova_inappbrowser_inappbrowser.md.html#InAppBrowser">InAppBrowser</a></li>
+<li><a href="cordova_media_media.md.html#Media">Media</a></li>
+<li><a href="cordova_notification_notification.md.html#Notification">Notification</a></li>
+<li><a href="cordova_splashscreen_splashscreen.md.html#Splashscreen">Splashscreen</a></li>
+<li><a href="cordova_storage_storage.md.html#Storage">Storage</a></li>
+</ul>
+</div>
+
+ <div id="scrollable">
+ <div id="content">
+ <h1><a name="Events">Events</a></h1>
+
+<blockquote>
+ <p>Cordova lifecycle events.</p>
+</blockquote>
+
+<h2>
+<a name="Events_event_types">Event Types</a>
+</h2>
+
+<ul>
+<li><a href="cordova_events_events.md.html#deviceready">deviceready</a></li>
+<li><a href="cordova_events_events.md.html#pause">pause</a></li>
+<li><a href="cordova_events_events.md.html#resume">resume</a></li>
+<li><a href="cordova_events_events.md.html#online">online</a></li>
+<li><a href="cordova_events_events.md.html#offline">offline</a></li>
+<li><a href="cordova_events_events.md.html#backbutton">backbutton</a></li>
+<li><a href="cordova_events_events.md.html#batterycritical">batterycritical</a></li>
+<li><a href="cordova_events_events.md.html#batterylow">batterylow</a></li>
+<li><a href="cordova_events_events.md.html#batterystatus">batterystatus</a></li>
+<li><a href="cordova_events_events.md.html#menubutton">menubutton</a></li>
+<li><a href="cordova_events_events.md.html#searchbutton">searchbutton</a></li>
+<li><a href="cordova_events_events.md.html#startcallbutton">startcallbutton</a></li>
+<li><a href="cordova_events_events.md.html#endcallbutton">endcallbutton</a></li>
+<li><a href="cordova_events_events.md.html#volumedownbutton">volumedownbutton</a></li>
+<li><a href="cordova_events_events.md.html#volumeupbutton">volumeupbutton</a></li>
+</ul>
+<h2>
+<a name="Events_accessing_the_feature">Accessing the Feature</a>
+</h2>
+
+<p>As of version 3.0, Cordova implements battery status and other
+device-level APIs as <em>plugins</em>. Access to all other events not related
+to battery status are enabled by default. Use the CLI's <code>plugin</code>
+command, described in <a href="guide_cli_index.md.html#The%20Command-line%20Interface">The Command-line Interface</a>, to enable or disable
+battery events:</p>
+
+<pre class="prettyprint"><code> $ cordova plugin add org.apache.cordova.battery-status
+ $ cordova plugin ls
+ [ 'org.apache.cordova.battery-status' ]
+ $ cordova plugin rm org.apache.cordova.battery-status
+</code></pre>
+
+<p>These commands apply to all targeted platforms, but modify the
+platform-specific configuration settings described below:</p>
+
+<ul>
+<li>
+<p>Android</p>
+
+<pre class="prettyprint"><code>(in app/res/xml/config.xml)
+<feature name="Battery">
+ <param name="android-package" value="org.apache.cordova.BatteryListener" />
+</feature>
+
+
+(in app/AndroidManifest.xml)
+<uses-permission android:name="android.permission.BROADCAST_STICKY" />
+</code></pre>
+</li>
+<li>
+<p>BlackBerry WebWorks</p>
+
+<pre class="prettyprint"><code>(in www/plugins.xml)
+<feature name="Battery">
+ <param name="blackberry-package" value="org.apache.cordova.battery.Battery" />
+</feature>
+
+
+(in www/config.xml)
+<feature id="blackberry.app" required="true" version="1.0.0.0" />
+<feature id="blackberry.app.event" required="true" version="1.0.0.0" />
+<feature id="blackberry.system.event" required="true" version="1.0.0.0" />
+</code></pre>
+</li>
+<li>
+<p>iOS (in <code>config.xml</code>)</p>
+
+<pre class="prettyprint"><code><feature name="Battery">
+ <param name="ios-package" value="CDVBattery" />
+</feature>
+</code></pre>
+</li>
+<li>
+<p>Tizen (in <code>config.xml</code>)</p>
+
+<pre class="prettyprint"><code><feature name="http://tizen.org/api/systeminfo" required="true"/>
+</code></pre>
+
+<p>Reference: <a class="external" href="https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures">Application Manifest for Tizen Web Application</a></p>
+</li>
+</ul>
+<p>Some platforms may support this feature without requiring any special
+configuration. See <em>Platform Support</em> in the <a href="guide_overview_index.md.html#Overview">Overview</a> section.</p>
+
+<hr>
+<h1><a name="deviceready">deviceready</a></h1>
+
+<p>The event fires when Cordova is fully loaded.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="deviceready_details">Details</a>
+</h2>
+
+<p>This event is essential to any application. It signals that Cordova's
+device APIs have loaded and are ready to access.</p>
+
+<p>Cordova consists of two code bases: native and JavaScript. While the
+native code loads, a custom loading image displays. However,
+JavaScript only loads once the DOM loads. This means your web
+application may potentially call a Cordova JavaScript function before
+the corresponding native code is available.</p>
+
+<p>The <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires once Cordova has fully loaded. Once the
+event fires, you can safely make calls to Cordova APIs. Applications
+typically attach an event listener with <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code>
+once the HTML document's DOM has loaded.</p>
+
+<p>The <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event behaves somewhat differently from others. Any
+event handler registered after the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires has its
+callback function called immediately.</p>
+
+<h2>
+<a name="deviceready_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="deviceready_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+
+function onDeviceReady() {
+ // Now safe to use device APIs
+}
+</code></pre>
+
+<h2>
+<a name="deviceready_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title><a href="cordova_device_device.md.html#Device">Device</a> Ready Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Now safe to use device APIs
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="pause">pause</a></h1>
+
+<p>The event fires when an application is put into the background.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#pause">pause</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="pause_details">Details</a>
+</h2>
+
+<p>The <code><a href="cordova_events_events.md.html#pause">pause</a></code> event fires when the native platform puts the application
+into the background, typically when the user switches to a different
+application.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="pause_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="pause_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#pause">pause</a>", onPause, false);
+
+function onPause() {
+ // Handle the <a href="cordova_events_events.md.html#pause">pause</a> event
+}
+</code></pre>
+
+<h2>
+<a name="pause_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title>Pause Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#pause">pause</a>", onPause, false);
+ }
+
+ // Handle the <a href="cordova_events_events.md.html#pause">pause</a> event
+ //
+ function onPause() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<h2>
+<a name="pause_ios_quirks">iOS Quirks</a>
+</h2>
+
+<p>In the <code><a href="cordova_events_events.md.html#pause">pause</a></code> handler, any calls to the Cordova API or to native
+plugins that go through Objective-C do not work, along with any
+interactive calls, such as alerts or <code>console.log()</code>. They are only
+processed when the app resumes, on the next run loop.</p>
+
+<p>The iOS-specific <code>resign</code> event is available as an alternative to
+<code><a href="cordova_events_events.md.html#pause">pause</a></code>, and detects when users enable the <strong>Lock</strong> button to lock the
+device with the app running in the foreground. If the app (and
+device) is enabled for multi-tasking, this is paired with a subsequent
+<code><a href="cordova_events_events.md.html#pause">pause</a></code> event, but only under iOS 5. In effect, all locked apps in iOS
+5 that have multi-tasking enabled are pushed to the background. For
+apps to remain running when locked under iOS 5, disable the app's
+multi-tasking by setting
+<a class="external" href="http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html">UIApplicationExitsOnSuspend</a>
+to <code>YES</code>. To run when locked on iOS 4, this setting does not matter.</p>
+
+<hr>
+<h1><a name="resume">resume</a></h1>
+
+<p>The event fires when an application is retrieved from the background.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#resume">resume</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="resume_details">Details</a>
+</h2>
+
+<p>The <code><a href="cordova_events_events.md.html#resume">resume</a></code> event fires when the native platform pulls the
+application out from the background.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="resume_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="resume_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#resume">resume</a>", onResume, false);
+
+function onResume() {
+ // Handle the <a href="cordova_events_events.md.html#resume">resume</a> event
+}
+</code></pre>
+
+<h2>
+<a name="resume_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title>Resume Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#resume">resume</a>", onResume, false);
+ }
+
+ // Handle the <a href="cordova_events_events.md.html#resume">resume</a> event
+ //
+ function onResume() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<h2>
+<a name="resume_ios_quirks">iOS Quirks</a>
+</h2>
+
+<p>Any interactive functions called from a <code><a href="cordova_events_events.md.html#pause">pause</a></code> event handler execute
+later when the app resumes, as signaled by the <code><a href="cordova_events_events.md.html#resume">resume</a></code> event. These
+include alerts, <code>console.log()</code>, and any calls from plugins or the
+Cordova API, which go through Objective-C.</p>
+
+<ul>
+<li>
+<p><strong>active</strong> event</p>
+
+<p>The iOS-specific <code>active</code> event is available as an alternative to
+<code><a href="cordova_events_events.md.html#resume">resume</a></code>, and detects when users disable the <strong>Lock</strong> button to unlock
+the device with the app running in the foreground. If the app (and
+device) is enabled for multi-tasking, this is paired with a subsequent
+<code><a href="cordova_events_events.md.html#resume">resume</a></code> event, but only under iOS 5. In effect, all locked apps in
+iOS 5 that have multi-tasking enabled are pushed to the background.
+For apps to remain running when locked under iOS 5, disable the app's
+multi-tasking by setting <a class="external" href="http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html">UIApplicationExitsOnSuspend</a>
+to <code>YES</code>. To run when locked on iOS 4, this setting does not matter.</p>
+</li>
+<li>
+<p><strong><a href="cordova_events_events.md.html#resume">resume</a></strong> event</p>
+
+<p>When called from a <code><a href="cordova_events_events.md.html#resume">resume</a></code> event handler, interactive functions such
+as <code>alert()</code> need to be wrapped in a <code>setTimeout()</code> call with a
+timeout value of zero, or else the app hangs. For example:</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#resume">resume</a>", onResume, false);
+function onResume() {
+ setTimeout(function() {
+ // TODO: do your thing!
+ }, 0);
+}
+</code></pre>
+</li>
+</ul>
+<hr>
+<h1><a name="online">online</a></h1>
+
+<p>This event fires when an application goes <a href="cordova_events_events.md.html#online">online</a>, and the device
+becomes connected to the Internet.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#online">online</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="online_details">Details</a>
+</h2>
+
+<p>The <code><a href="cordova_events_events.md.html#online">online</a></code> event fires when a previously unconnected device receives
+a network connection to allow an application access to the Internet.
+It relies on the same information as the <a href="cordova_connection_connection.md.html#Connection">Connection</a> API, and fires
+when the value of <code><a href="cordova_connection_connection.md.html#connection.type">connection.type</a></code> becomes <code>NONE</code>.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="online_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Windows Phone 7 and 8</li>
+<li>Tizen</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="online_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#online">online</a>", onOnline, false);
+
+function onOnline() {
+ // Handle the <a href="cordova_events_events.md.html#online">online</a> event
+}
+</code></pre>
+
+<h2>
+<a name="online_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title>Online Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#online">online</a>", onOnline, false);
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ }
+
+ // Handle the <a href="cordova_events_events.md.html#online">online</a> event
+ //
+ function onOnline() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<h2>
+<a name="online_ios_quirks">iOS Quirks</a>
+</h2>
+
+<p>During initial startup, the first <code><a href="cordova_events_events.md.html#online">online</a></code> event (if applicable) takes
+at least a second to fire, prior to which <code><a href="cordova_connection_connection.md.html#connection.type">connection.type</a></code> is
+<code>UNKNOWN</code>.</p>
+
+<h2>
+<a name="online_windows_phone_7_quirks">Windows Phone 7 Quirks</a>
+</h2>
+
+<p>When running in the Emulator, the <code>connection.status</code> is always unknown, so this event will <em>not</em> fire.</p>
+
+<h2>
+<a name="online_windows_phone_8_quirks">Windows Phone 8 Quirks</a>
+</h2>
+
+<p>The Emulator reports the <a href="#connection%20type">connection type</a> as <code>Cellular</code>, which does not change, so events will <em>not</em> fire.</p>
+
+<hr>
+<h1><a name="offline">offline</a></h1>
+
+<p>The event fires when an application goes <a href="cordova_events_events.md.html#offline">offline</a>, and the device is
+not connected to the Internet.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#offline">offline</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="offline_details">Details</a>
+</h2>
+
+<p>The <code><a href="cordova_events_events.md.html#offline">offline</a></code> event fires when a previously connected device loses a
+network connection so that an application can no longer access the
+Internet. It relies on the same information as the <a href="cordova_connection_connection.md.html#Connection">Connection</a> API,
+and fires when the <code><a href="cordova_connection_connection.md.html#connection.type">connection.type</a></code> changes from <code>NONE</code> to any other
+value.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="offline_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Windows Phone 7 and 8</li>
+<li>Tizen</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="offline_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#offline">offline</a>", onOffline, false);
+
+function onOffline() {
+ // Handle the <a href="cordova_events_events.md.html#offline">offline</a> event
+}
+</code></pre>
+
+<h2>
+<a name="offline_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title>Offline Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#offline">offline</a>", onOffline, false);
+ }
+
+ // Handle the <a href="cordova_events_events.md.html#offline">offline</a> event
+ //
+ function onOffline() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<h2>
+<a name="offline_ios_quirks">iOS Quirks</a>
+</h2>
+
+<p>During initial startup, the first <a href="cordova_events_events.md.html#offline">offline</a> event (if applicable) takes at least a second to fire.</p>
+
+<h2>
+<a name="offline_windows_phone_7_quirks">Windows Phone 7 Quirks</a>
+</h2>
+
+<p>When running in the Emulator, the <code>connection.status</code> is always unknown, so this event does <em>not</em> fire.</p>
+
+<h2>
+<a name="offline_windows_phone_8_quirks">Windows Phone 8 Quirks</a>
+</h2>
+
+<p>The Emulator reports the <a href="#connection%20type">connection type</a> as <code>Cellular</code>, which does not change, so the event does <em>not</em> fire.</p>
+
+<hr>
+<h1><a name="backbutton">backbutton</a></h1>
+
+<p>The event fires when the user presses the back button.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#backbutton">backbutton</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="backbutton_details">Details</a>
+</h2>
+
+<p>To override the default back-button behavior, register an event
+listener for the <code><a href="cordova_events_events.md.html#backbutton">backbutton</a></code> event, typically by calling
+<code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> once you receive the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event.
+It is no longer necessary to call any other method to override the
+back-button behavior.</p>
+
+<h2>
+<a name="backbutton_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>Windows Phone 7 and 8</li>
+</ul>
+<h2>
+<a name="backbutton_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#backbutton">backbutton</a>", onBackKeyDown, false);
+
+function onBackKeyDown() {
+ // Handle the back button
+}
+</code></pre>
+
+<h2>
+<a name="backbutton_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title>Back Button Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Register the event listener
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#backbutton">backbutton</a>", onBackKeyDown, false);
+ }
+
+ // Handle the back button
+ //
+ function onBackKeyDown() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="batterycritical">batterycritical</a></h1>
+
+<p>The event fires when the battery has reached the critical level
+threshold.</p>
+
+<pre class="prettyprint"><code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterycritical">batterycritical</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="batterycritical_details">Details</a>
+</h2>
+
+<p>The event fires when the percentage of battery charge has reached the
+critical battery threshold. The value is device-specific.</p>
+
+<p>The <code><a href="cordova_events_events.md.html#batterycritical">batterycritical</a></code> handler is passed an object that contains two
+properties:</p>
+
+<ul>
+<li><p><strong>level</strong>: The percentage of battery charge (0-100). <em>(Number)</em></p></li>
+<li><p><strong>isPlugged</strong>: A boolean that indicates whether the device is plugged in. <em>(Boolean)</em></p></li>
+</ul>
+<p>Applications typically should use <code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to attach
+an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="batterycritical_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>iOS</li>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>Tizen</li>
+</ul>
+<h2>
+<a name="batterycritical_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterycritical">batterycritical</a>", onBatteryCritical, false);
+
+function onBatteryCritical(info) {
+ // Handle the battery critical event
+ alert("Battery Level Critical " + info.level + "%\nRecharge Soon!");
+}
+</code></pre>
+
+<h2>
+<a name="batterycritical_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title>Battery Critical Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterycritical">batterycritical</a>", onBatteryCritical, false);
+ }
+
+ // Handle the <a href="cordova_events_events.md.html#batterycritical">batterycritical</a> event
+ //
+ function onBatteryCritical(info) {
+ alert("Battery Level Critical " + info.level + "%\nRecharge Soon!");
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="batterylow">batterylow</a></h1>
+
+<p>The event fires when the battery has reached the low level threshold.</p>
+
+<pre class="prettyprint"><code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterylow">batterylow</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="batterylow_details">Details</a>
+</h2>
+
+<p>The event fires when the percentage of battery charge has reached the
+low battery threshold, device-specific value.</p>
+
+<p>The <code><a href="cordova_events_events.md.html#batterylow">batterylow</a></code> handler is passed an object that contains two
+properties:</p>
+
+<ul>
+<li><p><strong>level</strong>: The percentage of battery charge (0-100). <em>(Number)</em></p></li>
+<li><p><strong>isPlugged</strong>: A boolean that indicates whether the device is plugged in. <em>(Boolean)</em></p></li>
+</ul>
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="batterylow_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>iOS</li>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>Tizen</li>
+</ul>
+<h2>
+<a name="batterylow_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterylow">batterylow</a>", onBatteryLow, false);
+
+function onBatteryLow(info) {
+ // Handle the battery low event
+ alert("Battery Level Low " + info.level + "%");
+}
+</code></pre>
+
+<h2>
+<a name="batterylow_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title><a href="cordova_device_device.md.html#Device">Device</a> Ready Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterylow">batterylow</a>", onBatteryLow, false);
+ }
+
+ // Handle the <a href="cordova_events_events.md.html#batterylow">batterylow</a> event
+ //
+ function onBatteryLow(info) {
+ alert("Battery Level Low " + info.level + "%");
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="batterystatus">batterystatus</a></h1>
+
+<p>The event fires when there is a change in the battery status.</p>
+
+<pre class="prettyprint"><code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterystatus">batterystatus</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="batterystatus_details">Details</a>
+</h2>
+
+<p>This event fires when the percentage of battery charge changes by at
+least 1 percent, or if the device is plugged in or unplugged.</p>
+
+<p>The battery status handler is passed an object that contains two
+properties:</p>
+
+<ul>
+<li><p><strong>level</strong>: The percentage of battery charge (0-100). <em>(Number)</em></p></li>
+<li><p><strong>isPlugged</strong>: A boolean that indicates whether the device is plugged in. <em>(Boolean)</em></p></li>
+</ul>
+<p>Applications typically should use <code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="batterystatus_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>iOS</li>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>Windows Phone 7 and 8</li>
+<li>Tizen</li>
+</ul>
+<h2>
+<a name="batterystatus_windows_phone_7_and_8_quirks">Windows Phone 7 and 8 Quirks</a>
+</h2>
+
+<p>Windows Phone 7 does not provide native APIs to determine battery
+level, so the <code>level</code> property is unavailable. The <code>isPlugged</code>
+parameter <em>is</em> supported.</p>
+
+<h2>
+<a name="batterystatus_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterystatus">batterystatus</a>", onBatteryStatus, false);
+
+function onBatteryStatus(info) {
+ // Handle the <a href="cordova_events_events.md.html#online">online</a> event
+ console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
+}
+</code></pre>
+
+<h2>
+<a name="batterystatus_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE html>
+<html>
+ <head>
+ <title><a href="cordova_device_device.md.html#Device">Device</a> Ready Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ window.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#batterystatus">batterystatus</a>", onBatteryStatus, false);
+ }
+
+ // Handle the <a href="cordova_events_events.md.html#batterystatus">batterystatus</a> event
+ //
+ function onBatteryStatus(info) {
+ console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="menubutton">menubutton</a></h1>
+
+<p>The event fires when the user presses the menu button.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#menubutton">menubutton</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="menubutton_details">Details</a>
+</h2>
+
+<p>Applying an event handler overrides the default menu button behavior.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="menubutton_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+</ul>
+<h2>
+<a name="menubutton_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#menubutton">menubutton</a>", onMenuKeyDown, false);
+
+function onMenuKeyDown() {
+ // Handle the back button
+}
+</code></pre>
+
+<h2>
+<a name="menubutton_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Menu Button Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Register the event listener
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#menubutton">menubutton</a>", onMenuKeyDown, false);
+ }
+
+ // Handle the menu button
+ //
+ function onMenuKeyDown() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="searchbutton">searchbutton</a></h1>
+
+<p>The event fires when the user presses the search button on Android.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#searchbutton">searchbutton</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="searchbutton_details">Details</a>
+</h2>
+
+<p>If you need to override the default search button behavior on Android
+you can register an event listener for the '<a href="cordova_events_events.md.html#searchbutton">searchbutton</a>' event.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="searchbutton_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+</ul>
+<h2>
+<a name="searchbutton_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#searchbutton">searchbutton</a>", onSearchKeyDown, false);
+
+function onSearchKeyDown() {
+ // Handle the search button
+}
+</code></pre>
+
+<h2>
+<a name="searchbutton_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Search Button Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Register the event listener
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#searchbutton">searchbutton</a>", onSearchKeyDown, false);
+ }
+
+ // Handle the search button
+ //
+ function onSearchKeyDown() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="startcallbutton">startcallbutton</a></h1>
+
+<p>The event fires when the user presses the start call button.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#startcallbutton">startcallbutton</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="startcallbutton_details">Details</a>
+</h2>
+
+<p>If you need to override the default start call behavior you can
+register an event listener for the <code><a href="cordova_events_events.md.html#startcallbutton">startcallbutton</a></code> event.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="startcallbutton_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+</ul>
+<h2>
+<a name="startcallbutton_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#startcallbutton">startcallbutton</a>", onStartCallKeyDown, false);
+
+function onStartCallKeyDown() {
+ // Handle the start call button
+}
+</code></pre>
+
+<h2>
+<a name="startcallbutton_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Start Call Button Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Register the event listener
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#startcallbutton">startcallbutton</a>", onStartCallKeyDown, false);
+ }
+
+ // Handle the start call button
+ //
+ function onStartCallKeyDown() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="endcallbutton">endcallbutton</a></h1>
+
+<p>This event fires when the user presses the end call button.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#endcallbutton">endcallbutton</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="endcallbutton_details">Details</a>
+</h2>
+
+<p>The event overrides the default end call behavior.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="endcallbutton_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+</ul>
+<h2>
+<a name="endcallbutton_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#endcallbutton">endcallbutton</a>", onEndCallKeyDown, false);
+
+function onEndCallKeyDown() {
+ // Handle the end call button
+}
+</code></pre>
+
+<h2>
+<a name="endcallbutton_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>End Call Button Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Register the event listener
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#endcallbutton">endcallbutton</a>", onEndCallKeyDown, false);
+ }
+
+ // Handle the end call button
+ //
+ function onEndCallKeyDown() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="volumedownbutton">volumedownbutton</a></h1>
+
+<p>The event fires when the user presses the volume down button.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#volumedownbutton">volumedownbutton</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="volumedownbutton_details">Details</a>
+</h2>
+
+<p>If you need to override the default volume down behavior you can
+register an event listener for the <code><a href="cordova_events_events.md.html#volumedownbutton">volumedownbutton</a></code> event.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="volumedownbutton_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+</ul>
+<h2>
+<a name="volumedownbutton_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#volumedownbutton">volumedownbutton</a>", onVolumeDownKeyDown, false);
+
+function onVolumeDownKeyDown() {
+ // Handle the volume down button
+}
+</code></pre>
+
+<h2>
+<a name="volumedownbutton_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Volume Down Button Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Register the event listener
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#volumedownbutton">volumedownbutton</a>", onVolumeDownKeyDown, false);
+ }
+
+ // Handle the volume down button
+ //
+ function onVolumeDownKeyDown() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+<hr>
+<h1><a name="volumeupbutton">volumeupbutton</a></h1>
+
+<p>The event fires when the user presses the volume up button.</p>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#volumeupbutton">volumeupbutton</a>", yourCallbackFunction, false);
+</code></pre>
+
+<h2>
+<a name="volumeupbutton_details">Details</a>
+</h2>
+
+<p>If you need to override the default volume up behavior you can
+register an event listener for the <code><a href="cordova_events_events.md.html#volumeupbutton">volumeupbutton</a></code> event.</p>
+
+<p>Applications typically should use <code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a></code> to
+attach an event listener once the <code><a href="cordova_events_events.md.html#deviceready">deviceready</a></code> event fires.</p>
+
+<h2>
+<a name="volumeupbutton_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+</ul>
+<h2>
+<a name="volumeupbutton_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#volumeupbutton">volumeupbutton</a>", onVolumeUpKeyDown, false);
+
+function onVolumeUpKeyDown() {
+ // Handle the volume up button
+}
+</code></pre>
+
+<h2>
+<a name="volumeupbutton_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Volume Up Button Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ function onLoad() {
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Register the event listener
+ document.<a href="cordova_inappbrowser_inappbrowser.md.html#addEventListener">addEventListener</a>("<a href="cordova_events_events.md.html#volumeupbutton">volumeupbutton</a>", onVolumeUpKeyDown, false);
+ }
+
+ // Handle the volume up button
+ //
+ function onVolumeUpKeyDown() {
+ }
+
+ </script>
+ </head>
+ <body onload="onLoad()">
+ </body>
+</html>
+</code></pre>
+
+ </div>
+ </div>
+
+ <!-- Functionality and Syntax Highlighting -->
+ <script type="text/javascript" src="index.js"></script><script type="text/javascript" src="prettify/prettify.js"></script>
+</body>
+</html>