cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject svn commit: r1527865 [5/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_device_device.md.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/3.1.0/cordova_device_device.md.html?rev=1527865&view=auto
==============================================================================
--- cordova/site/public/docs/en/3.1.0/cordova_device_device.md.html (added)
+++ cordova/site/public/docs/en/3.1.0/cordova_device_device.md.html Tue Oct  1 03:55:57 2013
@@ -0,0 +1,792 @@
+<!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>Device</h1>
+            <small><select><option value="Device">Device</option>
+<option value="Device_properties">      - Properties</option>
+<option value="Device_variable_scope">      - Variable Scope</option>
+<option value="Device_accessing_the_feature">      - Accessing the
Feature</option>
+<option value="device.model">device.model</option>
+<option value="device.model_description">      - Description</option>
+<option value="device.model_supported_platforms">      - Supported
Platforms</option>
+<option value="device.model_quick_example">      - Quick Example</option>
+<option value="device.model_full_example">      - Full Example</option>
+<option value="device.model_android_quirks">      - Android Quirks</option>
+<option value="device.model_tizen_quirks">      - Tizen Quirks</option>
+<option value="device.model_windows_phone_7_and_8_quirks">      -
Windows Phone 7 and 8 Quirks</option>
+<option value="device.cordova">device.cordova</option>
+<option value="device.cordova_description">      - Description</option>
+<option value="device.cordova_supported_platforms">      - Supported
Platforms</option>
+<option value="device.cordova_quick_example">      - Quick Example</option>
+<option value="device.cordova_full_example">      - Full Example</option>
+<option value="device.platform">device.platform</option>
+<option value="device.platform_supported_platforms">      - Supported
Platforms</option>
+<option value="device.platform_quick_example">      - Quick Example</option>
+<option value="device.platform_full_example">      - Full Example</option>
+<option value="device.platform_blackberry_quirks">      - BlackBerry
Quirks</option>
+<option value="device.platform_windows_phone_7_quirks">      - Windows
Phone 7 Quirks</option>
+<option value="device.platform_windows_phone_8_quirks">      - Windows
Phone 8 Quirks</option>
+<option value="device.uuid">device.uuid</option>
+<option value="device.uuid_description">      - Description</option>
+<option value="device.uuid_supported_platforms">      - Supported
Platforms</option>
+<option value="device.uuid_quick_example">      - Quick Example</option>
+<option value="device.uuid_full_example">      - Full Example</option>
+<option value="device.uuid_ios_quirk">      - iOS Quirk</option>
+<option value="device.uuid_windows_phone_7_and_8_quirks">      -
Windows Phone 7 and 8 Quirks</option>
+<option value="device.version">device.version</option>
+<option value="device.version_supported_platforms">      - Supported
Platforms</option>
+<option value="device.version_quick_example">      - Quick Example</option>
+<option value="device.version_full_example">      - Full Example</option>
+<option value="device.name">device.name</option>
+<option value="device.name_description">      - Description</option>
+<option value="device.name_supported_platforms">      - Supported
Platforms</option>
+<option value="device.name_quick_example">      - Quick Example</option>
+<option value="device.name_full_example">      - Full Example</option>
+<option value="device.name_android_quirks">      - Android Quirks</option>
+<option value="device.name_windows_phone_7_and_8_quirks">      -
Windows Phone 7 and 8 Quirks</option>
+<option value="device.name_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="Device">Device</a></h1>
+
+<blockquote>
+  <p>The <code>device</code> object describes the device's hardware and
software.</p>
+</blockquote>
+
+<h2>
+<a name="Device_properties">Properties</a>
+</h2>
+
+<ul>
+<li><a href="cordova_device_device.md.html#device.model">device.model</a></li>
+<li><a href="cordova_device_device.md.html#device.cordova">device.cordova</a></li>
+<li><a href="cordova_device_device.md.html#device.platform">device.platform</a></li>
+<li><a href="cordova_device_device.md.html#device.uuid">device.uuid</a></li>
+<li><a href="cordova_device_device.md.html#device.version">device.version</a></li>
+<li><a href="cordova_device_device.md.html#device.name">device.name</a></li>
+</ul>
+<h2>
+<a name="Device_variable_scope">Variable Scope</a>
+</h2>
+
+<p>Since <code>device</code> is assigned to the <code>window</code>
object, it is implicitly in the global scope.</p>
+
+<pre class="prettyprint"><code>// These reference the same `device`
+var phoneModel = window.<a href="cordova_device_device.md.html#device.model">device.model</a>;
+var phoneModel = <a href="cordova_device_device.md.html#device.model">device.model</a>;
+</code></pre>
+
+<h2>
+<a name="Device_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
+    $ cordova plugin ls
+    [ 'org.apache.cordova.device' ]
+    $ cordova plugin rm org.apache.cordova.device
+</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="<a href="cordova_device_device.md.html#Device">Device</a>"&gt;
+    &lt;param name="android-package" value="org.apache.cordova.<a href="cordova_device_device.md.html#Device">Device</a>"
/&gt;
+&lt;/feature&gt;
+
+
+(in app/AndroidManifest.xml)
+&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="<a href="cordova_device_device.md.html#Device">Device</a>"&gt;
+    &lt;param name="blackberry-package" value="org.apache.cordova.device.<a href="cordova_device_device.md.html#Device">Device</a>"
/&gt;
+&lt;/feature&gt;
+
+
+(in www/config.xml)
+&lt;feature id="blackberry.app" required="true" version="1.0.0.0" /&gt;
+&lt;rim:permissions&gt;
+    &lt;rim:permit&gt;read_device_identifying_information&lt;/rim:permit&gt;
+&lt;/rim:permissions&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_WEBBROWSERCOMPONENT" /&gt;
+    &lt;Capability Name="ID_CAP_IDENTITY_DEVICE" /&gt;
+    &lt;Capability Name="ID_CAP_IDENTITY_USER" /&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="device.model">device.model</a></h1>
+
+<p>Get the device's model name.</p>
+
+<pre class="prettyprint"><code>var string = <a href="cordova_device_device.md.html#device.model">device.model</a>;
+</code></pre>
+
+<h2>
+<a name="device.model_description">Description</a>
+</h2>
+
+<p>The <code><a href="cordova_device_device.md.html#device.model">device.model</a></code>
returns the name of the device's model or
+product. The value is set by the device manufacturer and may be
+different across versions of the same product.</p>
+
+<h2>
+<a name="device.model_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="device.model_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>// Android:    Nexus One       returns "Passion"
(Nexus One code name)
+//             Motorola Droid  returns "voles"
+// BlackBerry: Torch 9800      returns "9800"
+// iOS:     for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models
+//
+var model = <a href="cordova_device_device.md.html#device.model">device.model</a>;
+</code></pre>
+
+<h2>
+<a name="device.model_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_device_device.md.html#Device">Device</a>
Properties 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() {
+        var element = document.getElementById('deviceProperties');
+        element.innerHTML = '<a href="cordova_device_device.md.html#Device">Device</a>
Model: '    + <a href="cordova_device_device.md.html#device.model">device.model</a>
   + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Cordova: '  + <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>
 + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Platform: ' + <a href="cordova_device_device.md.html#device.platform">device.platform</a>
+ '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
UUID: '     + <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>
    + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Version: '  + <a href="cordova_device_device.md.html#device.version">device.version</a>
 + '&lt;br /&gt;';
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p id="deviceProperties"&gt;Loading device properties...&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2>
+<a name="device.model_android_quirks">Android Quirks</a>
+</h2>
+
+<ul>
+<li>Gets the <a class="external" href="http://developer.android.com/reference/android/os/Build.html#PRODUCT">product
name</a> instead of the <a class="external" href="http://developer.android.com/reference/android/os/Build.html#MODEL">model
name</a>, which is often the production code name. For example, the Nexus One returns
<code>Passion</code>, and Motorola Droid returns <code>voles</code>.</li>
+</ul>
+<h2>
+<a name="device.model_tizen_quirks">Tizen Quirks</a>
+</h2>
+
+<ul>
+<li>Returns the <a href="#device%20model">device model</a> assigned by
the vendor, for example, <code>TIZEN</code>
+</li>
+</ul>
+<h2>
+<a name="device.model_windows_phone_7_and_8_quirks">Windows Phone 7 and 8 Quirks</a>
+</h2>
+
+<ul>
+<li>Returns the <a href="#device%20model">device model</a> specified by
the manufacturer. For example, the Samsung Focus returns <code>SGH-i917</code>.</li>
+</ul>
+<hr>
+<h1><a name="device.cordova">device.cordova</a></h1>
+
+<p>Get the version of Cordova running on the device.</p>
+
+<pre class="prettyprint"><code>var string = <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>;
+</code></pre>
+
+<h2>
+<a name="device.cordova_description">Description</a>
+</h2>
+
+<p><code><a href="cordova_device_device.md.html#device.cordova">device.cordova</a></code>
returns the version of Cordova running on the device.</p>
+
+<h2>
+<a name="device.cordova_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="device.cordova_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>var name = <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>;
+</code></pre>
+
+<h2>
+<a name="device.cordova_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_device_device.md.html#Device">Device</a>
Properties 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() {
+        var element = document.getElementById('deviceProperties');
+        element.innerHTML = '<a href="cordova_device_device.md.html#Device">Device</a>
Model: '    + <a href="cordova_device_device.md.html#device.model">device.model</a>
   + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Cordova: '  + <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>
 + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Platform: ' + <a href="cordova_device_device.md.html#device.platform">device.platform</a>
+ '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
UUID: '     + <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>
    + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Version: '  + <a href="cordova_device_device.md.html#device.version">device.version</a>
 + '&lt;br /&gt;';
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p id="deviceProperties"&gt;Loading device properties...&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<hr>
+<h1><a name="device.platform">device.platform</a></h1>
+
+<p>Get the device's operating system name.</p>
+
+<pre class="prettyprint"><code>var string = <a href="cordova_device_device.md.html#device.platform">device.platform</a>;
+</code></pre>
+
+<h2>
+<a name="device.platform_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="device.platform_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>// Depending on the device, a few examples are:
+//   - "Android"
+//   - "BlackBerry"
+//   - "iOS"
+//   - "WinCE"
+//   - "Tizen"
+var devicePlatform = <a href="cordova_device_device.md.html#device.platform">device.platform</a>;
+</code></pre>
+
+<h2>
+<a name="device.platform_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_device_device.md.html#Device">Device</a>
Properties 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() {
+        var element = document.getElementById('deviceProperties');
+        element.innerHTML = '<a href="cordova_device_device.md.html#Device">Device</a>
Model: '    + <a href="cordova_device_device.md.html#device.model">device.model</a>
   + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Cordova: '  + <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>
 + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Platform: ' + <a href="cordova_device_device.md.html#device.platform">device.platform</a>
+ '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
UUID: '     + <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>
    + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Version: '  + <a href="cordova_device_device.md.html#device.version">device.version</a>
 + '&lt;br /&gt;';
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p id="deviceProperties"&gt;Loading device properties...&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2>
+<a name="device.platform_blackberry_quirks">BlackBerry Quirks</a>
+</h2>
+
+<p>Devices may return the <a href="#device%20platform">device platform</a>
version number instead of the
+platform name.  For example, the Storm2 9550 returns a value such as
+<code>2.13.0.95</code>.</p>
+
+<h2>
+<a name="device.platform_windows_phone_7_quirks">Windows Phone 7 Quirks</a>
+</h2>
+
+<p>Windows Phone 7 devices report the platform as <code>WinCE</code>.</p>
+
+<h2>
+<a name="device.platform_windows_phone_8_quirks">Windows Phone 8 Quirks</a>
+</h2>
+
+<p>Windows Phone 8 devices report the platform as <code>Win32NT</code>.</p>
+
+<hr>
+<h1><a name="device.uuid">device.uuid</a></h1>
+
+<p>Get the device's Universally Unique Identifier (<a class="external" href="http://en.wikipedia.org/wiki/Universally_Unique_Identifier">UUID</a>).</p>
+
+<pre class="prettyprint"><code>var string = <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>;
+</code></pre>
+
+<h2>
+<a name="device.uuid_description">Description</a>
+</h2>
+
+<p>The details of how a UUID is generated are determined by the device manufacturer
and are specific to the device's platform or model.</p>
+
+<h2>
+<a name="device.uuid_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="device.uuid_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>// Android: Returns a random 64-bit integer (as
a string, again!)
+//          The integer is generated on the device's first boot
+//
+// BlackBerry: Returns the PIN number of the device
+//             This is a nine-digit unique integer (as a string, though!)
+//
+// iPhone: (Paraphrased from the UIDevice Class documentation)
+//         Returns a string of hash values created from multiple hardware identifies.
+//         It is guaranteed to be unique for every device and cannot be tied
+//         to the user account.
+// Windows Phone 7 : Returns a hash of device+current user,
+// if the user is not defined, a guid is generated and will persist until the app is uninstalled
+// Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
+// unique to every GSM and UMTS mobile phone.
+var deviceID = <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>;
+</code></pre>
+
+<h2>
+<a name="device.uuid_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_device_device.md.html#Device">Device</a>
Properties 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() {
+        var element = document.getElementById('deviceProperties');
+        element.innerHTML = '<a href="cordova_device_device.md.html#Device">Device</a>
Model: '    + <a href="cordova_device_device.md.html#device.model">device.model</a>
   + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Cordova: '  + <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>
 + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Platform: ' + <a href="cordova_device_device.md.html#device.platform">device.platform</a>
+ '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
UUID: '     + <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>
    + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Version: '  + <a href="cordova_device_device.md.html#device.version">device.version</a>
 + '&lt;br /&gt;';
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p id="deviceProperties"&gt;Loading device properties...&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2>
+<a name="device.uuid_ios_quirk">iOS Quirk</a>
+</h2>
+
+<p>The <code>uuid</code> on iOS is not unique to a device, but varies for
each
+application, for each installation.  It changes if you delete and
+re-install the app, and possibly also when you upgrade iOS, or even
+upgrade your app per version (apparent in iOS 5.1). The <code>uuid</code> is
not
+a reliable value.</p>
+
+<h2>
+<a name="device.uuid_windows_phone_7_and_8_quirks">Windows Phone 7 and 8 Quirks</a>
+</h2>
+
+<p>The <code>uuid</code> for Windows Phone 7 requires the permission
+<code>ID_CAP_IDENTITY_DEVICE</code>.  Microsoft will likely deprecate this
+property soon.  If the capability is not available, the application
+generates a persistent guid that is maintained for the duration of the
+application's installation on the device.</p>
+
+<hr>
+<h1><a name="device.version">device.version</a></h1>
+
+<p>Get the operating system version.</p>
+
+<pre class="prettyprint"><code>var string = <a href="cordova_device_device.md.html#device.version">device.version</a>;
+</code></pre>
+
+<h2>
+<a name="device.version_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android 2.1+</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="device.version_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>// Android:    Froyo OS would return "2.2"
+//             Eclair OS would return "2.1", "2.0.1", or "2.0"
+//             Version can also return update level "2.1-update1"
+//
+// BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+//
+// iPhone:     iOS 3.2 returns "3.2"
+//
+// Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+// Tizen: returns "TIZEN_20120425_2"
+var deviceVersion = <a href="cordova_device_device.md.html#device.version">device.version</a>;
+</code></pre>
+
+<h2>
+<a name="device.version_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_device_device.md.html#Device">Device</a>
Properties 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() {
+        var element = document.getElementById('deviceProperties');
+        element.innerHTML = '<a href="cordova_device_device.md.html#Device">Device</a>
Model: '    + <a href="cordova_device_device.md.html#device.model">device.model</a>
   + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Cordova: '  + <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>
 + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Platform: ' + <a href="cordova_device_device.md.html#device.platform">device.platform</a>
+ '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
UUID: '     + <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>
    + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Version: '  + <a href="cordova_device_device.md.html#device.version">device.version</a>
 + '&lt;br /&gt;';
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p id="deviceProperties"&gt;Loading device properties...&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<hr>
+<h1><a name="device.name">device.name</a></h1>
+
+<p><strong>WARNING:</strong> <code><a href="cordova_device_device.md.html#device.name">device.name</a></code>
is deprecated as of version 2.3.0. Use <code><a href="cordova_device_device.md.html#device.model">device.model</a></code>
instead.</p>
+
+<p>Get the device's model name.</p>
+
+<pre class="prettyprint"><code>var string = <a href="cordova_device_device.md.html#device.name">device.name</a>;
+</code></pre>
+
+<h2>
+<a name="device.name_description">Description</a>
+</h2>
+
+<p><code><a href="cordova_device_device.md.html#device.name">device.name</a></code>
returns the name of the device's model or product. This
+value is set by the device manufacturer and may be different across
+versions of the same product.</p>
+
+<h2>
+<a name="device.name_supported_platforms">Supported Platforms</a>
+</h2>
+
+<ul>
+<li>Android</li>
+<li>BlackBerry WebWorks (OS 5.0 and higher)</li>
+<li>iOS</li>
+<li>Tizen</li>
+<li>Windows Phone 7 and 8</li>
+<li>Windows 8</li>
+</ul>
+<h2>
+<a name="device.name_quick_example">Quick Example</a>
+</h2>
+
+<pre class="prettyprint"><code>// Android:    Nexus One       returns "Passion"
(Nexus One code name)
+//             Motorola Droid  returns "voles"
+// BlackBerry: Torch 9800      returns "9800"
+// iOS:     All devices     returns either "iPhone", "iPod Touch", "iPhone Simulator", "iPad",
"iPad Simulator"
+//
+var name = <a href="cordova_device_device.md.html#device.name">device.name</a>;
+</code></pre>
+
+<h2>
+<a name="device.name_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_device_device.md.html#Device">Device</a>
Properties 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() {
+        var element = document.getElementById('deviceProperties');
+        element.innerHTML = '<a href="cordova_device_device.md.html#Device">Device</a>
Name: '     + <a href="cordova_device_device.md.html#device.name">device.name</a>
    + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Model: '    + <a href="cordova_device_device.md.html#device.model">device.model</a>
   + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Cordova: '  + <a href="cordova_device_device.md.html#device.cordova">device.cordova</a>
 + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Platform: ' + <a href="cordova_device_device.md.html#device.platform">device.platform</a>
+ '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
UUID: '     + <a href="cordova_device_device.md.html#device.uuid">device.uuid</a>
    + '&lt;br /&gt;' +
+                            '<a href="cordova_device_device.md.html#Device">Device</a>
Version: '  + <a href="cordova_device_device.md.html#device.version">device.version</a>
 + '&lt;br /&gt;';
+    }
+
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p id="deviceProperties"&gt;Loading device properties...&lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+</code></pre>
+
+<h2>
+<a name="device.name_android_quirks">Android Quirks</a>
+</h2>
+
+<ul>
+<li>Gets the <a class="external" href="http://developer.android.com/reference/android/os/Build.html#PRODUCT">product
name</a> instead of the <a class="external" href="http://developer.android.com/reference/android/os/Build.html#MODEL">model
name</a>, which is often the production code name. For example, the Nexus One returns
<code>Passion</code>, and Motorola Droid returns <code>voles</code>.</li>
+</ul>
+<h2>
+<a name="device.name_windows_phone_7_and_8_quirks">Windows Phone 7 and 8 Quirks</a>
+</h2>
+
+<ul>
+<li>Returns the <a href="#device%20model">device model</a> specified by
the manufacturer. For example, the Samsung Focus returns <code>SGH-i917</code>.</li>
+</ul>
+<h2>
+<a name="device.name_tizen_quirks">Tizen Quirks</a>
+</h2>
+
+<ul>
+<li>Returns the <a href="#device%20model">device model</a> assigned by
the vendor, for example, <code>TIZEN</code>
+</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