cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject svn commit: r1746983 [14/16] - in /cordova/site/public: ./ announcements/2016/06/ announcements/2016/06/03/ blog/ docs/en/dev/ docs/en/dev/config_ref/ docs/en/dev/cordova/events/ docs/en/dev/cordova/storage/ docs/en/dev/guide/appdev/hooks/ docs/en/dev/...
Date Mon, 06 Jun 2016 10:43:19 GMT
Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-media/index.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-media/index.html?rev=1746983&r1=1746982&r2=1746983&view=diff
==============================================================================
--- cordova/site/public/docs/en/dev/reference/cordova-plugin-media/index.html (original)
+++ cordova/site/public/docs/en/dev/reference/cordova-plugin-media/index.html Mon Jun  6 10:43:18 2016
@@ -6,12 +6,12 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <meta name="format-detection" content="telephone=no">
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
-    <meta name="description" content=" ">
+    <meta name="description" content="Record and play audio on the device. ">
 
     <title>
         
             
-                cordova-plugin-media - Apache Cordova
+                Media - Apache Cordova
             
         
     </title>
@@ -732,7 +732,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-                cordova-plugin-battery-status
+                Battery Status
             </a>
             
         
@@ -747,7 +747,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-camera/index.html">
-                cordova-plugin-camera
+                Camera
             </a>
             
         
@@ -762,7 +762,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-console/index.html">
-                cordova-plugin-console
+                Console
             </a>
             
         
@@ -777,7 +777,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-                cordova-plugin-contacts
+                Contacts
             </a>
             
         
@@ -792,7 +792,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device/index.html">
-                cordova-plugin-device
+                Device
             </a>
             
         
@@ -807,7 +807,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-                cordova-plugin-device-motion
+                Device Motion
             </a>
             
         
@@ -822,7 +822,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-                cordova-plugin-device-orientation
+                Device Orientation
             </a>
             
         
@@ -837,7 +837,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-dialogs/index.html">
-                cordova-plugin-dialogs
+                Dialogs
             </a>
             
         
@@ -852,7 +852,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-file/index.html">
-                cordova-plugin-file
+                File
             </a>
             
         
@@ -867,7 +867,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-file-transfer/index.html">
-                cordova-plugin-file-transfer
+                File Transfer
             </a>
             
         
@@ -882,7 +882,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-                cordova-plugin-geolocation
+                Geolocation
             </a>
             
         
@@ -897,7 +897,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-                cordova-plugin-globalization
+                Globalization
             </a>
             
         
@@ -912,7 +912,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-                cordova-plugin-inappbrowser
+                Inappbrowser
             </a>
             
         
@@ -927,7 +927,7 @@
     <li>
         
             <a class="this-page" href="../../reference/cordova-plugin-media/index.html">
-                cordova-plugin-media
+                Media
             </a>
             
                 <span class="entry-highlight"></span>
@@ -944,7 +944,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-                cordova-plugin-media-capture
+                Media Capture
             </a>
             
         
@@ -959,7 +959,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-network-information/index.html">
-                cordova-plugin-network-information
+                Network Information
             </a>
             
         
@@ -974,7 +974,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-                cordova-plugin-splashscreen
+                Splashscreen
             </a>
             
         
@@ -989,7 +989,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-                cordova-plugin-vibration
+                Vibration
             </a>
             
         
@@ -1004,7 +1004,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-                cordova-plugin-statusbar
+                Statusbar
             </a>
             
         
@@ -1019,7 +1019,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-                cordova-plugin-whitelist
+                Whitelist
             </a>
             
         
@@ -1034,7 +1034,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-                cordova-plugin-legacy-whitelist
+                Legacy Whitelist
             </a>
             
         
@@ -1388,7 +1388,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-        cordova-plugin-battery-status
+        Battery Status
     </a>
 </li>
 
@@ -1397,7 +1397,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-camera/index.html">
-        cordova-plugin-camera
+        Camera
     </a>
 </li>
 
@@ -1406,7 +1406,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-console/index.html">
-        cordova-plugin-console
+        Console
     </a>
 </li>
 
@@ -1415,7 +1415,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-        cordova-plugin-contacts
+        Contacts
     </a>
 </li>
 
@@ -1424,7 +1424,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device/index.html">
-        cordova-plugin-device
+        Device
     </a>
 </li>
 
@@ -1433,7 +1433,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-        cordova-plugin-device-motion
+        Device Motion
     </a>
 </li>
 
@@ -1442,7 +1442,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-        cordova-plugin-device-orientation
+        Device Orientation
     </a>
 </li>
 
@@ -1451,7 +1451,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-dialogs/index.html">
-        cordova-plugin-dialogs
+        Dialogs
     </a>
 </li>
 
@@ -1460,7 +1460,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-file/index.html">
-        cordova-plugin-file
+        File
     </a>
 </li>
 
@@ -1469,7 +1469,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-file-transfer/index.html">
-        cordova-plugin-file-transfer
+        File Transfer
     </a>
 </li>
 
@@ -1478,7 +1478,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-        cordova-plugin-geolocation
+        Geolocation
     </a>
 </li>
 
@@ -1487,7 +1487,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-        cordova-plugin-globalization
+        Globalization
     </a>
 </li>
 
@@ -1496,7 +1496,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-        cordova-plugin-inappbrowser
+        Inappbrowser
     </a>
 </li>
 
@@ -1505,7 +1505,7 @@
 
 <li>
     <a class="this-page" href="../../reference/cordova-plugin-media/index.html">
-        cordova-plugin-media
+        Media
     </a>
 </li>
 
@@ -1514,7 +1514,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-        cordova-plugin-media-capture
+        Media Capture
     </a>
 </li>
 
@@ -1523,7 +1523,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-network-information/index.html">
-        cordova-plugin-network-information
+        Network Information
     </a>
 </li>
 
@@ -1532,7 +1532,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-        cordova-plugin-splashscreen
+        Splashscreen
     </a>
 </li>
 
@@ -1541,7 +1541,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-        cordova-plugin-vibration
+        Vibration
     </a>
 </li>
 
@@ -1550,7 +1550,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-        cordova-plugin-statusbar
+        Statusbar
     </a>
 </li>
 
@@ -1559,7 +1559,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-        cordova-plugin-whitelist
+        Whitelist
     </a>
 </li>
 
@@ -1568,7 +1568,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-        cordova-plugin-legacy-whitelist
+        Legacy Whitelist
     </a>
 </li>
 
@@ -2702,15 +2702,15 @@ and may deprecate the current APIs.</p>
 <p>This plugin defines a global <code>Media</code> Constructor.</p>
 
 <p>Although in the global scope, it is not available until after the <code>deviceready</code> event.</p>
-<div class="highlight"><pre><code class="language-" data-lang="">document.addEventListener("deviceready", onDeviceReady, false);
-function onDeviceReady() {
-    console.log(Media);
-}
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">document</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s2">"deviceready"</span><span class="p">,</span> <span class="nx">onDeviceReady</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
+<span class="kd">function</span> <span class="nx">onDeviceReady</span><span class="p">()</span> <span class="p">{</span>
+    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">Media</span><span class="p">);</span>
+<span class="p">}</span>
 </code></pre></div>
 <p>Report issues with this plugin on the <a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Media%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC">Apache Cordova issue tracker</a></p>
 
 <h2>Installation</h2>
-<div class="highlight"><pre><code class="language-" data-lang="">cordova plugin add cordova-plugin-media
+<div class="highlight"><pre><code class="language-bash" data-lang="bash">cordova plugin add cordova-plugin-media
 </code></pre></div>
 <h2>Supported Platforms</h2>
 
@@ -2732,7 +2732,7 @@ function onDeviceReady() {
 </ul>
 
 <h2>Media</h2>
-<div class="highlight"><pre><code class="language-" data-lang="">var media = new Media(src, mediaSuccess, [mediaError], [mediaStatus]);
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">var</span> <span class="nx">media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span> <span class="nx">mediaSuccess</span><span class="p">,</span> <span class="p">[</span><span class="nx">mediaError</span><span class="p">],</span> <span class="p">[</span><span class="nx">mediaStatus</span><span class="p">]);</span>
 </code></pre></div>
 <h3>Parameters</h3>
 
@@ -2762,11 +2762,14 @@ function onDeviceReady() {
 <h3>Methods</h3>
 
 <ul>
+<li><p><code>media.getCurrentAmplitude</code>: Returns the current position within an audio file.</p></li>
 <li><p><code>media.getCurrentPosition</code>: Returns the current position within an audio file.</p></li>
 <li><p><code>media.getDuration</code>: Returns the duration of an audio file.</p></li>
 <li><p><code>media.play</code>: Start or resume playing an audio file.</p></li>
 <li><p><code>media.pause</code>: Pause playback of an audio file.</p></li>
+<li><p><code>media.pauseRecord</code>: Pause recording of an audio file.</p></li>
 <li><p><code>media.release</code>: Releases the underlying operating system&#39;s audio resources.</p></li>
+<li><p><code>media.resumeRecord</code>: Resume recording of an audio file.</p></li>
 <li><p><code>media.seekTo</code>: Moves the position within the audio file.</p></li>
 <li><p><code>media.setVolume</code>: Set the volume for audio playback.</p></li>
 <li><p><code>media.startRecord</code>: Start recording an audio file.</p></li>
@@ -2785,6 +2788,47 @@ function onDeviceReady() {
 <li><p><strong>duration</strong>: The duration of the media, in seconds.</p></li>
 </ul>
 
+<h2>media.getCurrentAmplitude</h2>
+
+<p>Returns the current amplitude of the current recording.</p>
+<div class="highlight"><pre><code class="language-" data-lang="">media.getCurrentAmplitude(mediaSuccess, [mediaError]);
+</code></pre></div>
+<h3>Supported Platforms</h3>
+
+<ul>
+<li>Android</li>
+<li>iOS</li>
+</ul>
+
+<h3>Parameters</h3>
+
+<ul>
+<li><p><strong>mediaSuccess</strong>: The callback that is passed the current amplitude (0.0 - 1.0).</p></li>
+<li><p><strong>mediaError</strong>: (Optional) The callback to execute if an error occurs.</p></li>
+</ul>
+
+<h3>Quick Example</h3>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Audio player</span>
+<span class="c1">//</span>
+<span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span> <span class="nx">onSuccess</span><span class="p">,</span> <span class="nx">onError</span><span class="p">);</span>
+
+<span class="c1">// Record audio</span>
+<span class="nx">my_media</span><span class="p">.</span><span class="nx">startRecord</span><span class="p">();</span>
+
+<span class="nx">mediaTimer</span> <span class="o">=</span> <span class="nx">setInterval</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
+    <span class="c1">// get media amplitude</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">getCurrentAmplitude</span><span class="p">(</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span> <span class="p">(</span><span class="nx">amp</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">amp</span> <span class="o">+</span> <span class="s2">"%"</span><span class="p">);</span>
+        <span class="p">},</span>
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Error getting amp="</span> <span class="o">+</span> <span class="nx">e</span><span class="p">);</span>
+        <span class="p">}</span>
+    <span class="p">);</span>
+<span class="p">},</span> <span class="mi">1000</span><span class="p">);</span>
+</code></pre></div>
 <h2>media.getCurrentPosition</h2>
 
 <p>Returns the current position within an audio file.  Also updates the <code>Media</code> object&#39;s <code>position</code> parameter.</p>
@@ -2798,26 +2842,26 @@ function onDeviceReady() {
 </ul>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Audio player
-//
-var my_media = new Media(src, onSuccess, onError);
-
-// Update media position every second
-var mediaTimer = setInterval(function () {
-    // get media position
-    my_media.getCurrentPosition(
-        // success callback
-        function (position) {
-            if (position &gt; -1) {
-                console.log((position) + " sec");
-            }
-        },
-        // error callback
-        function (e) {
-            console.log("Error getting pos=" + e);
-        }
-    );
-}, 1000);
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Audio player</span>
+<span class="c1">//</span>
+<span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span> <span class="nx">onSuccess</span><span class="p">,</span> <span class="nx">onError</span><span class="p">);</span>
+
+<span class="c1">// Update media position every second</span>
+<span class="kd">var</span> <span class="nx">mediaTimer</span> <span class="o">=</span> <span class="nx">setInterval</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
+    <span class="c1">// get media position</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">getCurrentPosition</span><span class="p">(</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span> <span class="p">(</span><span class="nx">position</span><span class="p">)</span> <span class="p">{</span>
+            <span class="k">if</span> <span class="p">(</span><span class="nx">position</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+                <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">((</span><span class="nx">position</span><span class="p">)</span> <span class="o">+</span> <span class="s2">" sec"</span><span class="p">);</span>
+            <span class="p">}</span>
+        <span class="p">},</span>
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Error getting pos="</span> <span class="o">+</span> <span class="nx">e</span><span class="p">);</span>
+        <span class="p">}</span>
+    <span class="p">);</span>
+<span class="p">},</span> <span class="mi">1000</span><span class="p">);</span>
 </code></pre></div>
 <h2>media.getDuration</h2>
 
@@ -2825,23 +2869,23 @@ var mediaTimer = setInterval(function ()
 <div class="highlight"><pre><code class="language-" data-lang="">media.getDuration();
 </code></pre></div>
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Audio player
-//
-var my_media = new Media(src, onSuccess, onError);
-
-// Get duration
-var counter = 0;
-var timerDur = setInterval(function() {
-    counter = counter + 100;
-    if (counter &gt; 2000) {
-        clearInterval(timerDur);
-    }
-    var dur = my_media.getDuration();
-    if (dur &gt; 0) {
-        clearInterval(timerDur);
-        document.getElementById('audio_duration').innerHTML = (dur) + " sec";
-    }
-}, 100);
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Audio player</span>
+<span class="c1">//</span>
+<span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span> <span class="nx">onSuccess</span><span class="p">,</span> <span class="nx">onError</span><span class="p">);</span>
+
+<span class="c1">// Get duration</span>
+<span class="kd">var</span> <span class="nx">counter</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="kd">var</span> <span class="nx">timerDur</span> <span class="o">=</span> <span class="nx">setInterval</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+    <span class="nx">counter</span> <span class="o">=</span> <span class="nx">counter</span> <span class="o">+</span> <span class="mi">100</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="nx">counter</span> <span class="o">&gt;</span> <span class="mi">2000</span><span class="p">)</span> <span class="p">{</span>
+        <span class="nx">clearInterval</span><span class="p">(</span><span class="nx">timerDur</span><span class="p">);</span>
+    <span class="p">}</span>
+    <span class="kd">var</span> <span class="nx">dur</span> <span class="o">=</span> <span class="nx">my_media</span><span class="p">.</span><span class="nx">getDuration</span><span class="p">();</span>
+    <span class="k">if</span> <span class="p">(</span><span class="nx">dur</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+        <span class="nx">clearInterval</span><span class="p">(</span><span class="nx">timerDur</span><span class="p">);</span>
+        <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'audio_duration'</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="p">(</span><span class="nx">dur</span><span class="p">)</span> <span class="o">+</span> <span class="s2">" sec"</span><span class="p">;</span>
+    <span class="p">}</span>
+<span class="p">},</span> <span class="mi">100</span><span class="p">);</span>
 </code></pre></div>
 <h2>media.pause</h2>
 
@@ -2849,49 +2893,85 @@ var timerDur = setInterval(function() {
 <div class="highlight"><pre><code class="language-" data-lang="">media.pause();
 </code></pre></div>
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Play audio
-//
-function playAudio(url) {
-    // Play the audio file at url
-    var my_media = new Media(url,
-        // success callback
-        function () { console.log("playAudio():Audio Success"); },
-        // error callback
-        function (err) { console.log("playAudio():Audio Error: " + err); }
-    );
-
-    // Play audio
-    my_media.play();
-
-    // Pause after 10 seconds
-    setTimeout(function () {
-        my_media.pause();
-    }, 10000);
-}
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Play audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">playAudio</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Play the audio file at url</span>
+    <span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">url</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Success"</span><span class="p">);</span> <span class="p">},</span>
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Error: "</span> <span class="o">+</span> <span class="nx">err</span><span class="p">);</span> <span class="p">}</span>
+    <span class="p">);</span>
+
+    <span class="c1">// Play audio</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span>
+
+    <span class="c1">// Pause after 10 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
+        <span class="nx">my_media</span><span class="p">.</span><span class="nx">pause</span><span class="p">();</span>
+    <span class="p">},</span> <span class="mi">10000</span><span class="p">);</span>
+<span class="p">}</span>
+</code></pre></div>
+<h2>media.pauseRecord</h2>
+
+<p>Pauses recording an audio file.</p>
+<div class="highlight"><pre><code class="language-" data-lang="">media.pauseRecord();
+</code></pre></div>
+<h3>Supported Platforms</h3>
+
+<ul>
+<li>iOS</li>
+</ul>
+
+<h3>Quick Example</h3>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Record audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">recordAudio</span><span class="p">()</span> <span class="p">{</span>
+    <span class="kd">var</span> <span class="nx">src</span> <span class="o">=</span> <span class="s2">"myrecording.mp3"</span><span class="p">;</span>
+    <span class="kd">var</span> <span class="nx">mediaRec</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Success"</span><span class="p">);</span>
+        <span class="p">},</span>
+
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Error: "</span><span class="o">+</span> <span class="nx">err</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
+        <span class="p">});</span>
+
+    <span class="c1">// Record audio</span>
+    <span class="nx">mediaRec</span><span class="p">.</span><span class="nx">startRecord</span><span class="p">();</span>
+
+    <span class="c1">// Pause Recording after 5 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+        <span class="nx">my_media</span><span class="p">.</span><span class="nx">pauseRecord</span><span class="p">();</span>
+    <span class="p">},</span> <span class="mi">5000</span><span class="p">);</span>
+<span class="p">}</span>
 </code></pre></div>
 <h2>media.play</h2>
 
 <p>Starts or resumes playing an audio file.</p>
-<div class="highlight"><pre><code class="language-" data-lang="">media.play();
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nx">media</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span>
 </code></pre></div>
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Play audio
-//
-function playAudio(url) {
-    // Play the audio file at url
-    var my_media = new Media(url,
-        // success callback
-        function () {
-            console.log("playAudio():Audio Success");
-        },
-        // error callback
-        function (err) {
-            console.log("playAudio():Audio Error: " + err);
-        }
-    );
-    // Play audio
-    my_media.play();
-}
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Play audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">playAudio</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Play the audio file at url</span>
+    <span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">url</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Success"</span><span class="p">);</span>
+        <span class="p">},</span>
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Error: "</span> <span class="o">+</span> <span class="nx">err</span><span class="p">);</span>
+        <span class="p">}</span>
+    <span class="p">);</span>
+    <span class="c1">// Play audio</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span>
+<span class="p">}</span>
 </code></pre></div>
 <h3>iOS Quirks</h3>
 
@@ -2925,13 +3005,54 @@ function for any <code>Media</code> reso
 <div class="highlight"><pre><code class="language-" data-lang="">media.release();
 </code></pre></div>
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Audio player
-//
-var my_media = new Media(src, onSuccess, onError);
-
-my_media.play();
-my_media.stop();
-my_media.release();
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Audio player</span>
+<span class="c1">//</span>
+<span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span> <span class="nx">onSuccess</span><span class="p">,</span> <span class="nx">onError</span><span class="p">);</span>
+
+<span class="nx">my_media</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span>
+<span class="nx">my_media</span><span class="p">.</span><span class="nx">stop</span><span class="p">();</span>
+<span class="nx">my_media</span><span class="p">.</span><span class="nx">release</span><span class="p">();</span>
+</code></pre></div>
+<h2>media.resumeRecord</h2>
+
+<p>Resume recording an audio file.</p>
+<div class="highlight"><pre><code class="language-" data-lang="">media.resumeRecord();
+</code></pre></div>
+<h3>Supported Platforms</h3>
+
+<ul>
+<li>iOS</li>
+</ul>
+
+<h3>Quick Example</h3>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Record audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">recordAudio</span><span class="p">()</span> <span class="p">{</span>
+    <span class="kd">var</span> <span class="nx">src</span> <span class="o">=</span> <span class="s2">"myrecording.mp3"</span><span class="p">;</span>
+    <span class="kd">var</span> <span class="nx">mediaRec</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Success"</span><span class="p">);</span>
+        <span class="p">},</span>
+
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Error: "</span><span class="o">+</span> <span class="nx">err</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
+        <span class="p">});</span>
+
+    <span class="c1">// Record audio</span>
+    <span class="nx">mediaRec</span><span class="p">.</span><span class="nx">startRecord</span><span class="p">();</span>
+
+    <span class="c1">// Pause Recording after 5 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+        <span class="nx">my_media</span><span class="p">.</span><span class="nx">pauseRecord</span><span class="p">();</span>
+    <span class="p">},</span> <span class="mi">5000</span><span class="p">);</span>
+
+    <span class="c1">// Resume Recording after 10 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+        <span class="nx">my_media</span><span class="p">.</span><span class="nx">resumeRecord</span><span class="p">();</span>
+    <span class="p">},</span> <span class="mi">10000</span><span class="p">);</span>
+<span class="p">}</span>
 </code></pre></div>
 <h2>media.seekTo</h2>
 
@@ -2945,14 +3066,14 @@ my_media.release();
 </ul>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Audio player
-//
-var my_media = new Media(src, onSuccess, onError);
-    my_media.play();
-// SeekTo to 10 seconds after 5 seconds
-setTimeout(function() {
-    my_media.seekTo(10000);
-}, 5000);
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Audio player</span>
+<span class="c1">//</span>
+<span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span> <span class="nx">onSuccess</span><span class="p">,</span> <span class="nx">onError</span><span class="p">);</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span>
+<span class="c1">// SeekTo to 10 seconds after 5 seconds</span>
+<span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">seekTo</span><span class="p">(</span><span class="mi">10000</span><span class="p">);</span>
+<span class="p">},</span> <span class="mi">5000</span><span class="p">);</span>
 </code></pre></div>
 <h3>BlackBerry 10 Quirks</h3>
 
@@ -2979,33 +3100,33 @@ setTimeout(function() {
 </ul>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Play audio
-//
-function playAudio(url) {
-    // Play the audio file at url
-    var my_media = new Media(url,
-        // success callback
-        function() {
-            console.log("playAudio():Audio Success");
-        },
-        // error callback
-        function(err) {
-            console.log("playAudio():Audio Error: "+err);
-    });
-
-    // Play audio
-    my_media.play();
-
-    // Mute volume after 2 seconds
-    setTimeout(function() {
-        my_media.setVolume('0.0');
-    }, 2000);
-
-    // Set volume to 1.0 after 5 seconds
-    setTimeout(function() {
-        my_media.setVolume('1.0');
-    }, 5000);
-}
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Play audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">playAudio</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Play the audio file at url</span>
+    <span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">url</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Success"</span><span class="p">);</span>
+        <span class="p">},</span>
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Error: "</span><span class="o">+</span><span class="nx">err</span><span class="p">);</span>
+    <span class="p">});</span>
+
+    <span class="c1">// Play audio</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span>
+
+    <span class="c1">// Mute volume after 2 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+        <span class="nx">my_media</span><span class="p">.</span><span class="nx">setVolume</span><span class="p">(</span><span class="s1">'0.0'</span><span class="p">);</span>
+    <span class="p">},</span> <span class="mi">2000</span><span class="p">);</span>
+
+    <span class="c1">// Set volume to 1.0 after 5 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+        <span class="nx">my_media</span><span class="p">.</span><span class="nx">setVolume</span><span class="p">(</span><span class="s1">'1.0'</span><span class="p">);</span>
+    <span class="p">},</span> <span class="mi">5000</span><span class="p">);</span>
+<span class="p">}</span>
 </code></pre></div>
 <h2>media.startRecord</h2>
 
@@ -3022,24 +3143,24 @@ function playAudio(url) {
 </ul>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Record audio
-//
-function recordAudio() {
-    var src = "myrecording.mp3";
-    var mediaRec = new Media(src,
-        // success callback
-        function() {
-            console.log("recordAudio():Audio Success");
-        },
-
-        // error callback
-        function(err) {
-            console.log("recordAudio():Audio Error: "+ err.code);
-        });
-
-    // Record audio
-    mediaRec.startRecord();
-}
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Record audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">recordAudio</span><span class="p">()</span> <span class="p">{</span>
+    <span class="kd">var</span> <span class="nx">src</span> <span class="o">=</span> <span class="s2">"myrecording.mp3"</span><span class="p">;</span>
+    <span class="kd">var</span> <span class="nx">mediaRec</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Success"</span><span class="p">);</span>
+        <span class="p">},</span>
+
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Error: "</span><span class="o">+</span> <span class="nx">err</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
+        <span class="p">});</span>
+
+    <span class="c1">// Record audio</span>
+    <span class="nx">mediaRec</span><span class="p">.</span><span class="nx">startRecord</span><span class="p">();</span>
+<span class="p">}</span>
 </code></pre></div>
 <h3>Android Quirks</h3>
 
@@ -3072,35 +3193,35 @@ function recordAudio() {
 <li>Not supported on Tizen devices.</li>
 </ul>
 
-<h2>media.stop</h2>
+media.stop</h2>
 
 <p>Stops playing an audio file.</p>
 <div class="highlight"><pre><code class="language-" data-lang="">media.stop();
 </code></pre></div>
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Play audio
-//
-function playAudio(url) {
-    // Play the audio file at url
-    var my_media = new Media(url,
-        // success callback
-        function() {
-            console.log("playAudio():Audio Success");
-        },
-        // error callback
-        function(err) {
-            console.log("playAudio():Audio Error: "+err);
-        }
-    );
-
-    // Play audio
-    my_media.play();
-
-    // Pause after 10 seconds
-    setTimeout(function() {
-        my_media.stop();
-    }, 10000);
-}
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Play audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">playAudio</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Play the audio file at url</span>
+    <span class="kd">var</span> <span class="nx">my_media</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">url</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Success"</span><span class="p">);</span>
+        <span class="p">},</span>
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"playAudio():Audio Error: "</span><span class="o">+</span><span class="nx">err</span><span class="p">);</span>
+        <span class="p">}</span>
+    <span class="p">);</span>
+
+    <span class="c1">// Play audio</span>
+    <span class="nx">my_media</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span>
+
+    <span class="c1">// Pause after 10 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+        <span class="nx">my_media</span><span class="p">.</span><span class="nx">stop</span><span class="p">();</span>
+    <span class="p">},</span> <span class="mi">10000</span><span class="p">);</span>
+<span class="p">}</span>
 </code></pre></div>
 <h2>media.stopRecord</h2>
 
@@ -3117,32 +3238,32 @@ function playAudio(url) {
 </ul>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">// Record audio
-//
-function recordAudio() {
-    var src = "myrecording.mp3";
-    var mediaRec = new Media(src,
-        // success callback
-        function() {
-            console.log("recordAudio():Audio Success");
-        },
-
-        // error callback
-        function(err) {
-            console.log("recordAudio():Audio Error: "+ err.code);
-        }
-    );
-
-    // Record audio
-    mediaRec.startRecord();
-
-    // Stop recording after 10 seconds
-    setTimeout(function() {
-        mediaRec.stopRecord();
-    }, 10000);
-}
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// Record audio</span>
+<span class="c1">//</span>
+<span class="kd">function</span> <span class="nx">recordAudio</span><span class="p">()</span> <span class="p">{</span>
+    <span class="kd">var</span> <span class="nx">src</span> <span class="o">=</span> <span class="s2">"myrecording.mp3"</span><span class="p">;</span>
+    <span class="kd">var</span> <span class="nx">mediaRec</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Media</span><span class="p">(</span><span class="nx">src</span><span class="p">,</span>
+        <span class="c1">// success callback</span>
+        <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Success"</span><span class="p">);</span>
+        <span class="p">},</span>
+
+        <span class="c1">// error callback</span>
+        <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"recordAudio():Audio Error: "</span><span class="o">+</span> <span class="nx">err</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
+        <span class="p">}</span>
+    <span class="p">);</span>
+
+    <span class="c1">// Record audio</span>
+    <span class="nx">mediaRec</span><span class="p">.</span><span class="nx">startRecord</span><span class="p">();</span>
+
+    <span class="c1">// Stop recording after 10 seconds</span>
+    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+        <span class="nx">mediaRec</span><span class="p">.</span><span class="nx">stopRecord</span><span class="p">();</span>
+    <span class="p">},</span> <span class="mi">10000</span><span class="p">);</span>
+<span class="p">}</span>
 </code></pre></div>
-<h3>Tizen Quirks</h3>
+Tizen Quirks</h3>
 
 <ul>
 <li>Not supported on Tizen devices.</li>

Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-network-information/index.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-network-information/index.html?rev=1746983&r1=1746982&r2=1746983&view=diff
==============================================================================
--- cordova/site/public/docs/en/dev/reference/cordova-plugin-network-information/index.html (original)
+++ cordova/site/public/docs/en/dev/reference/cordova-plugin-network-information/index.html Mon Jun  6 10:43:18 2016
@@ -6,12 +6,12 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <meta name="format-detection" content="telephone=no">
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
-    <meta name="description" content=" ">
+    <meta name="description" content="Get information about wireless connectivity. ">
 
     <title>
         
             
-                cordova-plugin-network-information - Apache Cordova
+                Network Information - Apache Cordova
             
         
     </title>
@@ -732,7 +732,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-                cordova-plugin-battery-status
+                Battery Status
             </a>
             
         
@@ -747,7 +747,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-camera/index.html">
-                cordova-plugin-camera
+                Camera
             </a>
             
         
@@ -762,7 +762,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-console/index.html">
-                cordova-plugin-console
+                Console
             </a>
             
         
@@ -777,7 +777,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-                cordova-plugin-contacts
+                Contacts
             </a>
             
         
@@ -792,7 +792,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device/index.html">
-                cordova-plugin-device
+                Device
             </a>
             
         
@@ -807,7 +807,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-                cordova-plugin-device-motion
+                Device Motion
             </a>
             
         
@@ -822,7 +822,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-                cordova-plugin-device-orientation
+                Device Orientation
             </a>
             
         
@@ -837,7 +837,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-dialogs/index.html">
-                cordova-plugin-dialogs
+                Dialogs
             </a>
             
         
@@ -852,7 +852,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-file/index.html">
-                cordova-plugin-file
+                File
             </a>
             
         
@@ -867,7 +867,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-file-transfer/index.html">
-                cordova-plugin-file-transfer
+                File Transfer
             </a>
             
         
@@ -882,7 +882,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-                cordova-plugin-geolocation
+                Geolocation
             </a>
             
         
@@ -897,7 +897,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-                cordova-plugin-globalization
+                Globalization
             </a>
             
         
@@ -912,7 +912,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-                cordova-plugin-inappbrowser
+                Inappbrowser
             </a>
             
         
@@ -927,7 +927,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-media/index.html">
-                cordova-plugin-media
+                Media
             </a>
             
         
@@ -942,7 +942,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-                cordova-plugin-media-capture
+                Media Capture
             </a>
             
         
@@ -957,7 +957,7 @@
     <li>
         
             <a class="this-page" href="../../reference/cordova-plugin-network-information/index.html">
-                cordova-plugin-network-information
+                Network Information
             </a>
             
                 <span class="entry-highlight"></span>
@@ -974,7 +974,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-                cordova-plugin-splashscreen
+                Splashscreen
             </a>
             
         
@@ -989,7 +989,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-                cordova-plugin-vibration
+                Vibration
             </a>
             
         
@@ -1004,7 +1004,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-                cordova-plugin-statusbar
+                Statusbar
             </a>
             
         
@@ -1019,7 +1019,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-                cordova-plugin-whitelist
+                Whitelist
             </a>
             
         
@@ -1034,7 +1034,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-                cordova-plugin-legacy-whitelist
+                Legacy Whitelist
             </a>
             
         
@@ -1388,7 +1388,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-        cordova-plugin-battery-status
+        Battery Status
     </a>
 </li>
 
@@ -1397,7 +1397,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-camera/index.html">
-        cordova-plugin-camera
+        Camera
     </a>
 </li>
 
@@ -1406,7 +1406,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-console/index.html">
-        cordova-plugin-console
+        Console
     </a>
 </li>
 
@@ -1415,7 +1415,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-        cordova-plugin-contacts
+        Contacts
     </a>
 </li>
 
@@ -1424,7 +1424,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device/index.html">
-        cordova-plugin-device
+        Device
     </a>
 </li>
 
@@ -1433,7 +1433,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-        cordova-plugin-device-motion
+        Device Motion
     </a>
 </li>
 
@@ -1442,7 +1442,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-        cordova-plugin-device-orientation
+        Device Orientation
     </a>
 </li>
 
@@ -1451,7 +1451,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-dialogs/index.html">
-        cordova-plugin-dialogs
+        Dialogs
     </a>
 </li>
 
@@ -1460,7 +1460,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-file/index.html">
-        cordova-plugin-file
+        File
     </a>
 </li>
 
@@ -1469,7 +1469,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-file-transfer/index.html">
-        cordova-plugin-file-transfer
+        File Transfer
     </a>
 </li>
 
@@ -1478,7 +1478,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-        cordova-plugin-geolocation
+        Geolocation
     </a>
 </li>
 
@@ -1487,7 +1487,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-        cordova-plugin-globalization
+        Globalization
     </a>
 </li>
 
@@ -1496,7 +1496,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-        cordova-plugin-inappbrowser
+        Inappbrowser
     </a>
 </li>
 
@@ -1505,7 +1505,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-media/index.html">
-        cordova-plugin-media
+        Media
     </a>
 </li>
 
@@ -1514,7 +1514,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-        cordova-plugin-media-capture
+        Media Capture
     </a>
 </li>
 
@@ -1523,7 +1523,7 @@
 
 <li>
     <a class="this-page" href="../../reference/cordova-plugin-network-information/index.html">
-        cordova-plugin-network-information
+        Network Information
     </a>
 </li>
 
@@ -1532,7 +1532,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-        cordova-plugin-splashscreen
+        Splashscreen
     </a>
 </li>
 
@@ -1541,7 +1541,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-        cordova-plugin-vibration
+        Vibration
     </a>
 </li>
 
@@ -1550,7 +1550,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-        cordova-plugin-statusbar
+        Statusbar
     </a>
 </li>
 
@@ -1559,7 +1559,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-        cordova-plugin-whitelist
+        Whitelist
     </a>
 </li>
 
@@ -1568,7 +1568,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-        cordova-plugin-legacy-whitelist
+        Legacy Whitelist
     </a>
 </li>
 
@@ -2697,8 +2697,14 @@
 It provides information about the device&#39;s cellular and
 wifi connection, and whether the device has an internet connection.</p>
 
+<blockquote>
+<p>To get a few ideas how to use the plugin, check out the <a href="#sample">sample</a> at the bottom of this page or go straight to the <a href="#reference">reference</a> content.</p>
+</blockquote>
+
 <p>Report issues with this plugin on the <a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Network%20Information%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC">Apache Cordova issue tracker</a>.</p>
 
+<h2><a name="reference"></a>Reference</h2>
+
 <h2>Installation</h2>
 <div class="highlight"><pre><code class="language-" data-lang="">cordova plugin add cordova-plugin-network-information
 </code></pre></div>
@@ -2747,23 +2753,23 @@ wifi connection, and whether the device
 connection state, and type of connection.</p>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">function checkConnection() {
-    var networkState = navigator.connection.type;
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">checkConnection</span><span class="p">()</span> <span class="p">{</span>
+    <span class="kd">var</span> <span class="nx">networkState</span> <span class="o">=</span> <span class="nx">navigator</span><span class="p">.</span><span class="nx">connection</span><span class="p">.</span><span class="nx">type</span><span class="p">;</span>
 
-    var states = {};
-    states[Connection.UNKNOWN]  = 'Unknown connection';
-    states[Connection.ETHERNET] = 'Ethernet connection';
-    states[Connection.WIFI]     = 'WiFi connection';
-    states[Connection.CELL_2G]  = 'Cell 2G connection';
-    states[Connection.CELL_3G]  = 'Cell 3G connection';
-    states[Connection.CELL_4G]  = 'Cell 4G connection';
-    states[Connection.CELL]     = 'Cell generic connection';
-    states[Connection.NONE]     = 'No network connection';
+    <span class="kd">var</span> <span class="nx">states</span> <span class="o">=</span> <span class="p">{};</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">UNKNOWN</span><span class="p">]</span>  <span class="o">=</span> <span class="s1">'Unknown connection'</span><span class="p">;</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">ETHERNET</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'Ethernet connection'</span><span class="p">;</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">WIFI</span><span class="p">]</span>     <span class="o">=</span> <span class="s1">'WiFi connection'</span><span class="p">;</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">CELL_2G</span><span class="p">]</span>  <span class="o">=</span> <span class="s1">'Cell 2G connection'</span><span class="p">;</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">CELL_3G</span><span class="p">]</span>  <span class="o">=</span> <span class="s1">'Cell 3G connection'</span><span class="p">;</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">CELL_4G</span><span class="p">]</span>  <span class="o">=</span> <span class="s1">'Cell 4G connection'</span><span class="p">;</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">CELL</span><span class="p">]</span>     <span class="o">=</span> <span class="s1">'Cell generic connection'</span><span class="p">;</span>
+    <span class="nx">states</span><span class="p">[</span><span class="nx">Connection</span><span class="p">.</span><span class="nx">NONE</span><span class="p">]</span>     <span class="o">=</span> <span class="s1">'No network connection'</span><span class="p">;</span>
 
-    alert('Connection type: ' + states[networkState]);
-}
+    <span class="nx">alert</span><span class="p">(</span><span class="s1">'Connection type: '</span> <span class="o">+</span> <span class="nx">states</span><span class="p">[</span><span class="nx">networkState</span><span class="p">]);</span>
+<span class="p">}</span>
 
-checkConnection();
+<span class="nx">checkConnection</span><span class="p">();</span>
 </code></pre></div>
 <h3>API Change</h3>
 
@@ -2846,11 +2852,11 @@ and fires when the value of <code>connec
 attach an event listener once the <code>deviceready</code> event fires.</p>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">document.addEventListener("offline", onOffline, false);
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">document</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s2">"offline"</span><span class="p">,</span> <span class="nx">onOffline</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
 
-function onOffline() {
-    // Handle the offline event
-}
+<span class="kd">function</span> <span class="nx">onOffline</span><span class="p">()</span> <span class="p">{</span>
+    <span class="c1">// Handle the offline event</span>
+<span class="p">}</span>
 </code></pre></div>
 <h3>iOS Quirks</h3>
 
@@ -2882,11 +2888,11 @@ value.</p>
 attach an event listener once the <code>deviceready</code> event fires.</p>
 
 <h3>Quick Example</h3>
-<div class="highlight"><pre><code class="language-" data-lang="">document.addEventListener("online", onOnline, false);
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">document</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s2">"online"</span><span class="p">,</span> <span class="nx">onOnline</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
 
-function onOnline() {
-    // Handle the online event
-}
+<span class="kd">function</span> <span class="nx">onOnline</span><span class="p">()</span> <span class="p">{</span>
+    <span class="c1">// Handle the online event</span>
+<span class="p">}</span>
 </code></pre></div>
 <h3>iOS Quirks</h3>
 
@@ -2902,6 +2908,109 @@ at least a second to fire, prior to whic
 
 <p>The Emulator reports the connection type as <code>Cellular</code>, which does not change, so events does <em>not</em> fire.</p>
 
+<h2>Sample: Upload a File Depending on your Network State <a name="sample"></a></h2>
+
+<p>The code examples in this section show examples of changing app behavior using the online and offline events and your network connection status.</p>
+
+<p>To start with, create a new FileEntry object (data.txt) to use for sample data. Call this function from the <code>deviceready</code> handler.</p>
+
+<blockquote>
+<p><em>Note</em> This code example requires the File plugin.</p>
+</blockquote>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">var</span> <span class="nx">dataFileEntry</span><span class="p">;</span>
+
+<span class="kd">function</span> <span class="nx">createSomeData</span><span class="p">()</span> <span class="p">{</span>
+
+    <span class="nb">window</span><span class="p">.</span><span class="nx">requestFileSystem</span><span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">TEMPORARY</span><span class="p">,</span> <span class="mi">5</span> <span class="o">*</span> <span class="mi">1024</span> <span class="o">*</span> <span class="mi">1024</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fs</span><span class="p">)</span> <span class="p">{</span>
+
+        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'file system open: '</span> <span class="o">+</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span>
+        <span class="c1">// Creates a new file or returns an existing file.</span>
+        <span class="nx">fs</span><span class="p">.</span><span class="nx">root</span><span class="p">.</span><span class="nx">getFile</span><span class="p">(</span><span class="s2">"data.txt"</span><span class="p">,</span> <span class="p">{</span> <span class="na">create</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="na">exclusive</span><span class="p">:</span> <span class="kc">false</span> <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fileEntry</span><span class="p">)</span> <span class="p">{</span>
+
+          <span class="nx">dataFileEntry</span> <span class="o">=</span> <span class="nx">fileEntry</span><span class="p">;</span>
+
+        <span class="p">},</span> <span class="nx">onErrorCreateFile</span><span class="p">);</span>
+
+    <span class="p">},</span> <span class="nx">onErrorLoadFs</span><span class="p">);</span>
+<span class="p">}</span>
+</code></pre></div>
+<p>Next, add listeners for the online and offline events in the <code>deviceready</code> handler.</p>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">document</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s2">"offline"</span><span class="p">,</span> <span class="nx">onOffline</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
+<span class="nb">document</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s2">"online"</span><span class="p">,</span> <span class="nx">onOnline</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
+</code></pre></div>
+<p>The app&#39;s <code>onOnline</code> function handles the online event. In the event handler, check the current network state. In this app, treat any connection type as good except Connection.NONE. If you have a connection, you try to upload a file.</p>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">onOnline</span><span class="p">()</span> <span class="p">{</span>
+    <span class="c1">// Handle the online event</span>
+    <span class="kd">var</span> <span class="nx">networkState</span> <span class="o">=</span> <span class="nx">navigator</span><span class="p">.</span><span class="nx">connection</span><span class="p">.</span><span class="nx">type</span><span class="p">;</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="nx">networkState</span> <span class="o">!==</span> <span class="nx">Connection</span><span class="p">.</span><span class="nx">NONE</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="nx">dataFileEntry</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">tryToUploadFile</span><span class="p">();</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+    <span class="nx">display</span><span class="p">(</span><span class="s1">'Connection type: '</span> <span class="o">+</span> <span class="nx">networkState</span><span class="p">);</span>
+<span class="p">}</span>
+</code></pre></div>
+<p>When the online event fires in the preceding code, call the app&#39;s <code>tryToUploadFile</code> function.</p>
+
+<p>If the FileTransfer object&#39;s upload function fails, call the app&#39;s <code>offlineWrite</code> function to save the current data somewhere.</p>
+
+<blockquote>
+<p><em>Note</em> This example requires the FileTransfer plugin.</p>
+</blockquote>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">tryToUploadFile</span><span class="p">()</span> <span class="p">{</span>
+    <span class="c1">// !! Assumes variable fileURL contains a valid URL to a text file on the device,</span>
+    <span class="kd">var</span> <span class="nx">fileURL</span> <span class="o">=</span> <span class="nx">getDataFileEntry</span><span class="p">().</span><span class="nx">toURL</span><span class="p">();</span>
+
+    <span class="kd">var</span> <span class="nx">success</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
+        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Response = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">response</span><span class="p">);</span>
+        <span class="nx">display</span><span class="p">(</span><span class="s2">"Uploaded. Response: "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">response</span><span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="kd">var</span> <span class="nx">fail</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
+        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"An error has occurred: Code = "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
+        <span class="nx">offlineWrite</span><span class="p">(</span><span class="s2">"Failed to upload: some offline data"</span><span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileUploadOptions</span><span class="p">();</span>
+    <span class="nx">options</span><span class="p">.</span><span class="nx">fileKey</span> <span class="o">=</span> <span class="s2">"file"</span><span class="p">;</span>
+    <span class="nx">options</span><span class="p">.</span><span class="nx">fileName</span> <span class="o">=</span> <span class="nx">fileURL</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">.</span><span class="nx">lastIndexOf</span><span class="p">(</span><span class="s1">'/'</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>
+    <span class="nx">options</span><span class="p">.</span><span class="nx">mimeType</span> <span class="o">=</span> <span class="s2">"text/plain"</span><span class="p">;</span>
+
+    <span class="kd">var</span> <span class="nx">ft</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
+    <span class="c1">// Make sure you add the domain of your server URL to the</span>
+    <span class="c1">// Content-Security-Policy &lt;meta&gt; element in index.html.</span>
+    <span class="nx">ft</span><span class="p">.</span><span class="nx">upload</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">,</span> <span class="nb">encodeURI</span><span class="p">(</span><span class="nx">SERVER</span><span class="p">),</span> <span class="nx">success</span><span class="p">,</span> <span class="nx">fail</span><span class="p">,</span> <span class="nx">options</span><span class="p">);</span>
+<span class="p">};</span>
+</code></pre></div>
+<p>Here is the code for the <code>offlineWrite</code> function.</p>
+
+<blockquote>
+<p><em>Note</em> This code examples requires the File plugin.</p>
+</blockquote>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">offlineWrite</span><span class="p">(</span><span class="nx">offlineData</span><span class="p">)</span> <span class="p">{</span>
+    <span class="c1">// Create a FileWriter object for our FileEntry.</span>
+    <span class="nx">dataFileEntry</span><span class="p">.</span><span class="nx">createWriter</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">fileWriter</span><span class="p">)</span> <span class="p">{</span>
+
+        <span class="nx">fileWriter</span><span class="p">.</span><span class="nx">onwriteend</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Successful file write..."</span><span class="p">);</span>
+            <span class="nx">display</span><span class="p">(</span><span class="nx">offlineData</span><span class="p">);</span>
+        <span class="p">};</span>
+
+        <span class="nx">fileWriter</span><span class="p">.</span><span class="nx">onerror</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
+            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Failed file write: "</span> <span class="o">+</span> <span class="nx">e</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
+        <span class="p">};</span>
+
+        <span class="nx">fileWriter</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">offlineData</span><span class="p">);</span>
+    <span class="p">});</span>
+<span class="p">}</span>
+</code></pre></div>
+<p>If the offline event occurs, just do something like notify the user (for this example, just log it).</p>
+<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">onOffline</span><span class="p">()</span> <span class="p">{</span>
+    <span class="c1">// Handle the offline event</span>
+    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"lost connection"</span><span class="p">);</span>
+<span class="p">}</span>
+</code></pre></div>
 
                 </div>
             </div>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message