openEventsPlatformApp/plugins/cordova-plugin-device/doc/ja/README.md
plugins/cordova-plugin-device/doc/ja/README.mdRaw
1<!--
2# license: Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18-->
19
20# cordova-plugin-device
21
22[](https://travis-ci.org/apache/cordova-plugin-device)
23
24このプラグインをグローバル定義します `device` オブジェクトは、デバイスのハードウェアとソフトウェアについて説明します。 それは後まで利用可能なオブジェクトがグローバル スコープでは、 `deviceready` イベント。
25
26 document.addEventListener("deviceready", onDeviceReady, false);
27 function onDeviceReady() {
28 console.log(device.cordova);
29 }
30
31
32## インストール
33
34 cordova plugin add cordova-plugin-device
35
36
37## プロパティ
38
39 * device.cordova
40 * device.model
41 * device.platform
42 * device.uuid
43 * device.version
44
45## device.cordova
46
47デバイスで実行されているコルドバのバージョンを取得します。
48
49### サポートされているプラットフォーム
50
51 * アマゾン火 OS
52 * アンドロイド
53 * ブラックベリー 10
54 * ブラウザー
55 * Firefox の OS
56 * iOS
57 * Tizen
58 * Windows Phone 7 と 8
59 * Windows 8
60
61## device.model
62
63`device.model`、デバイスのモデルまたは製品の名前を返します。値は、デバイスの製造元によって設定され、同じ製品のバージョン間で異なる可能性があります。
64
65### サポートされているプラットフォーム
66
67 * アンドロイド
68 * ブラックベリー 10
69 * ブラウザー
70 * iOS
71 * Tizen
72 * Windows Phone 7 と 8
73 * Windows 8
74
75### 簡単な例
76
77 // Android: Nexus One returns "Passion" (Nexus One code name)
78 // Motorola Droid returns "voles"
79 // BlackBerry: Torch 9800 returns "9800"
80 // Browser: Google Chrome returns "Chrome"
81 // Safari returns "Safari"
82 // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models を参照してください//var モデル = device.model;
83
84
85### Android の癖
86
87 * 生産コード名は[モデル名](http://developer.android.com/reference/android/os/Build.html#MODEL)の代わりに[製品名](http://developer.android.com/reference/android/os/Build.html#PRODUCT)を取得します。 たとえば、ネクサス 1 つを返します `Passion` 、Motorola のドロイドを返します`voles`.
88
89### Tizen の癖
90
91 * たとえば、ベンダーによって割り当てられているデバイスのモデルを返します`TIZEN`
92
93### Windows Phone 7 と 8 癖
94
95 * 製造元によって指定されたデバイスのモデルを返します。たとえば、三星フォーカスを返します`SGH-i917`.
96
97## device.platform
98
99デバイスのオペレーティング システム名を取得します。
100
101 var string = device.platform;
102
103
104### サポートされているプラットフォーム
105
106 * アンドロイド
107 * ブラックベリー 10
108 * Browser4
109 * Firefox の OS
110 * iOS
111 * Tizen
112 * Windows Phone 7 と 8
113 * Windows 8
114
115### 簡単な例
116
117 // Depending on the device, a few examples are:
118 // - "Android"
119 // - "BlackBerry 10"
120 // - Browser: returns "MacIntel" on Mac
121 // returns "Win32" on Windows
122 // - "iOS"
123 // - "WinCE"
124 // - "Tizen"
125 var devicePlatform = device.platform;
126
127
128### Windows Phone 7 の癖
129
130Windows Phone 7 デバイスとプラットフォームを報告します。`WinCE`.
131
132### Windows Phone 8 癖
133
134Windows Phone 8 デバイスとプラットフォームを報告します。`Win32NT`.
135
136## device.uuid
137
138デバイスのユニバーサル ・ ユニーク識別子 ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)を取得します。).
139
140 var string = device.uuid;
141
142
143### 解説
144
145UUID を生成する方法の詳細は、デバイスの製造元によって決定され、デバイスのプラットフォームやモデルに固有です。
146
147### サポートされているプラットフォーム
148
149 * アンドロイド
150 * ブラックベリー 10
151 * iOS
152 * Tizen
153 * Windows Phone 7 と 8
154 * Windows 8
155
156### 簡単な例
157
158 //アンドロイド: ランダムな 64 ビットの整数 (を文字列として返します、再び !)/デバイスの最初の起動時に生成される整数/////ブラックベリー: デバイスのピン番号を返します//これは 9 桁の一意な整数 (を文字列としても !)////iPhone: (UIDevice クラスのドキュメントから言い換え)//識別複数のハードウェアから作成されたハッシュ値の文字列を返します。。
159 //それはすべてのデバイスに対して一意であることが保証され、接続することはできません//ユーザー アカウント。
160 //Windows Phone 7: デバイス + 現在のユーザーのハッシュを返します//ユーザーが定義されていない場合 guid が生成され、アプリがアンインストールされるまで保持されます//Tizen: デバイスの IMEI を返します (国際モバイル機器アイデンティティまたは IMEI は番号です//すべての GSM および UMTS の携帯電話に固有です。
161 var deviceID = device.uuid;
162
163
164### iOS の気まぐれ
165
166`uuid`IOS で、デバイスに固有ではないインストールごと、アプリケーションごとに異なります。 削除、アプリを再インストールした場合に変更と多分またときアップグレード iOS の, またはもアップグレードするアプリ (iOS の 5.1 で明らかに) バージョンごと。 `uuid`は信頼性の高い値ではありません。
167
168### Windows Phone 7 と 8 癖
169
170`uuid`のために Windows Phone 7 には、権限が必要です `ID_CAP_IDENTITY_DEVICE` 。 Microsoft はすぐにこのプロパティを廃止して可能性があります。 機能が利用できない場合、アプリケーションはデバイスへのアプリケーションのインストールの持続期間のために保持されている永続的な guid を生成します。
171
172## device.version
173
174オペレーティング システムのバージョンを取得します。
175
176 var string = device.version;
177
178
179### サポートされているプラットフォーム
180
181 * アンドロイド 2.1 +
182 * ブラックベリー 10
183 * ブラウザー
184 * iOS
185 * Tizen
186 * Windows Phone 7 と 8
187 * Windows 8
188
189### 簡単な例
190
191 // Android: Froyo OS would return "2.2"
192 // Eclair OS would return "2.1", "2.0.1", or "2.0"
193 // Version can also return update level "2.1-update1"
194 //
195 // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
196 //
197 // Browser: Returns version number for the browser
198 //
199 // iPhone: iOS 3.2 returns "3.2"
200 //
201 // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
202 // Tizen: returns "TIZEN_20120425_2"
203 var deviceVersion = device.version;