You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mw...@apache.org on 2012/07/12 23:04:38 UTC
[20/25] copy docs/jp/1.7.0 to docs/jp/1.8.1
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/media/media.pause.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/media/media.pause.md b/docs/jp/1.8.1/cordova/media/media.pause.md
new file mode 100644
index 0000000..0c1647a
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/media/media.pause.md
@@ -0,0 +1,168 @@
+---
+license: 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.
+---
+
+media.pause
+===========
+
+オーディオファイルを一時停止します。
+
+ media.pause();
+
+
+概要
+-----------
+
+`media.pause` 関数はオーディオファイルを一時停止させる同期関数です。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // オーディオ再生
+ //
+ function playAudio(url) {
+ // URL のオーディオファイルを再生
+ var my_media = new Media(url,
+ // 呼び出し成功
+ function() {
+ console.log("playAudio():Audio Success");
+ },
+ // 呼び出し失敗
+ function(err) {
+ console.log("playAudio():Audio Error: "+err);
+ });
+
+ // オーディオ再生
+ my_media.play();
+
+ // 10秒後に一時停止
+ setTimeout(function() {
+ media.pause();
+ }, 10000);
+ }
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/media/media.play.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/media/media.play.md b/docs/jp/1.8.1/cordova/media/media.play.md
new file mode 100644
index 0000000..0cd64da
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/media/media.play.md
@@ -0,0 +1,175 @@
+---
+license: 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.
+---
+
+media.play
+==========
+
+オーディオファイルを再生または再開します。
+
+ media.play();
+
+
+概要
+-----------
+
+`media.play` 関数はオーディオファイルを再生または再開させる同期関数です。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // オーディオ再生
+ //
+ function playAudio(url) {
+ // URL のオーディオファイルを再生
+ var my_media = new Media(url,
+ // 呼び出し成功
+ function() {
+ console.log("playAudio():Audio Success");
+ },
+ // 呼び出し失敗
+ function(err) {
+ console.log("playAudio():Audio Error: "+err);
+ });
+
+ // オーディオ再生
+ my_media.play();
+ }
+
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ if (my_media == null) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+ } // else 現在のオーディオを再生
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+iOS に関する注意点
+---------
+
+- __numberOfLoops__
+
+ このオプションを **play** メソッドに渡すことで、そのメディアファイルを何回再生するかを指定します。例:
+
+ var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3")
+ myMedia.play({ numberOfLoops: 2 })
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/media/media.release.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/media/media.release.md b/docs/jp/1.8.1/cordova/media/media.release.md
new file mode 100644
index 0000000..a0be958
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/media/media.release.md
@@ -0,0 +1,153 @@
+---
+license: 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.
+---
+
+media.release
+=================
+
+OS のオーディオリソースを開放します。
+
+ media.release();
+
+
+概要
+-----------
+
+`media.release` 関数は OS のオーディオリソースを開放する同期関数です。 Android ではメディア再生のための OpenCore インスタンスが有限のため、この関数は特に Android にとって重要な関数です。 メディアリソースが不要になった場合には、 'release' 関数を使用してください。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // オーディオプレイヤー
+ //
+ var my_media = new Media(src, onSuccess, onError);
+
+ my_media.play();
+ my_media.stop();
+ my_media.release();
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/media/media.seekTo.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/media/media.seekTo.md b/docs/jp/1.8.1/cordova/media/media.seekTo.md
new file mode 100644
index 0000000..4fe2d27
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/media/media.seekTo.md
@@ -0,0 +1,151 @@
+---
+license: 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.
+---
+
+media.seekTo
+========================
+
+オーディオファイル中の再生位置を動かします。
+
+ media.seekTo(milliseconds);
+
+パラメーター
+----------
+
+- __milliseconds__: 再生位置を動かす先の位置をミリ秒単位で表します
+
+
+概要
+-----------
+
+`media.seekTo` 関数は Media オブジェクトのオーディオファイルの現在再生位置を更新する非同期関数です。 Media オブジェクト内の __position__ パラメーターの値も更新します。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // オーディオプレイヤー
+ //
+ var my_media = new Media(src, onSuccess, onError);
+ my_media.play();
+ // 5秒後に、10秒の位置まで移動
+ setTimeout(function() {
+ my_media.seekTo(10000);
+ }, 5000);
+
+
+Full Example
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+ // メディアの再生位置を一秒ごとに更新
+ mediaTimer = setInterval(function() {
+ // 再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition(position + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ }
+ );
+ }, 1000);
+ // 5秒後に、10秒の位置まで移動
+ setTimeout(function() {
+ my_media.seekTo(10000);
+ }, 5000);
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/media/media.startRecord.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/media/media.startRecord.md b/docs/jp/1.8.1/cordova/media/media.startRecord.md
new file mode 100644
index 0000000..0b45d93
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/media/media.startRecord.md
@@ -0,0 +1,136 @@
+---
+license: 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.
+---
+
+media.startRecord
+=================
+
+オーディオファイルの録音を開始します。
+
+ media.startRecord();
+
+
+概要
+-----------
+
+`media.startRecord` 関数はオーディオファイルの録音を開始する同期関数です。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // オーディオの録音
+ //
+ function recordAudio() {
+ var src = "myrecording.mp3";
+ var mediaRec = new Media(src,
+ // 呼び出し成功
+ function() {
+ console.log("recordAudio():Audio Success");
+ },
+
+ // 呼び出し失敗
+ function(err) {
+ console.log("recordAudio():Audio Error: "+ err.code);
+ });
+
+ // オーディオの録音
+ mediaRec.startRecord();
+ }
+
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>デバイスプロパティーの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // オーディオの録音
+ //
+ function recordAudio() {
+ var src = "myrecording.mp3";
+ var mediaRec = new Media(src, onSuccess, onError);
+
+ // オーディオの録音
+ mediaRec.startRecord();
+
+ // 10秒後に録音を停止
+ var recTime = 0;
+ var recInterval = setInterval(function() {
+ recTime = recTime + 1;
+ setAudioPosition(recTime + " sec");
+ if (recTime >= 10) {
+ clearInterval(recInterval);
+ mediaRec.stopRecord();
+ }
+ }, 1000);
+ }
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ recordAudio();
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("recordAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <p id="media">オーディオを録音...</p>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+
+iOS に関する注意点
+----------
+
+- 録音するためのファイルは既に .wav 形式で存在していなければなりません。 File API 群を使用することでファイルを作成することができます。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/media/media.stop.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/media/media.stop.md b/docs/jp/1.8.1/cordova/media/media.stop.md
new file mode 100644
index 0000000..2176547
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/media/media.stop.md
@@ -0,0 +1,168 @@
+---
+license: 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.
+---
+
+media.stop
+==========
+
+オーディオファイルを停止します。
+
+ media.stop();
+
+
+概要
+-----------
+
+`media.stop` 関数はオーディオファイルを停止させる同期関数です。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // オーディオ再生
+ //
+ function playAudio(url) {
+ // URL のオーディオファイルを再生
+ var my_media = new Media(url,
+ // 呼び出し成功
+ function() {
+ console.log("playAudio():Audio Success");
+ },
+ // 呼び出し失敗
+ function(err) {
+ console.log("playAudio():Audio Error: "+err);
+ });
+
+ // オーディオ再生
+ my_media.play();
+
+ // 10秒後に一時停止
+ setTimeout(function() {
+ my_media.stop();
+ }, 10000);
+ }
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/media/media.stopRecord.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/media/media.stopRecord.md b/docs/jp/1.8.1/cordova/media/media.stopRecord.md
new file mode 100644
index 0000000..f35826a
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/media/media.stopRecord.md
@@ -0,0 +1,138 @@
+---
+license: 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.
+---
+
+media.stopRecord
+================
+
+オーディオファイルの録音を停止します。
+
+ media.stopRecord();
+
+
+概要
+-----------
+
+`media.stopRecord` 関数はオーディオファイルの録音を停止させる同期関数です。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // オーディオの録音
+ //
+ function recordAudio() {
+ var src = "myrecording.mp3";
+ var mediaRec = new Media(src,
+ // 呼び出し成功
+ function() {
+ console.log("recordAudio():Audio Success");
+ },
+
+ // 呼び出し失敗
+ function(err) {
+ console.log("recordAudio():Audio Error: "+ err.code);
+ });
+
+ // オーディオの録音
+ mediaRec.startRecord();
+
+ // 10秒後に録音を停止
+ setTimeout(function() {
+ mediaRec.stopRecord();
+ }, 10000);
+ }
+
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>デバイスプロパティーの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // オーディオの録音
+ //
+ function recordAudio() {
+ var src = "myrecording.mp3";
+ var mediaRec = new Media(src, onSuccess, onError);
+
+ // オーディオの録音
+ mediaRec.startRecord();
+
+ // 10秒後に録音を停止
+ var recTime = 0;
+ var recInterval = setInterval(function() {
+ recTime = recTime + 1;
+ setAudioPosition(recTime + " sec");
+ if (recTime >= 10) {
+ clearInterval(recInterval);
+ mediaRec.stopRecord();
+ }
+ }, 1000);
+ }
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ recordAudio();
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("recordAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <p id="media">オーディオを録音...</p>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+
+
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/notification/notification.alert.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/notification/notification.alert.md b/docs/jp/1.8.1/cordova/notification/notification.alert.md
new file mode 100644
index 0000000..037e414
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/notification/notification.alert.md
@@ -0,0 +1,115 @@
+---
+license: 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.
+---
+
+notification.alert
+==================
+
+通知ダイアログボックスを表示します。
+
+ navigator.notification.alert(message, alertCallback, [title], [buttonName])
+
+- __message:__ ダイアログのメッセージを表します (`String`)
+- __alertCallback:__ 通知ダイアログが確認された後に呼び出されるコールバック関数を表します (`Function`)
+- __title:__ ダイアログのタイトルを表します (`String`) (オプション, デフォルト: "Alert")
+- __buttonName:__ ボタンの名前を表します (`String`) (オプション, デフォルト: "OK")
+
+概要
+-----------
+
+ほとんどの Cordova の実装はネイティブのダイアログボックスを使用しています。一部のプラットフォームのみブラウザの `alert` 関数を使っており、通常これらはカスタマイズが制限されます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iPhone
+- Windows Phone 7 (Mango)
+- Bada 1.2 & 2.x
+
+使用例
+-------------
+
+ // Android / BlackBerry WebWorks (OS 5.0 以上) / iPhone
+ //
+ function alertDismissed() {
+ // 任意のコード
+ }
+
+ navigator.notification.alert(
+ 'あなたの勝ちです!', // メッセージ
+ alertDismissed, // コールバック関数
+ 'ゲームオーバー', // タイトル
+ '終了' // ボタン名
+ );
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ // 処理なし
+ }
+
+ // 通知ダイアログボックスが確認された
+ function alertDismissed() {
+ // 任意のコード
+ }
+
+ // 通知ダイアログを表示
+ //
+ function showAlert() {
+ navigator.notification.alert(
+ 'あなたの勝ちです!', // メッセージ
+ alertDismissed, // コールバック関数
+ 'ゲームオーバー', // タイトル
+ '終了' // ボタン名
+ );
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showAlert(); return false;">通知を表示</a></p>
+ </body>
+ </html>
+
+Windows Phone 7 に関する注意点
+-------------
+
+- ボタンの名前は無視され、常に 'OK' が使用されます。
+- ビルトインのブラウザ通知ダイアログ機能はないため、もし alert('foo'); とだけ書きたい場合は、 window.alert = navigator.notification.alert; と window.alert に Cordova の notification.alert をアサインできます。
+- 通知と確認の呼び出しはノンブロッキングで、結果は非同期でのみ取得可能です。
+
+Bada 2.xに関する注意点
+---------------
+- 通知は、 Javascript の alert を使用します。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/notification/notification.beep.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/notification/notification.beep.md b/docs/jp/1.8.1/cordova/notification/notification.beep.md
new file mode 100644
index 0000000..2f10730
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/notification/notification.beep.md
@@ -0,0 +1,113 @@
+---
+license: 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.
+---
+
+notification.beep
+=================
+
+デバイスが警告音を鳴らします。
+
+ navigator.notification.beep(times);
+
+- __times:__ 警告音を鳴らす回数を表します (`Number`)
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iPhone
+- Windows Phone 7 (Mango)
+- Bada 1.2 & 2.x
+
+使用例
+-------------
+
+ // 警告音を2回鳴らす
+ navigator.notification.beep(2);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ // 処理なし
+ }
+
+ // 通知ダイアログを表示
+ //
+ function showAlert() {
+ navigator.notification.alert(
+ 'あなたの勝ちです!', // メッセージ
+ 'ゲームオーバー', // タイトル
+ '終了' // ボタン名
+ );
+ }
+
+ // 警告音を3回鳴らす
+ //
+ function playBeep() {
+ navigator.notification.beep(3);
+ }
+
+ // 2秒間バイブレーションさせます
+ //
+ function vibrate() {
+ navigator.notification.vibrate(2000);
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showAlert(); return false;">通知を表示</a></p>
+ <p><a href="#" onclick="playBeep(); return false;">警告音を鳴らす</a></p>
+ <p><a href="#" onclick="vibrate(); return false;">バイブレーション</a></p>
+ </body>
+ </html>
+
+Android に関する注意点
+--------------
+
+- Android では、 "Settings/Sound & Display" パネルで設定されたデフォルトの "Notification ringtone" を鳴らします。
+
+iPhone に関する注意点
+-------------
+
+- 引数の警告音の回数を無視します。
+- iPhone はネイティブの beep API を持っていません。
+- Cordova は media API を使って、オーディオファイルを再生することで警告音を実装しています。
+- ユーザーは適切な警告音のファイルを用意する必要があります。
+- このファイルは30秒未満とし、 www/root に beep.wav として保存してください。
+
+Windows Phone 7 に関する注意点
+-------------
+
+- WP7 の Cordova ライブラリは独自の警告音ファイルを含んでおり、それを使用しています。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/notification/notification.confirm.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/notification/notification.confirm.md b/docs/jp/1.8.1/cordova/notification/notification.confirm.md
new file mode 100755
index 0000000..00b7f61
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/notification/notification.confirm.md
@@ -0,0 +1,122 @@
+---
+license: 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.
+---
+
+notification.confirm
+====================
+
+カスタマイズ可能な確認ダイアログボックスを表示します。
+
+ navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
+
+- __message:__ ダイアログのメッセージを表します (`String`)
+- __confirmCallback:__ 押されたボタンのインデックス (1, 2, または3) とともに呼び出されるコールバック関数を表します (`Number`)
+- __title:__ ダイアログのタイトルを表します (`String`) (オプション, デフォルト: "Confirm")
+- __buttonLabels:__ ボタンのラベルを設定するためのカンマ区切りの文字列を表します (String) (オプション, デフォルト: "OK,Cancel")
+
+概要
+-----------
+
+`notification.confirm` 関数は、ブラウザの confirm 関数よりも広いカスタマイズ性を持ったネイティブダイアログボックスを表示する関数です。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iPhone
+- Windows Phone 7 (Mango)
+- Bada 1.2 & 2.x
+
+使用例
+-------------
+
+ // 確認ダイアログの表示プロセスの開始
+ function onConfirm(button) {
+ alert('選択されたボタン ' + button);
+ }
+
+ // カスタム確認ダイアログを表示
+ //
+ function showConfirm() {
+ navigator.notification.confirm(
+ 'あなたの勝ちです!', // メッセージ
+ onConfirm, // 選択されたボタン情報とともに呼ばれるコールバック関数
+ 'ゲームオーバー', // タイトル
+ 'リスタート,終了' // ボタン
+ );
+ }
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ // 処理なし
+ }
+
+ // 確認ダイアログの表示プロセスの開始
+ function onConfirm(button) {
+ alert('選択されたボタン ' + button);
+ }
+
+ // カスタム確認ダイアログを表示
+ //
+ function showConfirm() {
+ navigator.notification.confirm(
+ 'あなたの勝ちです!', // メッセージ
+ onConfirm, // 選択されたボタン情報とともに呼ばれるコールバック関数
+ 'ゲームオーバー', // タイトル
+ 'リスタート,終了' // ボタン
+ );
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showConfirm(); return false;">確認ダイアログを表示</a></p>
+ </body>
+ </html>
+
+Windows Phone 7 に関する注意点
+-------------
+
+- ボタンの名前は無視され、常に 'OK|Cancel' が使用されます。
+- ビルトインのブラウザ確認ダイアログ機能はないため、もし confirm('foo'); とだけ書きたい場合は、 window.confirm = navigator.notification.confirm; と window.confirm に Cordova の notification.confirm をアサインできます。
+- 通知と確認の呼び出しはノンブロッキングで、結果は非同期でのみ取得可能です。
+
+Bada 2.x に関する注意点
+---------------
+- 確認は、 Javascript の alert を使用します。
+
+Bada 1.2 に関する注意点
+---------------
+- ボタンの名前は無視され、常に 'OK|Cancel' が使用されます。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/notification/notification.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/notification/notification.md b/docs/jp/1.8.1/cordova/notification/notification.md
new file mode 100644
index 0000000..b973916
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/notification/notification.md
@@ -0,0 +1,31 @@
+---
+license: 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.
+---
+
+Notification
+============
+
+> 視覚、聴覚、触覚を用いたデバイス通知機能を提供します。
+
+メソッド
+-------
+
+- notification.alert
+- notification.confirm
+- notification.beep
+- notification.vibrate
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/notification/notification.vibrate.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/notification/notification.vibrate.md b/docs/jp/1.8.1/cordova/notification/notification.vibrate.md
new file mode 100644
index 0000000..8229a64
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/notification/notification.vibrate.md
@@ -0,0 +1,103 @@
+---
+license: 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.
+---
+
+notification.vibrate
+====================
+
+指定された時間デバイスをバイブレーションさせます。
+
+ navigator.notification.vibrate(milliseconds)
+
+- __time:__ バイブレーションの長さをミリ秒単位で表します。 1000ミリ秒は1秒です (`Number`)
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iPhone
+- Windows Phone 7
+- Bada 1.2 & 2.x
+
+使用例
+-------------
+
+ // 2.5秒間バイブレーションさせます
+ //
+ navigator.notification.vibrate(2500);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ // 処理なし
+ }
+
+ // 通知ダイアログを表示
+ //
+ function showAlert() {
+ navigator.notification.alert(
+ 'あなたの勝ちです!', // メッセージ
+ 'ゲームオーバー', // タイトル
+ '終了' // ボタン名
+ );
+ }
+
+ // 警告音を3回鳴らす
+ //
+ function playBeep() {
+ navigator.notification.beep(3);
+ }
+
+ // 2秒間バイブレーションさせます
+ //
+ function vibrate() {
+ navigator.notification.vibrate(2000);
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showAlert(); return false;">通知を表示</a></p>
+ <p><a href="#" onclick="playBeep(); return false;">警告音を鳴らす</a></p>
+ <p><a href="#" onclick="vibrate(); return false;">バイブレーション</a></p>
+ </body>
+ </html>
+
+iPhone に関する注意点
+-------------
+
+- __time:__ 引数のバイブレーションの長さを無視し、あらかじめ定められた時間バイブレーションします。
+
+ navigator.notification.vibrate();
+ navigator.notification.vibrate(2500); // 2500は無視されます
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/database/database.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/database/database.md b/docs/jp/1.8.1/cordova/storage/database/database.md
new file mode 100644
index 0000000..fe1676f
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/database/database.md
@@ -0,0 +1,123 @@
+---
+license: 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.
+---
+
+Database
+=======
+
+データベースの操作に必要なメソッドを提供します。
+
+メソッド
+-------
+
+- __transaction__: データベースのトランザクションを実行します
+- __changeVersion__: スクリプトがデータベースのバージョンを自動的に確認し、スキーマのアップデートと同時にバージョンを変更します
+
+詳細
+-------
+
+Database オブジェクトは `window.openDatabase()` メソッド呼び出し時に返されるオブジェクトです。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 以上)
+- iPhone
+
+Transaction の例
+------------------
+ function populateDB(tx) {
+ tx.executeSql('DROP TABLE IF EXISTS DEMO');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+ }
+
+ function errorCB(err) {
+ alert("SQL実行中にエラーが発生しました: "+err.code);
+ }
+
+ function successCB() {
+ alert("成功しました。");
+ }
+
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(populateDB, errorCB, successCB);
+
+Change Version の例
+-------------------
+
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.changeVersion("1.0", "1.1");
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Contact の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(populateDB, errorCB, successCB);
+ }
+
+ // データベースを操作
+ //
+ function populateDB(tx) {
+ tx.executeSql('DROP TABLE IF EXISTS DEMO');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+ }
+
+ // トランザクション失敗時のコールバック
+ //
+ function errorCB(tx, err) {
+ alert("SQL実行中にエラーが発生しました: "+err);
+ }
+
+ // トランザクション成功時のコールバック
+ //
+ function successCB() {
+ alert("成功しました。");
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>Example</h1>
+ <p>Database</p>
+ </body>
+ </html>
+
+Android 1.X に関する注意点
+------------------
+
+- __changeVersion:__ このメソッドは Android 1.X デバイスではサポートされていません。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/localstorage/localstorage.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/localstorage/localstorage.md b/docs/jp/1.8.1/cordova/storage/localstorage/localstorage.md
new file mode 100644
index 0000000..22b1743
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/localstorage/localstorage.md
@@ -0,0 +1,119 @@
+---
+license: 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.
+---
+
+localStorage
+===============
+
+W3C Storage interface (http://dev.w3.org/html5/webstorage/#the-localstorage-attribute) へのアクセスを提供します。
+
+ var storage = window.localStorage;
+
+メソッド
+-------
+
+- __key__: キーの名前を返します
+- __getItem__: キーによって指定されたアイテムを返します
+- __setItem__: キーによって指定されたアイテムを保存します
+- __removeItem__: キーによって指定されたアイテムを削除します
+- __clear__: 全てのキーとアイテムを削除します
+
+詳細
+-----------
+
+localStorage は W3C Storage interface へのインターフェースを提供します。キーと値のペアでデータを管理します。
+
+注意: window.sessionStorage は同じインターフェースを提供しますが、アプリが起動するたびにこの値はクリアされます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 以上)
+- iPhone
+- Windows Phone 7
+
+Key の例
+-------------
+
+ var keyName = window.localStorage.key(0);
+
+Set Item の例
+-------------
+
+ window.localStorage.setItem("key", "value");
+
+Get Item の例
+-------------
+
+ var value = window.localStorage.getItem("key");
+ // value の値は "value"
+
+Remove Item の例
+-------------
+
+ window.localStorage.removeItem("key");
+
+Clear の例
+-------------
+
+ window.localStorage.clear();
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Contact の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ window.localStorage.setItem("key", "value");
+ var keyname = window.localStorage.key(i);
+ // key の値は "key"
+ var value = window.localStorage.getItem("key");
+ // value の値は "value"
+ window.localStorage.removeItem("key");
+ window.localStorage.setItem("key2", "value2");
+ window.localStorage.clear();
+ // localStorage は空
+ }
+
+
+ </script>
+ </head>
+ <body>
+ <h1>使用例</h1>
+ <p>localStorage のサンプル</p>
+ </body>
+ </html>
+
+
+Windows Phone 7 に関する注意点
+-------------
+
+- ドット表記は Windows Phone では使用できません。 window.localStorage.setItem/getItem メソッドを使用して、 W3C の仕様で定義されている window.localStorage.someKey = 'someValue'; の方法は使用しないでください。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/parameters/display_name.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/parameters/display_name.md b/docs/jp/1.8.1/cordova/storage/parameters/display_name.md
new file mode 100644
index 0000000..f4a780f
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/parameters/display_name.md
@@ -0,0 +1,23 @@
+---
+license: 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.
+---
+
+database_displayname
+==================
+
+実際に表示されるデータベース名です。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/parameters/name.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/parameters/name.md b/docs/jp/1.8.1/cordova/storage/parameters/name.md
new file mode 100644
index 0000000..069bcc2
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/parameters/name.md
@@ -0,0 +1,23 @@
+---
+license: 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.
+---
+
+database_name
+============
+
+データベース名です。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/parameters/size.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/parameters/size.md b/docs/jp/1.8.1/cordova/storage/parameters/size.md
new file mode 100644
index 0000000..7e726c3
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/parameters/size.md
@@ -0,0 +1,23 @@
+---
+license: 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.
+---
+
+database_size
+==============
+
+データベースのサイズです。バイト単位で表されます。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/parameters/version.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/parameters/version.md b/docs/jp/1.8.1/cordova/storage/parameters/version.md
new file mode 100644
index 0000000..a24b4e1
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/parameters/version.md
@@ -0,0 +1,23 @@
+---
+license: 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.
+---
+
+database_version
+=============
+
+データベースのバージョンです。
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/sqlerror/sqlerror.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/sqlerror/sqlerror.md b/docs/jp/1.8.1/cordova/storage/sqlerror/sqlerror.md
new file mode 100644
index 0000000..a55a362
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/sqlerror/sqlerror.md
@@ -0,0 +1,47 @@
+---
+license: 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.
+---
+
+SQLError
+========
+
+エラー発生時に投げられる `SQLError` オブジェクトです。
+
+プロパティー
+----------
+
+- __code:__ 事前に定義された以下のエラーコードのうちの1つを表します
+- __message:__ エラーの詳細メッセージを表します
+
+定数
+---------
+
+- `SQLError.UNKNOWN_ERR`
+- `SQLError.DATABASE_ERR
+- `SQLError.VERSION_ERR`
+- `SQLError.TOO_LARGE_ERR`
+- `SQLError.QUOTA_ERR`
+- `SQLError.SYNTAX_ERR`
+- `SQLError.CONSTRAINT_ERR`
+- `SQLError.TIMEOUT_ERR`
+
+概要
+-----------
+
+データベース操作時のエラーに対して投げられる `SQLError` オブジェクトです。
+
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/sqlresultset/sqlresultset.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/sqlresultset/sqlresultset.md b/docs/jp/1.8.1/cordova/storage/sqlresultset/sqlresultset.md
new file mode 100644
index 0000000..034eec7
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/sqlresultset/sqlresultset.md
@@ -0,0 +1,132 @@
+---
+license: 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.
+---
+
+SQLResultSet
+=======
+
+SQLTransaction の executeSql メソッドが呼ばれるとき、 SQLResultSet とともにコールバック関数が呼び出されます。
+
+プロパティー
+-------
+
+- __insertId__: SQLResultSet オブジェクトの SQL 文によりデータベースに挿入された行の行番号を表します
+- __rowsAffected__: SQL 文によって変更された行数を表します。もし SQL 文がデータベースに変更を加えなかった場合は0を返します
+- __rows__: 結果を表す SQLResultSetRowList オブジェクトです。行が返されなかった場合、オブジェクトは空になります
+
+詳細
+-------
+
+SQLTransaction の executeSql メソッドが呼び出されるとき、 SQLResultSet オブジェクトとともにコールバック関数が呼び出されます。この結果オブジェクトは3つのプロパティーを持っています。1つめは `insertId` で、 SQL の insert 文が成功した行の番号を返します。もし SQL 文が insert 文では無かった場合、 `insertId` はセットされません。2つめの `rowsAffected` は SQL の select 文に対しては常に0を返します。 insert もしくは update 文に対しては、修正された行数を返します。最後の SQLResultSetList は、 SQL の select 文によって返されたデータを保持します。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 以上)
+- iPhone
+
+Execute SQL の例
+------------------
+
+ function queryDB(tx) {
+ tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+ }
+
+ function querySuccess(tx, results) {
+ console.log("検索された行 = " + results.rows.length);
+ // select 文のため、 rowsAffected は0となり、 true となります
+ if (!results.rowsAffected) {
+ console.log('どの行も変更されていません。');
+ return false;
+ }
+ // insert 文では、このプロパティーは挿入された最終行を表します
+ console.log("挿入された行 = " + results.insertId);
+ }
+
+ function errorCB(err) {
+ alert("SQL 実行中にエラーが発生しました: "+err.code);
+ }
+
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(queryDB, errorCB);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Contact の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // データベースを操作
+ //
+ function populateDB(tx) {
+ tx.executeSql('DROP TABLE IF EXISTS DEMO');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+ }
+
+ // データベースに問い合わせ
+ //
+ function queryDB(tx) {
+ tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+ }
+
+ // 問い合わせ成功時のコールバック
+ //
+ function querySuccess(tx, results) {
+ console.log("検索された行 = " + results.rows.length);
+ // select 文のため、 rowsAffected は0となり、 true となります
+ if (!resultSet.rowsAffected) {
+ console.log('どの行も変更されていません。');
+ return false;
+ }
+ // insert 文では、このプロパティーは挿入された最終行を表します
+ console.log("挿入された行 = " + results.insertId);
+ }
+
+ // トランザクション失敗時のコールバック
+ //
+ function successCB() {
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(queryDB, errorCB);
+ }
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(populateDB, errorCB, successCB);
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>使用例</h1>
+ <p>データベース</p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/0756c5c4/docs/jp/1.8.1/cordova/storage/sqlresultsetlist/sqlresultsetlist.md
----------------------------------------------------------------------
diff --git a/docs/jp/1.8.1/cordova/storage/sqlresultsetlist/sqlresultsetlist.md b/docs/jp/1.8.1/cordova/storage/sqlresultsetlist/sqlresultsetlist.md
new file mode 100644
index 0000000..43a97fa
--- /dev/null
+++ b/docs/jp/1.8.1/cordova/storage/sqlresultsetlist/sqlresultsetlist.md
@@ -0,0 +1,135 @@
+---
+license: 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.
+---
+
+SQLResultSetList
+=======
+
+SQL 問い合わせから返される行を保持した SQLResultSet のプロパティーのうちの1つです。
+
+プロパティー
+-------
+
+- __length__: SQL 問い合わせによって返される行の行数を表します
+
+メソッド
+-------
+
+- __item__: 指定された行を JavaScript オブジェクトとして返します
+
+詳細
+-------
+
+SQLResultSetList は SQL の select 文によって返されるデータを保持しています。このオブジェクトは select 文によって返された行の数を表す length プロパティーを持っています。ある行のデータを取得するためには、行番号を指定した `item` メソッドを使用します。この item メソッドは JavaScript オブジェクトを返します。この JavaScript オブジェクトは select 文が実行されたデータベースのカラムをプロパティーとして持っています。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 以上)
+- iPhone
+
+Execute SQL の例
+------------------
+
+ function queryDB(tx) {
+ tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+ }
+
+ function querySuccess(tx, results) {
+ var len = results.rows.length;
+ console.log("DEMO table: " + len + " 行見つかりました。");
+ for (var i=0; i<len; i++){
+ console.log("行 = " + i + " ID = " + results.rows.item(i).id + " Data = " + results.rows.item(i).data);
+ }
+ }
+
+ function errorCB(err) {
+ alert("SQL 実行中にエラーが発生しました: "+err.code);
+ }
+
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(queryDB, errorCB);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Contact の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // データベースを操作
+ //
+ function populateDB(tx) {
+ tx.executeSql('DROP TABLE IF EXISTS DEMO');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+ }
+
+ // データベースに問い合わせ
+ //
+ function queryDB(tx) {
+ tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+ }
+
+ // 問い合わせ成功時のコールバック
+ //
+ function querySuccess(tx, results) {
+ var len = results.rows.length;
+ console.log("DEMO table: " + len + " 行見つかりました。");
+ for (var i=0; i<len; i++){
+ console.log("行 = " + i + " ID = " + results.rows.item(i).id + " Data = " + results.rows.item(i).data);
+ }
+ }
+
+ // トランザクション失敗時のコールバック
+ //
+ function errorCB(err) {
+ console.log("SQL 実行中にエラーが発生しました: "+err.code);
+ }
+
+ // トランザクション成功時のコールバック
+ //
+ function successCB() {
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(queryDB, errorCB);
+ }
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(populateDB, errorCB, successCB);
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>使用例</h1>
+ <p>データベース</p>
+ </body>
+ </html>