cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject svn commit: r1527865 [3/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...
Date Tue, 01 Oct 2013 03:56:01 GMT
Added: cordova/site/public/docs/en/3.1.0/cordova_compass_compass.md.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/3.1.0/cordova_compass_compass.md.html?rev=1527865&view=auto
==============================================================================
--- cordova/site/public/docs/en/3.1.0/cordova_compass_compass.md.html (added)
+++ cordova/site/public/docs/en/3.1.0/cordova_compass_compass.md.html Tue Oct  1 03:55:57 2013
@@ -0,0 +1,726 @@
+<!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>Compass</h1>
+            <small><select><option value="Compass">Compass</option>
+<option value="Compass_methods">      - Methods</option>
+<option value="Compass_arguments">      - Arguments</option>
+<option value="Compass_accessing_the_feature">      - Accessing the Feature</option>
+<option value="compass.getCurrentHeading">compass.getCurrentHeading</option>
+<option value="compass.getCurrentHeading_description">      - Description</option>
+<option value="compass.getCurrentHeading_supported_platforms">      - Supported Platforms</option>
+<option value="compass.getCurrentHeading_quick_example">      - Quick Example</option>
+<option value="compass.getCurrentHeading_full_example">      - Full Example</option>
+<option value="compass.watchHeading">compass.watchHeading</option>
+<option value="compass.watchHeading_description">      - Description</option>
+<option value="compass.watchHeading_supported_platforms">      - Supported Platforms</option>
+<option value="compass.watchHeading_quick_example">      - Quick Example</option>
+<option value="compass.watchHeading_full_example">      - Full Example</option>
+<option value="compass.watchHeading_ios_quirks">      - iOS Quirks</option>
+<option value="compass.clearWatch">compass.clearWatch</option>
+<option value="compass.clearWatch_supported_platforms">      - Supported Platforms</option>
+<option value="compass.clearWatch_quick_example">      - Quick Example</option>
+<option value="compass.clearWatch_full_example">      - Full Example</option>
+<option value="compass.watchHeadingFilter">compass.watchHeadingFilter</option>
+<option value="compass.clearWatchFilter">compass.clearWatchFilter</option>
+<option value="compassSuccess">compassSuccess</option>
+<option value="compassSuccess_parameters">      - Parameters</option>
+<option value="compassSuccess_example">      - Example</option>
+<option value="compassError">compassError</option>
+<option value="compassError_example">      - Example</option>
+<option value="compassOptions">compassOptions</option>
+<option value="compassOptions_options">      - Options</option>
+<option value="compassOptions_tizen_quirks">      - Tizen Quirks</option>
+<option value="compassOptions_windows_phone_7_and_8_quirks">      - Windows Phone 7 and 8 Quirks</option>
+<option value="compassHeading">compassHeading</option>
+<option value="compassHeading_properties">      - Properties</option>
+<option value="compassHeading_description">      - Description</option>
+<option value="compassHeading_android_quirks">      - Android Quirks</option>
+<option value="compassHeading_ios_quirks">      - iOS Quirks</option>
+<option value="CompassError">CompassError</option>
+<option value="CompassError_properties">      - Properties</option>
+<option value="CompassError_constants">      - Constants</option>
+<option value="CompassError_description">      - Description</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="Compass">Compass</a></h1>
+
+<blockquote>
+  <p>Obtains the direction that the device is pointing.</p>
+</blockquote>
+
+<h2>
+<a name="Compass_methods">Methods</a>
+</h2>
+
+<ul>
+<li><a href="cordova_compass_compass.md.html#compass.getCurrentHeading">compass.getCurrentHeading</a></li>
+<li><a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a></li>
+<li><a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a></li>
+<li>
+<a href="cordova_compass_compass.md.html#compass.watchHeadingFilter">compass.watchHeadingFilter</a> (obsolete)</li>
+<li>
+<a href="cordova_compass_compass.md.html#compass.clearWatchFilter">compass.clearWatchFilter</a>   (obsolete)</li>
+</ul>
+<h2>
+<a name="Compass_arguments">Arguments</a>
+</h2>
+
+<ul>
+<li><a href="cordova_compass_compass.md.html#compassSuccess">compassSuccess</a></li>
+<li><a href="cordova_compass_compass.md.html#compassError">compassError</a></li>
+<li><a href="cordova_compass_compass.md.html#compassOptions">compassOptions</a></li>
+<li><a href="cordova_compass_compass.md.html#compassHeading">compassHeading</a></li>
+</ul>
+<h2>
+<a name="Compass_accessing_the_feature">Accessing the Feature</a>
+</h2>
+
+<p>As of version 3.0, Cordova implements device-level APIs as <em>plugins</em>.
+Use the CLI's <code>plugin</code> command, described in <a href="#The%20Command-line%0AInterface">The Command-line
+Interface</a>, to add or remove this feature for a project:</p>
+
+<pre class="prettyprint"><code>    $ cordova plugin add org.apache.cordova.device-orientation
+    $ cordova plugin ls
+    [ 'org.apache.cordova.device-orientation' ]
+    $ cordova plugin rm org.apache.cordova.device-orientation
+</code></pre>
+
+<p>These commands apply to all targeted platforms, but modify the
+platform-specific configuration settings described below:</p>
+
+<ul>
+<li>
+<p>Android (in <code>app/res/xml/config.xml</code>)</p>
+
+<pre class="prettyprint"><code>&lt;feature name="<a href="cordova_compass_compass.md.html#Compass">Compass</a>"&gt;
+    &lt;param name="android-package" value="org.apache.cordova.CompassListener" /&gt;
+&lt;/feature&gt;
+</code></pre>
+</li>
+<li>
+<p>iOS (in <code>config.xml</code>)</p>
+
+<pre class="prettyprint"><code>&lt;feature name="<a href="cordova_compass_compass.md.html#Compass">Compass</a>"&gt;
+    &lt;param name="ios-package" value="CDVLocation" /&gt;
+&lt;/feature&gt;
+</code></pre>
+</li>
+<li>
+<p>Windows Phone (in <code>Properties/WPAppManifest.xml</code>)</p>
+
+<pre class="prettyprint"><code>&lt;Capabilities&gt;
+    &lt;Capability Name="ID_CAP_SENSORS" /&gt;
+&lt;/Capabilities&gt;
+</code></pre>
+
+<p>Reference: <a class="external" href="http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx">Application Manifest for Windows Phone</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="compass.getCurrentHeading">compass.getCurrentHeading</a></h1>
+
+<p>Get the current compass heading.</p>
+
+<pre class="prettyprint"><code>navigator.<a href="cordova_compass_compass.md.html#compass.getCurrentHeading">compass.getCurrentHeading</a>(<a href="cordova_compass_compass.md.html#compassSuccess">compassSuccess</a>, <a href="cordova_compass_compass.md.html#compassError">compassError</a>, <a href="cordova_compass_compass.md.html#compassOptions">compassOptions</a>);
+</code></pre>
+
+<h2>
+<a name="compass.getCurrentHeading_description">Description</a>
+</h2>
+
+<p>The compass is a sensor that detects the direction or heading that the
+device is pointed, typically from the top of the device.  It measures
+the heading in degrees from 0 to 359.99, where 0 is north.</p>
+
+<p>The compass heading information is returned via a <code>CompassHeading</code>
+object using the <code><a href="cordova_compass_compass.md.html#compassSuccess">compassSuccess</a></code> callback function.</p>
+
+<h2>
+<a name="compass.getCurrentHeading_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry 10</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8 (if available in hardware)</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="compass.getCurrentHeading_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>function onSuccess(heading) {
+    alert('Heading: ' + heading.magneticHeading);
+};
+
+function onError(error) {
+    alert('<a href="cordova_compass_compass.md.html#CompassError">CompassError</a>: ' + error.code);
+};
+
+navigator.<a href="cordova_compass_compass.md.html#compass.getCurrentHeading">compass.getCurrentHeading</a>(onSuccess, onError);
+</code></pre>
+
+<h2>
+<a name="compass.getCurrentHeading_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code>&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;<a href="cordova_compass_compass.md.html#Compass">Compass</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="cordova.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // Wait for device API libraries to load
+    //
+    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() {
+        navigator.<a href="cordova_compass_compass.md.html#compass.getCurrentHeading">compass.getCurrentHeading</a>(onSuccess, onError);
+    }
+
+    // onSuccess: Get the current heading
+    //
+    function onSuccess(heading) {
+        alert('Heading: ' + heading.magneticHeading);
+    }
+
+    // onError: Failed to get the heading
+    //
+    function onError(<a href="cordova_compass_compass.md.html#compassError">compassError</a>) {
+        alert('<a href="cordova_compass_compass.md.html#Compass">Compass</a> Error: ' + <a href="cordova_compass_compass.md.html#compassError">compassError</a>.code);
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;h1&gt;Example&lt;/h1&gt;
+    &lt;p&gt;getCurrentHeading&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<hr>
+<h1><a name="compass.watchHeading">compass.watchHeading</a></h1>
+
+<p>At a regular interval, get the compass heading in degrees.</p>
+
+<pre class="prettyprint"><code>var watchID = navigator.<a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a>(<a href="cordova_compass_compass.md.html#compassSuccess">compassSuccess</a>, <a href="cordova_compass_compass.md.html#compassError">compassError</a>, [<a href="cordova_compass_compass.md.html#compassOptions">compassOptions</a>]);
+</code></pre>
+
+<h2>
+<a name="compass.watchHeading_description">Description</a>
+</h2>
+
+<p>The compass is a sensor that detects the direction or heading that the
+device is pointed.  It measures the heading in degrees from 0 to
+359.99.</p>
+
+<p>The <code><a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a></code> gets the device's current heading at a
+regular interval. Each time the heading is retrieved, the
+<code>headingSuccess</code> callback function is executed. Specify the interval
+in milliseconds via the <code>frequency</code> parameter in the <code><a href="cordova_compass_compass.md.html#compassOptions">compassOptions</a></code>
+object.</p>
+
+<p>The returned watch ID references the compass watch interval. The watch
+ID can be used with <code><a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a></code> to stop watching the compass.</p>
+
+<h2>
+<a name="compass.watchHeading_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry 10</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8 (if available in hardware)</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="compass.watchHeading_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>function onSuccess(heading) {
+    var element = document.getElementById('heading');
+    element.innerHTML = 'Heading: ' + heading.magneticHeading;
+};
+
+function onError(<a href="cordova_compass_compass.md.html#compassError">compassError</a>) {
+    alert('<a href="cordova_compass_compass.md.html#Compass">Compass</a> error: ' + <a href="cordova_compass_compass.md.html#compassError">compassError</a>.code);
+};
+
+var options = {
+    frequency: 3000
+}; // Update every 3 seconds
+
+var watchID = navigator.<a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a>(onSuccess, onError, options);
+</code></pre>
+
+<h2>
+<a name="compass.watchHeading_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code>&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;<a href="cordova_compass_compass.md.html#Compass">Compass</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="cordova.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // The watch id references the current `watchHeading`
+    var watchID = null;
+
+    // Wait for device API libraries to load
+    //
+    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() {
+        startWatch();
+    }
+
+    // Start watching the compass
+    //
+    function startWatch() {
+
+        // Update compass every 3 seconds
+        var options = { frequency: 3000 };
+
+        watchID = navigator.<a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a>(onSuccess, onError, options);
+    }
+
+    // Stop watching the compass
+    //
+    function stopWatch() {
+        if (watchID) {
+            navigator.<a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a>(watchID);
+            watchID = null;
+        }
+    }
+
+    // onSuccess: Get the current heading
+    //
+    function onSuccess(heading) {
+        var element = document.getElementById('heading');
+        element.innerHTML = 'Heading: ' + heading.magneticHeading;
+    }
+
+    // onError: Failed to get the heading
+    //
+    function onError(<a href="cordova_compass_compass.md.html#compassError">compassError</a>) {
+        alert('<a href="cordova_compass_compass.md.html#Compass">Compass</a> error: ' + <a href="cordova_compass_compass.md.html#compassError">compassError</a>.code);
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;div id="heading"&gt;Waiting for heading...&lt;/div&gt;
+    &lt;button onclick="startWatch();"&gt;Start Watching&lt;/button&gt;
+    &lt;button onclick="stopWatch();"&gt;Stop Watching&lt;/button&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2>
+<a name="compass.watchHeading_ios_quirks">iOS Quirks</a>
+</h2>
+
+<p>In iOS <code><a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a></code> can also get the device's current
+heading when it changes by a specified number of degrees. Each time
+the heading changes by the specified number of degrees or more, the
+<code>headingSuccess</code> callback function executes. Specify the degrees of
+change via the <code>filter</code> parameter in the <code><a href="cordova_compass_compass.md.html#compassOptions">compassOptions</a></code> object.
+Clear the watch as usual by passing the returned watch ID to
+<code><a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a></code>.  This functionality replaces the previously
+separate, iOS-only <code>watchHeadingFilter</code> and <code>clearWatchFilter</code>
+functions, which were removed in version 1.6.</p>
+
+<p>Only one <code>watchHeading</code> can be in effect at one time in iOS.  If a
+<code>watchHeading</code> uses a filter, calling <code>getCurrentHeading</code> or
+<code>watchHeading</code> uses the existing filter value to specify heading
+changes. Watching heading changes with a filter is more efficient than
+with time intervals.</p>
+
+<hr>
+<h1><a name="compass.clearWatch">compass.clearWatch</a></h1>
+
+<p>Stop watching the compass referenced by the watch ID parameter.</p>
+
+<pre class="prettyprint"><code>navigator.<a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a>(watchID);
+</code></pre>
+
+<ul>
+<li>
+<strong>watchID</strong>: The ID returned by <code><a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a></code>.</li>
+</ul>
+<h2>
+<a name="compass.clearWatch_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry 10</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8 (if available in hardware)</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="compass.clearWatch_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>var watchID = navigator.<a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a>(onSuccess, onError, options);
+
+// ... later on ...
+
+navigator.<a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a>(watchID);
+</code></pre>
+
+<h2>
+<a name="compass.clearWatch_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code>&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;<a href="cordova_compass_compass.md.html#Compass">Compass</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="cordova.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // The watch id references the current `watchHeading`
+    var watchID = null;
+
+    // Wait for device API libraries to load
+    //
+    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() {
+        startWatch();
+    }
+
+    // Start watching the compass
+    //
+    function startWatch() {
+
+        // Update compass every 3 seconds
+        var options = { frequency: 3000 };
+
+        watchID = navigator.<a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a>(onSuccess, onError, options);
+    }
+
+    // Stop watching the compass
+    //
+    function stopWatch() {
+        if (watchID) {
+            navigator.<a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a>(watchID);
+            watchID = null;
+        }
+    }
+
+    // onSuccess: Get the current heading
+    //
+    function onSuccess(heading) {
+        var element = document.getElementById('heading');
+        element.innerHTML = 'Heading: ' + heading.magneticHeading;
+    }
+
+    // onError: Failed to get the heading
+    //
+    function onError(<a href="cordova_compass_compass.md.html#compassError">compassError</a>) {
+        alert('<a href="cordova_compass_compass.md.html#Compass">Compass</a> error: ' + <a href="cordova_compass_compass.md.html#compassError">compassError</a>.code);
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;div id="heading"&gt;Waiting for heading...&lt;/div&gt;
+    &lt;button onclick="startWatch();"&gt;Start Watching&lt;/button&gt;
+    &lt;button onclick="stopWatch();"&gt;Stop Watching&lt;/button&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<hr>
+<h1><a name="compass.watchHeadingFilter">compass.watchHeadingFilter</a></h1>
+
+<p>No longer supported as of 1.6, see <code><a href="cordova_compass_compass.md.html#compass.watchHeading">compass.watchHeading</a></code> for equivalent functionality.</p>
+
+<hr>
+<h1><a name="compass.clearWatchFilter">compass.clearWatchFilter</a></h1>
+
+<p>No longer supported as of 1.6.  See <code><a href="cordova_compass_compass.md.html#compass.clearWatch">compass.clearWatch</a></code>.</p>
+
+<hr>
+<h1><a name="compassSuccess">compassSuccess</a></h1>
+
+<p>onSuccess callback function that provides the compass heading information via a <code><a href="cordova_compass_compass.md.html#compassHeading">compassHeading</a></code> object.</p>
+
+<pre class="prettyprint"><code>function(heading) {
+    // Do something
+}
+</code></pre>
+
+<h2>
+<a name="compassSuccess_parameters">Parameters</a>
+</h2>
+
+<ul>
+<li>
+<strong>heading</strong>: The heading information. <em>(<a href="cordova_compass_compass.md.html#compassHeading">compassHeading</a>)</em>
+</li>
+</ul>
+<h2>
+<a name="compassSuccess_example">Example</a>
+</h2>
+
+<pre class="prettyprint"><code>function onSuccess(heading) {
+    alert('Heading: ' + heading.magneticHeading);
+};
+</code></pre>
+
+<hr>
+<h1><a name="compassError">compassError</a></h1>
+
+<p>onError callback function for compass functions.</p>
+
+<h2>
+<a name="compassError_example">Example</a>
+</h2>
+
+<pre class="prettyprint"><code>function(<a href="cordova_compass_compass.md.html#CompassError">CompassError</a>) {
+    // Handle the error
+}
+</code></pre>
+
+<hr>
+<h1><a name="compassOptions">compassOptions</a></h1>
+
+<p>An optional parameter to customize the retrieval of the compass.</p>
+
+<h2>
+<a name="compassOptions_options">Options</a>
+</h2>
+
+<ul>
+<li><p><strong>frequency</strong>: How often to retrieve the compass heading in milliseconds. <em>(Number)</em> (Default: 100)</p></li>
+<li><p><strong>filter</strong>: The change in degrees required to initiate a watchHeading success callback. <em>(Number)</em></p></li>
+</ul>
+<p>Android Quirks</p>
+
+<hr>
+<ul>
+<li>
+<code>filter</code> is not supported.</li>
+</ul>
+<h2>
+<a name="compassOptions_tizen_quirks">Tizen Quirks</a>
+</h2>
+
+<ul>
+<li>
+<code>filter</code> is not supported.</li>
+</ul>
+<h2>
+<a name="compassOptions_windows_phone_7_and_8_quirks">Windows Phone 7 and 8 Quirks</a>
+</h2>
+
+<ul>
+<li>
+<code>filter</code> is not supported.</li>
+</ul>
+<hr>
+<h1><a name="compassHeading">compassHeading</a></h1>
+
+<p>A <code>CompassHeading</code> object is returned to the <code><a href="cordova_compass_compass.md.html#compassSuccess">compassSuccess</a></code> callback function.</p>
+
+<h2>
+<a name="compassHeading_properties">Properties</a>
+</h2>
+
+<ul>
+<li><p><strong>magneticHeading</strong>: The heading in degrees from 0-359.99 at a single moment in time. <em>(Number)</em></p></li>
+<li><p><strong>trueHeading</strong>: The heading relative to the geographic North Pole in degrees 0-359.99 at a single moment in time. A negative value indicates that the true heading cannot be determined.  <em>(Number)</em></p></li>
+<li><p><strong>headingAccuracy</strong>: The deviation in degrees between the reported heading and the true heading. <em>(Number)</em></p></li>
+<li><p><strong>timestamp</strong>: The time at which this heading was determined.  <em>(milliseconds)</em></p></li>
+</ul>
+<h2>
+<a name="compassHeading_description">Description</a>
+</h2>
+
+<p>The <code>CompassHeading</code> object is returned to the <code><a href="cordova_compass_compass.md.html#compassSuccess">compassSuccess</a></code> callback function.</p>
+
+<h2>
+<a name="compassHeading_android_quirks">Android Quirks</a>
+</h2>
+
+<ul>
+<li><p><code>trueHeading</code> is not supported, but reports the same value as <code>magneticHeading</code></p></li>
+<li><p><code>headingAccuracy</code> is always 0 because there is no difference between the <code>magneticHeading</code> and <code>trueHeading</code>.</p></li>
+</ul>
+<h2>
+<a name="compassHeading_ios_quirks">iOS Quirks</a>
+</h2>
+
+<ul>
+<li><p><code>trueHeading</code> is only returned when location services are enabled via <code>navigator.geolocation.watchLocation()</code></p></li>
+<li><p>For iOS 4 devices and above, heading factors in the device's current orientation, not in reference to its absolute position, for apps that supports that orientation.</p></li>
+</ul>
+<hr>
+<h1><a name="CompassError">CompassError</a></h1>
+
+<p>A <code><a href="cordova_compass_compass.md.html#CompassError">CompassError</a></code> object is returned to the <code><a href="cordova_compass_compass.md.html#compassError">compassError</a></code> callback function when an error occurs.</p>
+
+<h2>
+<a name="CompassError_properties">Properties</a>
+</h2>
+
+<ul>
+<li>
+<strong>code</strong>: One of the predefined error codes listed below.</li>
+</ul>
+<h2>
+<a name="CompassError_constants">Constants</a>
+</h2>
+
+<ul>
+<li><code><a href="cordova_compass_compass.md.html#CompassError">CompassError</a>.COMPASS_INTERNAL_ERR</code></li>
+<li><code><a href="cordova_compass_compass.md.html#CompassError">CompassError</a>.COMPASS_NOT_SUPPORTED</code></li>
+</ul>
+<h2>
+<a name="CompassError_description">Description</a>
+</h2>
+
+<p>When an error occurs, the <code><a href="cordova_compass_compass.md.html#CompassError">CompassError</a></code> object is passed as a
+parameter to a <code><a href="cordova_compass_compass.md.html#compassError">compassError</a></code> callback function.</p>
+
+            </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>

Added: cordova/site/public/docs/en/3.1.0/cordova_connection_connection.md.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/3.1.0/cordova_connection_connection.md.html?rev=1527865&view=auto
==============================================================================
--- cordova/site/public/docs/en/3.1.0/cordova_connection_connection.md.html (added)
+++ cordova/site/public/docs/en/3.1.0/cordova_connection_connection.md.html Tue Oct  1 03:55:57 2013
@@ -0,0 +1,384 @@
+<!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>Connection</h1>
+            <small><select><option value="Connection">Connection</option>
+<option value="Connection_properties">      - Properties</option>
+<option value="Connection_constants">      - Constants</option>
+<option value="Connection_accessing_the_feature">      - Accessing the Feature</option>
+<option value="connection.type">connection.type</option>
+<option value="connection.type_description">      - Description</option>
+<option value="connection.type_supported_platforms">      - Supported Platforms</option>
+<option value="connection.type_quick_example">      - Quick Example</option>
+<option value="connection.type_full_example">      - Full Example</option>
+<option value="connection.type_api_change">      - API Change</option>
+<option value="connection.type_ios_quirks">      - iOS Quirks</option>
+<option value="connection.type_windows_phone_quirks">      - Windows Phone Quirks</option>
+<option value="connection.type_tizen_quirks">      - Tizen Quirks</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="Connection">Connection</a></h1>
+
+<blockquote>
+  <p>The <code>connection</code> object, exposed via <code>navigator.connection</code>,  provides information about the device's cellular and wifi connection.</p>
+</blockquote>
+
+<h2>
+<a name="Connection_properties">Properties</a>
+</h2>
+
+<ul>
+<li><a href="cordova_connection_connection.md.html#connection.type">connection.type</a></li>
+</ul>
+<h2>
+<a name="Connection_constants">Constants</a>
+</h2>
+
+<ul>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.UNKNOWN</li>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.ETHERNET</li>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.WIFI</li>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_2G</li>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_3G</li>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_4G</li>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL</li>
+<li>
+<a href="cordova_connection_connection.md.html#Connection">Connection</a>.NONE</li>
+</ul>
+<h2>
+<a name="Connection_accessing_the_feature">Accessing the Feature</a>
+</h2>
+
+<p>As of version 3.0, Cordova implements device-level APIs as <em>plugins</em>.
+Use the CLI's <code>plugin</code> command, described in <a href="#The%20Command-line%0AInterface">The Command-line
+Interface</a>, to add or remove this feature for a project:</p>
+
+<pre class="prettyprint"><code>    $ cordova plugin add org.apache.cordova.network-information
+    $ cordova plugin ls
+    [ 'org.apache.cordova.network-information' ]
+    $ cordova plugin rm org.apache.cordova.network-information
+</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)
+&lt;feature name="NetworkStatus"&gt;
+    &lt;param name="android-package" value="org.apache.cordova.NetworkManager" /&gt;
+&lt;/feature&gt;
+
+
+(in app/AndroidManifest.xml)
+&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
+&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
+&lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
+</code></pre>
+</li>
+<li>
+<p>BlackBerry WebWorks</p>
+
+<pre class="prettyprint"><code>(in www/plugins.xml)
+&lt;feature name="Network Status"&gt;
+    &lt;param name="blackberry-package" value="org.apache.cordova.network.Network" /&gt;
+&lt;/feature&gt;
+</code></pre>
+</li>
+<li>
+<p>iOS (in <code>config.xml</code>)</p>
+
+<pre class="prettyprint"><code>&lt;feature name="NetworkStatus"&gt;
+    &lt;param name="ios-package" value="CDVConnection" /&gt;
+&lt;/feature&gt;
+</code></pre>
+</li>
+<li>
+<p>Windows Phone (in <code>Properties/WPAppManifest.xml</code>)</p>
+
+<pre class="prettyprint"><code>&lt;Capabilities&gt;
+    &lt;Capability Name="ID_CAP_NETWORKING" /&gt;
+&lt;/Capabilities&gt;
+</code></pre>
+
+<p>Reference: <a class="external" href="http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx">Application Manifest for Windows Phone</a></p>
+</li>
+<li>
+<p>Tizen (in <code>config.xml</code>)</p>
+
+<pre class="prettyprint"><code>&lt;feature name="http://tizen.org/api/systeminfo" required="true"/&gt;
+</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="connection.type">connection.type</a></h1>
+
+<p>Checks the currently active network connection.</p>
+
+<h2>
+<a name="connection.type_description">Description</a>
+</h2>
+
+<p>This property offers a fast way to determine the device's network
+connection state, and type of connection.</p>
+
+<h2>
+<a name="connection.type_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>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="connection.type_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>function checkConnection() {
+    var networkState = navigator.<a href="cordova_connection_connection.md.html#connection.type">connection.type</a>;
+
+    var states = {};
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.UNKNOWN]  = 'Unknown connection';
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.ETHERNET] = 'Ethernet connection';
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.WIFI]     = 'WiFi connection';
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_2G]  = 'Cell 2G connection';
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_3G]  = 'Cell 3G connection';
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_4G]  = 'Cell 4G connection';
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL]     = 'Cell generic connection';
+    states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.NONE]     = 'No network connection';
+
+    alert('<a href="cordova_connection_connection.md.html#Connection">Connection</a> type: ' + states[networkState]);
+}
+
+checkConnection();
+</code></pre>
+
+<h2>
+<a name="connection.type_full_example">Full Example</a>
+</h2>
+
+<pre class="prettyprint"><code>&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;navigator.<a href="cordova_connection_connection.md.html#connection.type">connection.type</a> Example&lt;/title&gt;
+
+    &lt;script type="text/javascript" charset="utf-8" src="cordova.js"&gt;&lt;/script&gt;
+    &lt;script type="text/javascript" charset="utf-8"&gt;
+
+    // Wait for device API libraries to load
+    //
+    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() {
+        checkConnection();
+    }
+
+        function checkConnection() {
+            var networkState = navigator.<a href="cordova_connection_connection.md.html#connection.type">connection.type</a>;
+
+            var states = {};
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.UNKNOWN]  = 'Unknown connection';
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.ETHERNET] = 'Ethernet connection';
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.WIFI]     = 'WiFi connection';
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_2G]  = 'Cell 2G connection';
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_3G]  = 'Cell 3G connection';
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_4G]  = 'Cell 4G connection';
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL]     = 'Cell generic connection';
+            states[<a href="cordova_connection_connection.md.html#Connection">Connection</a>.NONE]     = 'No network connection';
+
+            alert('<a href="cordova_connection_connection.md.html#Connection">Connection</a> type: ' + states[networkState]);
+        }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p&gt;A dialog box will report the network state.&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2>
+<a name="connection.type_api_change">API Change</a>
+</h2>
+
+<p>Until Cordova 2.3.0, the <code><a href="cordova_connection_connection.md.html#Connection">Connection</a></code> object was accessed via
+<code>navigator.network.connection</code>, after which it was changed to
+<code>navigator.connection</code> to match the W3C specification.  It's still
+available at its original location, but is deprecated and will
+eventually be removed.</p>
+
+<h2>
+<a name="connection.type_ios_quirks">iOS Quirks</a>
+</h2>
+
+<ul>
+<li>iOS cannot detect the type of cellular network connection.
+<ul>
+<li>
+<code>navigator.<a href="cordova_connection_connection.md.html#connection.type">connection.type</a></code> is set to <code><a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL</code> for all cellular data.</li>
+</ul>
+</li>
+</ul>
+<h2>
+<a name="connection.type_windows_phone_quirks">Windows Phone Quirks</a>
+</h2>
+
+<ul>
+<li><p>When running in the emulator, always detects <code>navigator.<a href="cordova_connection_connection.md.html#connection.type">connection.type</a></code> as <code><a href="cordova_connection_connection.md.html#Connection">Connection</a>.UNKNOWN</code>.</p></li>
+<li>
+<p>Windows Phone cannot detect the type of cellular network connection.</p>
+
+<ul>
+<li>
+<code>navigator.<a href="cordova_connection_connection.md.html#connection.type">connection.type</a></code> is set to <code><a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL</code> for all cellular data.</li>
+</ul>
+</li>
+</ul>
+<h2>
+<a name="connection.type_tizen_quirks">Tizen Quirks</a>
+</h2>
+
+<ul>
+<li>Tizen can only detect a WiFi or cellular connection.
+<ul>
+<li>
+<code>navigator.<a href="cordova_connection_connection.md.html#connection.type">connection.type</a></code> is set to <code><a href="cordova_connection_connection.md.html#Connection">Connection</a>.CELL_2G</code> for all cellular data.</li>
+</ul>
+</li>
+</ul>
+</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>



Mime
View raw message