Lisa testing pulling in plugins for plugin: cordova-plugin-network-information
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/commit/996cd746 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/996cd746 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/996cd746 Branch: refs/heads/master Commit: 996cd746f32fb83aa20a9882a633b0c73c8293bd Parents: 401ea85 Author: ldeluca <[email protected]> Authored: Tue May 27 17:49:56 2014 -0400 Committer: ldeluca <[email protected]> Committed: Tue May 27 17:49:56 2014 -0400 ---------------------------------------------------------------------- doc/ja/index.md | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/996cd746/doc/ja/index.md ---------------------------------------------------------------------- diff --git a/doc/ja/index.md b/doc/ja/index.md new file mode 100644 index 0000000..965fc01 --- /dev/null +++ b/doc/ja/index.md @@ -0,0 +1,181 @@ +<!--- + 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. +--> + +# org.apache.cordova.network-information + +This plugin provides an implementation of an old version of the [Network Information API][1]. It provides information about the device's cellular and wifi connection, and whether the device has an internet connection. + + [1]: http://www.w3.org/TR/2011/WD-netinfo-api-20110607/ + +## ã¤ã³ã¹ãã¼ã« + + cordova plugin add org.apache.cordova.network-information + + +## ãµãã¼ãããã¦ãããã©ãããã©ã¼ã + +* ã¢ãã¾ã³ç« OS +* ã¢ã³ããã¤ã +* ãã©ãã¯ããªã¼ 10 +* iOS +* Windows Phone 7 㨠8 +* Tizen +* Windows 8 +* Firefox OS + +# æ¥ç¶ + +> `connection`ãªãã¸ã§ã¯ãã«ãã£ã¦å ¬éãã㦠`navigator.connection` ãããã¤ã¹ã®æºå¸¯é»è©±ã wifi æ¥ç¶ã«é¢ããæ å ±ãæä¾ãã¾ãã + +## ãããã㣠+ +* connection.type + +## 宿° + +* Connection.UNKNOWN +* Connection.ETHERNET +* Connection.WIFI +* Connection.CELL_2G +* Connection.CELL_3G +* Connection.CELL_4G +* Connection.CELL +* Connection.NONE + +## connection.type + +ãã®ããããã£ã¯ããã¤ã¹ã®ãããã¯ã¼ã¯æ¥ç¶ç¶æ ã確èªããéãæ¹æ³ãæä¾ããæ¥ç¶ã®ç¨®é¡ã + +### ç°¡åãªä¾ + + function checkConnection() { + var networkState = navigator.connection.type; + + var states = {}; + states[Connection.UNKNOWN] = 'Unknown connection'; + states[Connection.ETHERNET] = 'Ethernet connection'; + states[Connection.WIFI] = 'WiFi connection'; + states[Connection.CELL_2G] = 'Cell 2G connection'; + states[Connection.CELL_3G] = 'Cell 3G connection'; + states[Connection.CELL_4G] = 'Cell 4G connection'; + states[Connection.CELL] = 'Cell generic connection'; + states[Connection.NONE] = 'No network connection'; + + alert('Connection type: ' + states[networkState]); + } + + checkConnection(); + + +### API ã®å¤æ´ + +ã³ã«ãã 2.3.0ãã¾ã§ã `Connection` çµç±ã§ã¢ã¯ã»ã¹ããããªãã¸ã§ã¯ãã `navigator.network.connection` ãããã«å¤æ´ããã¾ãããå¾ `navigator.connection` W3C ã®ä»æ§ã«ä¸è´ãã¾ãã ããã¯ã¾ã å ã®å ´æã¯å»æ¢ãããæçµçã«åé¤ããã¾ãã + +### iOS ã®ç + +* iOS ã¯ãæºå¸¯é»è©±ã®ãããã¯ã¼ã¯æ¥ç¶ã®ç¨®é¡ãæ¤åºã§ãã¾ããã + * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + +### Windows Phone ã®ç + +* When running in the emulator, always detects `navigator.connection.type` as `Connection.UNKNOWN`. + +* Windows Phone æºå¸¯é»è©±ãããã¯ã¼ã¯æ¥ç¶ã®ç¨®é¡ãæ¤åºã§ãã¾ããã + + * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + +### Tizen ã®ç + +* Tizen ã«ã¯ãWiFi ã¾ãã¯æºå¸¯é»è©±ã®æ¥ç¶ã ããæ¤åºã§ãã¾ãã + * `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. + +### Firefox OS ç + +* Firefox ã® OS ã¯ãæºå¸¯é»è©±ã®ãããã¯ã¼ã¯æ¥ç¶ã®ç¨®é¡ãæ¤åºã§ãã¾ããã + * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + +# Network-related Events + +## offline + +ã¢ããªã±ã¼ã·ã§ã³ããªãã©ã¤ã³ã«ãªããããã¤ã¹ãã¤ã³ã¿ã¼ãããã«æ¥ç¶ããã¦ããªãã¨ãã«çºçãã¾ãã + + document.addEventListener("offline", yourCallbackFunction, false); + + +### 詳細 + +`offline`ã¢ããªã±ã¼ã·ã§ã³ã¯ãã¯ããã¤ã³ã¿ã¼ãããã«ã¢ã¯ã»ã¹ã§ããããã«ã以忥ç¶ãããããã¤ã¹ã¯ããããã¯ã¼ã¯æ¥ç¶ã失ãããã¨ãã«çºçãã¾ãã æ¥ç¶ API ã¨åãæ å ±ã«ä¾åãã¦ãããå ´åã«é©ç¨ããã¾ãã `connection.type` ãã夿´ `NONE` 以å¤ã®å¤ã«ãã¾ãã + +é常ã¢ããªã±ã¼ã·ã§ã³ã«ä½¿ç¨ããå¿ è¦ãããã¾ã `document.addEventListener` ä¸åº¦ã®ã¤ãã³ã ãªã¹ãã¼ãã¢ã¿ãããã `deviceready` ã¤ãã³ããçºçãã¾ãã + +### ç°¡åãªä¾ + + document.addEventListener("offline", onOffline, false); + + function onOffline() { + // Handle the offline event + } + + +### iOS ã®ç + +ååèµ·åæ (å½ã¦ã¯ã¾ãå ´å) ã®æåã®ãªãã©ã¤ã³ ã¤ãã³ãã¯ç«ã« 1 ç§ä»¥ä¸ãããã¾ãã + +### Windows Phone 7 ã®ç + +ã¨ãã¥ã¬ã¼ã¿ã¼ã§å®è¡ãã¦ããã¨ãã `connection.status` ã¯å¸¸ã«ç¥ããã¦ããããã®ã¤ãã³ãã¯*ãªã*ç«ã + +### Windows Phone 8 ç + +ã¨ãã¥ã¬ã¼ã¿ã¼ã¨æ¥ç¶ã®ç¨®é¡ã®ã¬ãã¼ã `Cellular` ã¯å¤åãã¾ãããã¤ãã³ãã¯*ãªã*ç«ã + +## online + +ã¢ããªã±ã¼ã·ã§ã³ã¯ããªã³ã©ã¤ã³ã«ãªãããããã¤ã¹ãã¤ã³ã¿ã¼ãããã«æ¥ç¶ããã¨ãã«çºçãã¾ãã + + document.addEventListener("online", yourCallbackFunction, false); + + +### 詳細 + +`online`以忥ç¶ããã¦ããªãããã¤ã¹ããã¤ã³ã¿ã¼ãããã¸ã®ã¢ããªã±ã¼ã·ã§ã³ ã¢ã¯ã»ã¹ã許å¯ãããããã¯ã¼ã¯æ¥ç¶ãåä¿¡ããã¨ãã«çºçãã¾ãã æ¥ç¶ API ã¨åãæ å ±ã«ä¾åãã¦ãããç«ç½æã®å¤ `connection.type` ã«ãªãã¾ãã`NONE`. + +é常ã¢ããªã±ã¼ã·ã§ã³ã«ä½¿ç¨ããå¿ è¦ãããã¾ã `document.addEventListener` ä¸åº¦ã®ã¤ãã³ã ãªã¹ãã¼ãã¢ã¿ãããã `deviceready` ã¤ãã³ããçºçãã¾ãã + +### ç°¡åãªä¾ + + document.addEventListener("online", onOnline, false); + + function onOnline() { + // Handle the online event + } + + +### iOS ã®ç + +ååèµ·åæã«ã¯ãæåã® `online` (å½ã¦ã¯ã¾ãå ´å) ã¤ãã³ããå°ãªãã¨ãç«ãåã«ç¬¬ 2 `connection.type` ã¯`UNKNOWN`. + +### Windows Phone 7 ã®ç + +ã¨ãã¥ã¬ã¼ã¿ã¼ã§å®è¡ãã¦ããã¨ãã `connection.status` ã¯å¸¸ã«ç¥ããã¦ããããã®ã¤ãã³ãã¯*ãªã*ç«ã + +### Windows Phone 8 ç + +ã¨ãã¥ã¬ã¼ã¿ã¼ã¨æ¥ç¶ã®ç¨®é¡ã®ã¬ãã¼ã `Cellular` ã¯å¤åãã¾ãããã¤ãã³ãã¯*ãªã*ç«ã \ No newline at end of file
