From 7f8a96965254ba39f65da67b6e68d2285e22b88b Mon Sep 17 00:00:00 2001 From: kazushi Date: Fri, 30 Aug 2013 13:54:33 +0900 Subject: [PATCH 1/5] Translate files (version 2.9.0, Japanese) that newly created in Squashed commit of the following: commit ff22b5290293aa79691506134164edec869e1a9f Author: kazushi Date: Fri Aug 30 12:11:48 2013 +0900 storage commit 84f17d90d0996d92f728677d2a898562853ce54c Author: kazushi Date: Fri Aug 30 11:36:06 2013 +0900 notification commit ba6f4e638c4f735363672b566ac75f391ed7613c Author: kazushi Date: Fri Aug 30 10:48:48 2013 +0900 media commit ac0bf2b58c5dacc126252eaab1fef17b38fffb88 Author: kazushi Date: Thu Aug 29 18:03:20 2013 +0900 splashscreen commit 69fa0e190bcb0fba1fad54c73f32d345068f0da5 Author: kazushi Date: Thu Aug 29 16:57:55 2013 +0900 InAppBrowser commit fc1963b6184a5778a5046cd1c1556476a2e1e7f2 Author: kazushi Date: Thu Aug 29 16:02:09 2013 +0900 globalization commit 57f4d2f617845295d269132ea746e18983591a49 Author: kazushi Date: Thu Aug 29 12:04:35 2013 +0900 geolocation commit 22c47a8b9bdbd2b42cef51949cb9a6cd2f98e673 Author: kazushi Date: Thu Aug 29 11:07:52 2013 +0900 file commit 91b60ed247c23a7974e73e8c1992b10d7ee0858b Author: kazushi Date: Wed Aug 28 15:31:30 2013 +0900 events commit c9ff323d7e68d5d4fe8199a66063fd0854df6695 Author: kazushi Date: Wed Aug 28 09:47:57 2013 +0900 device commit f6ed63b231226fffcba1f5170867a39d3fee1a6a Author: kazushi Date: Wed Aug 28 09:00:08 2013 +0900 contacts commit b83bf779f48e9bdf08778a7683dd5ec4def38308 Author: kazushi Date: Tue Aug 27 16:03:39 2013 +0900 connection commit 1d5f7fbf8530fc64452c601d72c4e5f93b7486a4 Author: kazushi Date: Tue Aug 27 15:45:14 2013 +0900 change permission commit d492279a1a488a4efd9ac595ad1e746de466fbdd Author: kazushi Date: Tue Aug 27 15:40:13 2013 +0900 compass commit 836cab2e94c5418aa95c85d70da057f5f46a3677 Author: kazushi Date: Tue Aug 27 13:46:01 2013 +0900 camera commit 8cddf65a84e3e2b03bad366274b1ac26efd5edde Author: kazushi Date: Tue Aug 27 10:29:10 2013 +0900 accelerometer commit ce9ce7a7dce99532c667ebc22309c0857ddeb303 Author: kazushi Date: Mon Aug 26 17:11:14 2013 +0900 change description commit e8323a40103c041d48e9ba60a4921e767fc279f0 Author: kazushi Date: Mon Aug 26 16:43:53 2013 +0900 add InAppBrowser commit 855d884c475b06dbd4df02773511c26885759250 Author: kazushi Date: Mon Aug 26 15:54:23 2013 +0900 2.9.0-jp docs: first commit --- docs/jp/2.9.0/config.json | 199 ++++++++ .../acceleration/acceleration.md | 106 +++++ .../accelerometer/accelerometer.clearWatch.md | 113 +++++ .../accelerometer.getCurrentAcceleration.md | 109 +++++ .../cordova/accelerometer/accelerometer.md | 82 ++++ .../accelerometer.watchAcceleration.md | 137 ++++++ .../parameters/accelerometerError.md | 27 ++ .../parameters/accelerometerOptions.md | 28 ++ .../parameters/accelerometerSuccess.md | 42 ++ .../jp/2.9.0/cordova/camera/camera.cleanup.md | 50 +++ .../2.9.0/cordova/camera/camera.getPicture.md | 221 +++++++++ docs/jp/2.9.0/cordova/camera/camera.md | 85 ++++ .../camera/parameter/CameraPopoverHandle.md | 68 +++ .../camera/parameter/CameraPopoverOptions.md | 76 ++++ .../cordova/camera/parameter/cameraError.md | 32 ++ .../cordova/camera/parameter/cameraOptions.md | 120 +++++ .../cordova/camera/parameter/cameraSuccess.md | 42 ++ .../cordova/compass/compass.clearWatch.md | 110 +++++ .../compass/compass.clearWatchFilter.md | 23 + .../compass/compass.getCurrentHeading.md | 96 ++++ docs/jp/2.9.0/cordova/compass/compass.md | 73 +++ .../cordova/compass/compass.watchHeading.md | 134 ++++++ .../compass/compass.watchHeadingFilter.md | 23 + .../compass/compassError/compassError.md | 40 ++ .../compass/parameters/compassError.md | 30 ++ .../compass/parameters/compassHeading.md | 47 ++ .../compass/parameters/compassOptions.md | 44 ++ .../compass/parameters/compassSuccess.md | 40 ++ .../jp/2.9.0/cordova/connection/connection.md | 85 ++++ .../cordova/connection/connection.type.md | 126 ++++++ .../2.9.0/cordova/contacts/Contact/contact.md | 226 ++++++++++ .../contacts/ContactAddress/contactaddress.md | 157 +++++++ .../contacts/ContactError/contactError.md | 45 ++ .../contacts/ContactField/contactfield.md | 143 ++++++ .../ContactFindOptions/contactfindoptions.md | 113 +++++ .../contacts/ContactName/contactname.md | 141 ++++++ .../contactorganization.md | 146 ++++++ .../2.9.0/cordova/contacts/contacts.create.md | 77 ++++ .../2.9.0/cordova/contacts/contacts.find.md | 116 +++++ docs/jp/2.9.0/cordova/contacts/contacts.md | 94 ++++ .../contacts/parameters/contactError.md | 27 ++ .../contacts/parameters/contactFields.md | 25 ++ .../contacts/parameters/contactFindOptions.md | 35 ++ .../contacts/parameters/contactSuccess.md | 41 ++ .../jp/2.9.0/cordova/device/device.cordova.md | 80 ++++ docs/jp/2.9.0/cordova/device/device.md | 92 ++++ docs/jp/2.9.0/cordova/device/device.model.md | 99 ++++ docs/jp/2.9.0/cordova/device/device.name.md | 103 +++++ .../2.9.0/cordova/device/device.platform.md | 95 ++++ docs/jp/2.9.0/cordova/device/device.uuid.md | 103 +++++ .../jp/2.9.0/cordova/device/device.version.md | 84 ++++ .../2.9.0/cordova/events/events.backbutton.md | 81 ++++ .../cordova/events/events.batterycritical.md | 90 ++++ .../2.9.0/cordova/events/events.batterylow.md | 90 ++++ .../cordova/events/events.batterystatus.md | 96 ++++ .../cordova/events/events.deviceready.md | 87 ++++ .../cordova/events/events.endcallbutton.md | 82 ++++ docs/jp/2.9.0/cordova/events/events.md | 85 ++++ .../2.9.0/cordova/events/events.menubutton.md | 83 ++++ .../jp/2.9.0/cordova/events/events.offline.md | 97 ++++ docs/jp/2.9.0/cordova/events/events.online.md | 97 ++++ docs/jp/2.9.0/cordova/events/events.pause.md | 90 ++++ docs/jp/2.9.0/cordova/events/events.resume.md | 103 +++++ .../cordova/events/events.searchbutton.md | 82 ++++ .../cordova/events/events.startcallbutton.md | 82 ++++ .../cordova/events/events.volumedownbutton.md | 82 ++++ .../cordova/events/events.volumeupbutton.md | 82 ++++ .../file/directoryentry/directoryentry.md | 398 ++++++++++++++++ .../file/directoryreader/directoryreader.md | 67 +++ docs/jp/2.9.0/cordova/file/file.md | 83 ++++ .../2.9.0/cordova/file/fileentry/fileentry.md | 328 ++++++++++++++ .../2.9.0/cordova/file/fileerror/fileerror.md | 49 ++ docs/jp/2.9.0/cordova/file/fileobj/fileobj.md | 78 ++++ .../cordova/file/filereader/filereader.md | 256 +++++++++++ .../cordova/file/filesystem/filesystem.md | 92 ++++ .../cordova/file/filetransfer/filetransfer.md | 295 ++++++++++++ .../filetransfererror/filetransfererror.md | 44 ++ .../fileuploadoptions/fileuploadoptions.md | 44 ++ .../file/fileuploadresult/fileuploadresult.md | 39 ++ .../cordova/file/filewriter/filewriter.md | 227 ++++++++++ docs/jp/2.9.0/cordova/file/flags/flags.md | 47 ++ .../file/localfilesystem/localfilesystem.md | 111 +++++ .../2.9.0/cordova/file/metadata/metadata.md | 52 +++ .../geolocation/Coordinates/coordinates.md | 125 ++++++ .../cordova/geolocation/Position/position.md | 118 +++++ .../PositionError/positionError.md | 53 +++ .../geolocation/geolocation.clearWatch.md | 117 +++++ .../geolocation.getCurrentPosition.md | 126 ++++++ .../2.9.0/cordova/geolocation/geolocation.md | 98 ++++ .../geolocation/geolocation.watchPosition.md | 128 ++++++ .../parameters/geolocation.options.md | 40 ++ .../parameters/geolocationError.md | 32 ++ .../parameters/geolocationSuccess.md | 46 ++ .../GlobalizationError/globalizationerror.md | 93 ++++ .../globalization.dateToString.md | 94 ++++ .../globalization.getCurrencyPattern.md | 108 +++++ .../globalization.getDateNames.md | 95 ++++ .../globalization.getDatePattern.md | 99 ++++ .../globalization.getFirstDayOfWeek.md | 76 ++++ .../globalization.getLocaleName.md | 77 ++++ .../globalization.getNumberPattern.md | 119 +++++ .../globalization.getPreferredLanguage.md | 79 ++++ .../globalization.isDayLightSavingsTime.md | 79 ++++ .../cordova/globalization/globalization.md | 61 +++ .../globalization.numberToString.md | 85 ++++ .../globalization.stringToDate.md | 107 +++++ .../globalization.stringToNumber.md | 87 ++++ .../cordova/inappbrowser/inappbrowser.md | 425 ++++++++++++++++++ .../2.9.0/cordova/inappbrowser/window.open.md | 99 ++++ .../cordova/media/MediaError/mediaError.md | 44 ++ .../cordova/media/Parameters/mediaError.md | 32 ++ .../2.9.0/cordova/media/capture/CaptureCB.md | 44 ++ .../cordova/media/capture/CaptureError.md | 37 ++ .../cordova/media/capture/CaptureErrorCB.md | 40 ++ .../media/capture/ConfigurationData.md | 62 +++ .../media/capture/MediaFile.getFormatData.md | 54 +++ .../2.9.0/cordova/media/capture/MediaFile.md | 37 ++ .../cordova/media/capture/MediaFileData.md | 65 +++ .../jp/2.9.0/cordova/media/capture/capture.md | 121 +++++ .../cordova/media/capture/captureAudio.md | 141 ++++++ .../media/capture/captureAudioOptions.md | 52 +++ .../cordova/media/capture/captureImage.md | 131 ++++++ .../media/capture/captureImageOptions.md | 41 ++ .../cordova/media/capture/captureVideo.md | 131 ++++++ .../media/capture/captureVideoOptions.md | 47 ++ .../cordova/media/media.getCurrentPosition.md | 175 ++++++++ .../2.9.0/cordova/media/media.getDuration.md | 167 +++++++ docs/jp/2.9.0/cordova/media/media.md | 131 ++++++ docs/jp/2.9.0/cordova/media/media.pause.md | 168 +++++++ docs/jp/2.9.0/cordova/media/media.play.md | 191 ++++++++ docs/jp/2.9.0/cordova/media/media.release.md | 156 +++++++ docs/jp/2.9.0/cordova/media/media.seekTo.md | 159 +++++++ .../jp/2.9.0/cordova/media/media.setVolume.md | 178 ++++++++ .../2.9.0/cordova/media/media.startRecord.md | 156 +++++++ docs/jp/2.9.0/cordova/media/media.stop.md | 171 +++++++ .../2.9.0/cordova/media/media.stopRecord.md | 143 ++++++ .../notification/notification.alert.md | 114 +++++ .../cordova/notification/notification.beep.md | 119 +++++ .../notification/notification.confirm.md | 125 ++++++ .../cordova/notification/notification.md | 69 +++ .../notification/notification.prompt.md | 121 +++++ .../notification/notification.vibrate.md | 102 +++++ .../cordova/splashscreen/splashscreen.hide.md | 78 ++++ .../cordova/splashscreen/splashscreen.md | 79 ++++ .../cordova/splashscreen/splashscreen.show.md | 69 +++ .../cordova/storage/database/database.md | 120 +++++ .../storage/localstorage/localstorage.md | 118 +++++ .../storage/parameters/display_name.md | 23 + .../2.9.0/cordova/storage/parameters/name.md | 23 + .../2.9.0/cordova/storage/parameters/size.md | 23 + .../cordova/storage/parameters/version.md | 23 + .../cordova/storage/sqlerror/sqlerror.md | 47 ++ .../storage/sqlresultset/sqlresultset.md | 137 ++++++ .../sqlresultsetrowlist.md | 136 ++++++ .../storage/sqltransaction/sqltransaction.md | 113 +++++ docs/jp/2.9.0/cordova/storage/storage.md | 73 +++ .../cordova/storage/storage.opendatabase.md | 72 +++ docs/jp/2.9.0/guide/command-line/index.md | 190 ++++++++ .../jp/2.9.0/guide/cordova-webview/android.md | 66 +++ docs/jp/2.9.0/guide/cordova-webview/index.md | 27 ++ docs/jp/2.9.0/guide/cordova-webview/ios.md | 131 ++++++ .../guide/getting-started/android/index.md | 123 +++++ .../2.9.0/guide/getting-started/bada/index.md | 93 ++++ .../guide/getting-started/blackberry/index.md | 101 +++++ docs/jp/2.9.0/guide/getting-started/index.md | 31 ++ .../2.9.0/guide/getting-started/ios/index.md | 123 +++++ .../guide/getting-started/symbian/index.md | 78 ++++ .../guide/getting-started/tizen/index.md | 108 +++++ .../guide/getting-started/webos/index.md | 78 ++++ .../guide/getting-started/windows-8/index.md | 104 +++++ .../getting-started/windows-phone/index.md | 116 +++++ .../guide/plugin-development/android/index.md | 188 ++++++++ .../guide/plugin-development/bada/index.md | 74 +++ .../plugin-development/blackberry/index.md | 136 ++++++ .../2.9.0/guide/plugin-development/index.md | 112 +++++ .../guide/plugin-development/ios/index.md | 173 +++++++ .../guide/plugin-development/tizen/index.md | 23 + .../guide/plugin-development/webos/index.md | 23 + .../plugin-development/windows-phone/index.md | 192 ++++++++ docs/jp/2.9.0/guide/project-settings/index.md | 23 + .../2.9.0/guide/project-settings/ios/index.md | 53 +++ .../jp/2.9.0/guide/upgrading/android/index.md | 182 ++++++++ docs/jp/2.9.0/guide/upgrading/bada/index.md | 48 ++ .../2.9.0/guide/upgrading/blackberry/index.md | 117 +++++ docs/jp/2.9.0/guide/upgrading/index.md | 32 ++ docs/jp/2.9.0/guide/upgrading/ios/index.md | 310 +++++++++++++ .../jp/2.9.0/guide/upgrading/symbian/index.md | 21 + docs/jp/2.9.0/guide/upgrading/tizen/index.md | 23 + docs/jp/2.9.0/guide/upgrading/webos/index.md | 38 ++ .../guide/upgrading/windows-phone/index.md | 147 ++++++ docs/jp/2.9.0/guide/whitelist/index.md | 191 ++++++++ docs/jp/2.9.0/index.md | 119 +++++ 192 files changed, 18987 insertions(+) create mode 100755 docs/jp/2.9.0/config.json create mode 100755 docs/jp/2.9.0/cordova/accelerometer/acceleration/acceleration.md create mode 100755 docs/jp/2.9.0/cordova/accelerometer/accelerometer.clearWatch.md create mode 100755 docs/jp/2.9.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md create mode 100755 docs/jp/2.9.0/cordova/accelerometer/accelerometer.md create mode 100755 docs/jp/2.9.0/cordova/accelerometer/accelerometer.watchAcceleration.md create mode 100644 docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerError.md create mode 100644 docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerOptions.md create mode 100644 docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerSuccess.md create mode 100755 docs/jp/2.9.0/cordova/camera/camera.cleanup.md create mode 100755 docs/jp/2.9.0/cordova/camera/camera.getPicture.md create mode 100755 docs/jp/2.9.0/cordova/camera/camera.md create mode 100755 docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverHandle.md create mode 100755 docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverOptions.md create mode 100755 docs/jp/2.9.0/cordova/camera/parameter/cameraError.md create mode 100755 docs/jp/2.9.0/cordova/camera/parameter/cameraOptions.md create mode 100755 docs/jp/2.9.0/cordova/camera/parameter/cameraSuccess.md create mode 100755 docs/jp/2.9.0/cordova/compass/compass.clearWatch.md create mode 100644 docs/jp/2.9.0/cordova/compass/compass.clearWatchFilter.md create mode 100755 docs/jp/2.9.0/cordova/compass/compass.getCurrentHeading.md create mode 100755 docs/jp/2.9.0/cordova/compass/compass.md create mode 100755 docs/jp/2.9.0/cordova/compass/compass.watchHeading.md create mode 100644 docs/jp/2.9.0/cordova/compass/compass.watchHeadingFilter.md create mode 100755 docs/jp/2.9.0/cordova/compass/compassError/compassError.md create mode 100755 docs/jp/2.9.0/cordova/compass/parameters/compassError.md create mode 100755 docs/jp/2.9.0/cordova/compass/parameters/compassHeading.md create mode 100755 docs/jp/2.9.0/cordova/compass/parameters/compassOptions.md create mode 100755 docs/jp/2.9.0/cordova/compass/parameters/compassSuccess.md create mode 100755 docs/jp/2.9.0/cordova/connection/connection.md create mode 100755 docs/jp/2.9.0/cordova/connection/connection.type.md create mode 100755 docs/jp/2.9.0/cordova/contacts/Contact/contact.md create mode 100755 docs/jp/2.9.0/cordova/contacts/ContactAddress/contactaddress.md create mode 100755 docs/jp/2.9.0/cordova/contacts/ContactError/contactError.md create mode 100755 docs/jp/2.9.0/cordova/contacts/ContactField/contactfield.md create mode 100755 docs/jp/2.9.0/cordova/contacts/ContactFindOptions/contactfindoptions.md create mode 100755 docs/jp/2.9.0/cordova/contacts/ContactName/contactname.md create mode 100755 docs/jp/2.9.0/cordova/contacts/ContactOrganization/contactorganization.md create mode 100755 docs/jp/2.9.0/cordova/contacts/contacts.create.md create mode 100755 docs/jp/2.9.0/cordova/contacts/contacts.find.md create mode 100755 docs/jp/2.9.0/cordova/contacts/contacts.md create mode 100644 docs/jp/2.9.0/cordova/contacts/parameters/contactError.md create mode 100644 docs/jp/2.9.0/cordova/contacts/parameters/contactFields.md create mode 100755 docs/jp/2.9.0/cordova/contacts/parameters/contactFindOptions.md create mode 100755 docs/jp/2.9.0/cordova/contacts/parameters/contactSuccess.md create mode 100755 docs/jp/2.9.0/cordova/device/device.cordova.md create mode 100755 docs/jp/2.9.0/cordova/device/device.md create mode 100755 docs/jp/2.9.0/cordova/device/device.model.md create mode 100755 docs/jp/2.9.0/cordova/device/device.name.md create mode 100755 docs/jp/2.9.0/cordova/device/device.platform.md create mode 100755 docs/jp/2.9.0/cordova/device/device.uuid.md create mode 100755 docs/jp/2.9.0/cordova/device/device.version.md create mode 100755 docs/jp/2.9.0/cordova/events/events.backbutton.md create mode 100755 docs/jp/2.9.0/cordova/events/events.batterycritical.md create mode 100755 docs/jp/2.9.0/cordova/events/events.batterylow.md create mode 100755 docs/jp/2.9.0/cordova/events/events.batterystatus.md create mode 100755 docs/jp/2.9.0/cordova/events/events.deviceready.md create mode 100755 docs/jp/2.9.0/cordova/events/events.endcallbutton.md create mode 100755 docs/jp/2.9.0/cordova/events/events.md create mode 100755 docs/jp/2.9.0/cordova/events/events.menubutton.md create mode 100755 docs/jp/2.9.0/cordova/events/events.offline.md create mode 100755 docs/jp/2.9.0/cordova/events/events.online.md create mode 100755 docs/jp/2.9.0/cordova/events/events.pause.md create mode 100755 docs/jp/2.9.0/cordova/events/events.resume.md create mode 100755 docs/jp/2.9.0/cordova/events/events.searchbutton.md create mode 100755 docs/jp/2.9.0/cordova/events/events.startcallbutton.md create mode 100755 docs/jp/2.9.0/cordova/events/events.volumedownbutton.md create mode 100755 docs/jp/2.9.0/cordova/events/events.volumeupbutton.md create mode 100755 docs/jp/2.9.0/cordova/file/directoryentry/directoryentry.md create mode 100755 docs/jp/2.9.0/cordova/file/directoryreader/directoryreader.md create mode 100755 docs/jp/2.9.0/cordova/file/file.md create mode 100755 docs/jp/2.9.0/cordova/file/fileentry/fileentry.md create mode 100755 docs/jp/2.9.0/cordova/file/fileerror/fileerror.md create mode 100755 docs/jp/2.9.0/cordova/file/fileobj/fileobj.md create mode 100755 docs/jp/2.9.0/cordova/file/filereader/filereader.md create mode 100755 docs/jp/2.9.0/cordova/file/filesystem/filesystem.md create mode 100755 docs/jp/2.9.0/cordova/file/filetransfer/filetransfer.md create mode 100755 docs/jp/2.9.0/cordova/file/filetransfererror/filetransfererror.md create mode 100755 docs/jp/2.9.0/cordova/file/fileuploadoptions/fileuploadoptions.md create mode 100755 docs/jp/2.9.0/cordova/file/fileuploadresult/fileuploadresult.md create mode 100755 docs/jp/2.9.0/cordova/file/filewriter/filewriter.md create mode 100755 docs/jp/2.9.0/cordova/file/flags/flags.md create mode 100755 docs/jp/2.9.0/cordova/file/localfilesystem/localfilesystem.md create mode 100755 docs/jp/2.9.0/cordova/file/metadata/metadata.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/Coordinates/coordinates.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/Position/position.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/PositionError/positionError.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/geolocation.clearWatch.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/geolocation.getCurrentPosition.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/geolocation.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/geolocation.watchPosition.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/parameters/geolocation.options.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/parameters/geolocationError.md create mode 100755 docs/jp/2.9.0/cordova/geolocation/parameters/geolocationSuccess.md create mode 100755 docs/jp/2.9.0/cordova/globalization/GlobalizationError/globalizationerror.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.dateToString.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.getCurrencyPattern.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.getDateNames.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.getDatePattern.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.getFirstDayOfWeek.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.getLocaleName.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.getNumberPattern.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.getPreferredLanguage.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.isDayLightSavingsTime.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.numberToString.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.stringToDate.md create mode 100755 docs/jp/2.9.0/cordova/globalization/globalization.stringToNumber.md create mode 100755 docs/jp/2.9.0/cordova/inappbrowser/inappbrowser.md create mode 100755 docs/jp/2.9.0/cordova/inappbrowser/window.open.md create mode 100755 docs/jp/2.9.0/cordova/media/MediaError/mediaError.md create mode 100755 docs/jp/2.9.0/cordova/media/Parameters/mediaError.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/CaptureCB.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/CaptureError.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/CaptureErrorCB.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/ConfigurationData.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/MediaFile.getFormatData.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/MediaFile.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/MediaFileData.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/capture.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/captureAudio.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/captureAudioOptions.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/captureImage.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/captureImageOptions.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/captureVideo.md create mode 100755 docs/jp/2.9.0/cordova/media/capture/captureVideoOptions.md create mode 100755 docs/jp/2.9.0/cordova/media/media.getCurrentPosition.md create mode 100755 docs/jp/2.9.0/cordova/media/media.getDuration.md create mode 100755 docs/jp/2.9.0/cordova/media/media.md create mode 100755 docs/jp/2.9.0/cordova/media/media.pause.md create mode 100755 docs/jp/2.9.0/cordova/media/media.play.md create mode 100755 docs/jp/2.9.0/cordova/media/media.release.md create mode 100755 docs/jp/2.9.0/cordova/media/media.seekTo.md create mode 100755 docs/jp/2.9.0/cordova/media/media.setVolume.md create mode 100755 docs/jp/2.9.0/cordova/media/media.startRecord.md create mode 100755 docs/jp/2.9.0/cordova/media/media.stop.md create mode 100755 docs/jp/2.9.0/cordova/media/media.stopRecord.md create mode 100755 docs/jp/2.9.0/cordova/notification/notification.alert.md create mode 100755 docs/jp/2.9.0/cordova/notification/notification.beep.md create mode 100755 docs/jp/2.9.0/cordova/notification/notification.confirm.md create mode 100755 docs/jp/2.9.0/cordova/notification/notification.md create mode 100755 docs/jp/2.9.0/cordova/notification/notification.prompt.md create mode 100755 docs/jp/2.9.0/cordova/notification/notification.vibrate.md create mode 100755 docs/jp/2.9.0/cordova/splashscreen/splashscreen.hide.md create mode 100755 docs/jp/2.9.0/cordova/splashscreen/splashscreen.md create mode 100755 docs/jp/2.9.0/cordova/splashscreen/splashscreen.show.md create mode 100755 docs/jp/2.9.0/cordova/storage/database/database.md create mode 100755 docs/jp/2.9.0/cordova/storage/localstorage/localstorage.md create mode 100644 docs/jp/2.9.0/cordova/storage/parameters/display_name.md create mode 100644 docs/jp/2.9.0/cordova/storage/parameters/name.md create mode 100644 docs/jp/2.9.0/cordova/storage/parameters/size.md create mode 100644 docs/jp/2.9.0/cordova/storage/parameters/version.md create mode 100755 docs/jp/2.9.0/cordova/storage/sqlerror/sqlerror.md create mode 100755 docs/jp/2.9.0/cordova/storage/sqlresultset/sqlresultset.md create mode 100755 docs/jp/2.9.0/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md create mode 100755 docs/jp/2.9.0/cordova/storage/sqltransaction/sqltransaction.md create mode 100755 docs/jp/2.9.0/cordova/storage/storage.md create mode 100755 docs/jp/2.9.0/cordova/storage/storage.opendatabase.md create mode 100644 docs/jp/2.9.0/guide/command-line/index.md create mode 100644 docs/jp/2.9.0/guide/cordova-webview/android.md create mode 100644 docs/jp/2.9.0/guide/cordova-webview/index.md create mode 100644 docs/jp/2.9.0/guide/cordova-webview/ios.md create mode 100644 docs/jp/2.9.0/guide/getting-started/android/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/bada/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/blackberry/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/ios/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/symbian/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/tizen/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/webos/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/windows-8/index.md create mode 100644 docs/jp/2.9.0/guide/getting-started/windows-phone/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/android/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/bada/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/blackberry/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/ios/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/tizen/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/webos/index.md create mode 100644 docs/jp/2.9.0/guide/plugin-development/windows-phone/index.md create mode 100644 docs/jp/2.9.0/guide/project-settings/index.md create mode 100644 docs/jp/2.9.0/guide/project-settings/ios/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/android/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/bada/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/blackberry/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/ios/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/symbian/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/tizen/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/webos/index.md create mode 100644 docs/jp/2.9.0/guide/upgrading/windows-phone/index.md create mode 100644 docs/jp/2.9.0/guide/whitelist/index.md create mode 100644 docs/jp/2.9.0/index.md diff --git a/docs/jp/2.9.0/config.json b/docs/jp/2.9.0/config.json new file mode 100755 index 0000000000..207e88dbeb --- /dev/null +++ b/docs/jp/2.9.0/config.json @@ -0,0 +1,199 @@ +{ + "language": "Japanese", + "merge": { + "accelerometer.md": [ + "cordova/accelerometer/accelerometer.md", + "cordova/accelerometer/accelerometer.getCurrentAcceleration.md", + "cordova/accelerometer/accelerometer.watchAcceleration.md", + "cordova/accelerometer/accelerometer.clearWatch.md", + "cordova/accelerometer/acceleration/acceleration.md", + "cordova/accelerometer/parameters/accelerometerSuccess.md", + "cordova/accelerometer/parameters/accelerometerError.md", + "cordova/accelerometer/parameters/accelerometerOptions.md" + ], + "camera.md": [ + "cordova/camera/camera.md", + "cordova/camera/camera.getPicture.md", + "cordova/camera/parameter/cameraSuccess.md", + "cordova/camera/parameter/cameraError.md", + "cordova/camera/parameter/cameraOptions.md", + "cordova/camera/parameter/CameraPopoverOptions.md", + "cordova/camera/parameter/CameraPopoverHandle.md" + ], + "capture.md": [ + "cordova/media/capture/capture.md", + "cordova/media/capture/captureAudio.md", + "cordova/media/capture/captureAudioOptions.md", + "cordova/media/capture/captureImage.md", + "cordova/media/capture/captureImageOptions.md", + "cordova/media/capture/captureVideo.md", + "cordova/media/capture/captureVideoOptions.md", + "cordova/media/capture/CaptureError.md", + "cordova/media/capture/CaptureCB.md", + "cordova/media/capture/CaptureErrorCB.md", + "cordova/media/capture/ConfigurationData.md", + "cordova/media/capture/MediaFile.md", + "cordova/media/capture/MediaFile.getFormatData.md", + "cordova/media/capture/MediaFileData.md" + ], + "compass.md": [ + "cordova/compass/compass.md", + "cordova/compass/compass.getCurrentHeading.md", + "cordova/compass/compass.watchHeading.md", + "cordova/compass/compass.clearWatch.md", + "cordova/compass/compass.watchHeadingFilter.md", + "cordova/compass/compass.clearWatchFilter.md", + "cordova/compass/parameters/compassSuccess.md", + "cordova/compass/parameters/compassError.md", + "cordova/compass/parameters/compassOptions.md", + "cordova/compass/parameters/compassHeading.md", + "cordova/compass/compassError/compassError.md" + ], + "contacts.md": [ + "cordova/contacts/contacts.md", + "cordova/contacts/contacts.create.md", + "cordova/contacts/contacts.find.md", + "cordova/contacts/Contact/contact.md", + "cordova/contacts/ContactAddress/contactaddress.md", + "cordova/contacts/ContactField/contactfield.md", + "cordova/contacts/ContactFindOptions/contactfindoptions.md", + "cordova/contacts/ContactName/contactname.md", + "cordova/contacts/ContactOrganization/contactorganization.md", + "cordova/contacts/ContactError/contactError.md", + "cordova/contacts/parameters/contactSuccess.md", + "cordova/contacts/parameters/contactError.md", + "cordova/contacts/parameters/contactFields.md", + "cordova/contacts/parameters/contactFindOptions.md" + ], + "device.md": [ + "cordova/device/device.md", + "cordova/device/device.name.md", + "cordova/device/device.cordova.md", + "cordova/device/device.platform.md", + "cordova/device/device.uuid.md", + "cordova/device/device.version.md" + ], + "events.md": [ + "cordova/events/events.md", + "cordova/events/events.deviceready.md", + "cordova/events/events.pause.md", + "cordova/events/events.resume.md", + "cordova/events/events.online.md", + "cordova/events/events.offline.md", + "cordova/events/events.backbutton.md", + "cordova/events/events.batterycritical.md", + "cordova/events/events.batterylow.md", + "cordova/events/events.batterystatus.md", + "cordova/events/events.menubutton.md", + "cordova/events/events.searchbutton.md", + "cordova/events/events.startcallbutton.md", + "cordova/events/events.endcallbutton.md", + "cordova/events/events.volumedownbutton.md", + "cordova/events/events.volumeupbutton.md" + ], + "file.md": [ + "cordova/file/file.md", + "cordova/file/fileobj/fileobj.md", + "cordova/file/filereader/filereader.md", + "cordova/file/filewriter/filewriter.md", + "cordova/file/filesystem/filesystem.md", + "cordova/file/fileentry/fileentry.md", + "cordova/file/directoryentry/directoryentry.md", + "cordova/file/directoryreader/directoryreader.md", + "cordova/file/filetransfer/filetransfer.md", + "cordova/file/fileuploadoptions/fileuploadoptions.md", + "cordova/file/fileuploadresult/fileuploadresult.md", + "cordova/file/flags/flags.md", + "cordova/file/localfilesystem/localfilesystem.md", + "cordova/file/metadata/metadata.md", + "cordova/file/fileerror/fileerror.md", + "cordova/file/filetransfererror/filetransfererror.md" + ], + "geolocation.md": [ + "cordova/geolocation/geolocation.md", + "cordova/geolocation/geolocation.getCurrentPosition.md", + "cordova/geolocation/geolocation.watchPosition.md", + "cordova/geolocation/geolocation.clearWatch.md", + "cordova/geolocation/Coordinates/coordinates.md", + "cordova/geolocation/Position/position.md", + "cordova/geolocation/PositionError/positionError.md", + "cordova/geolocation/parameters/geolocationSuccess.md", + "cordova/geolocation/parameters/geolocationError.md", + "cordova/geolocation/parameters/geolocation.options.md" + ], + "globalization.md": [ + "cordova/globalization/globalization.md", + "cordova/globalization/globalization.getPreferredLanguage.md", + "cordova/globalization/globalization.getLocaleName.md", + "cordova/globalization/globalization.dateToString.md", + "cordova/globalization/globalization.stringToDate.md", + "cordova/globalization/globalization.getDatePattern.md", + "cordova/globalization/globalization.getDateNames.md", + "cordova/globalization/globalization.isDayLightSavingsTime.md", + "cordova/globalization/globalization.getFirstDayOfWeek.md", + "cordova/globalization/globalization.numberToString.md", + "cordova/globalization/globalization.stringToNumber.md", + "cordova/globalization/globalization.getNumberPattern.md", + "cordova/globalization/globalization.getCurrencyPattern.md", + "cordova/globalization/GlobalizationError/globalizationerror.md" + ], + "media.md": [ + "cordova/media/media.md", + "cordova/media/media.getCurrentPosition.md", + "cordova/media/media.getDuration.md", + "cordova/media/media.pause.md", + "cordova/media/media.play.md", + "cordova/media/media.release.md", + "cordova/media/media.seekTo.md", + "cordova/media/media.setVolume.md", + "cordova/media/media.startRecord.md", + "cordova/media/media.stop.md", + "cordova/media/media.stopRecord.md", + "cordova/media/MediaError/mediaError.md", + "cordova/media/Parameters/mediaError.md" + ], + "network.md": [ + "cordova/network/network.md", + "cordova/network/network.isReachable.md", + "cordova/network/NetworkStatus/NetworkStatus.md", + "cordova/network/parameters/reachableCallback.md", + "cordova/network/parameters/reachableHostname.md", + "cordova/network/parameters/reachableOptions.md" + ], + "connection.md": [ + "cordova/connection/connection.md", + "cordova/connection/connection.type.md" + ], + "notification.md": [ + "cordova/notification/notification.md", + "cordova/notification/notification.alert.md", + "cordova/notification/notification.confirm.md", + "cordova/notification/notification.prompt.md", + "cordova/notification/notification.beep.md", + "cordova/notification/notification.vibrate.md" + ], + "splashscreen.md": [ + "cordova/splashscreen/splashscreen.md", + "cordova/splashscreen/splashscreen.show.md", + "cordova/splashscreen/splashscreen.hide.md" + ], + "storage.md": [ + "cordova/storage/storage.md", + "cordova/storage/storage.opendatabase.md", + "cordova/storage/parameters/name.md", + "cordova/storage/parameters/version.md", + "cordova/storage/parameters/display_name.md", + "cordova/storage/parameters/size.md", + "cordova/storage/database/database.md", + "cordova/storage/sqltransaction/sqltransaction.md", + "cordova/storage/sqlresultset/sqlresultset.md", + "cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md", + "cordova/storage/sqlerror/sqlerror.md", + "cordova/storage/localstorage/localstorage.md" + ], + "inappbrowser.md": [ + "cordova/inappbrowser/inappbrowser.md", + "cordova/inappbrowser/window.open.md" + ] + } +} diff --git a/docs/jp/2.9.0/cordova/accelerometer/acceleration/acceleration.md b/docs/jp/2.9.0/cordova/accelerometer/acceleration/acceleration.md new file mode 100755 index 0000000000..da42cbb199 --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/acceleration/acceleration.md @@ -0,0 +1,106 @@ +--- +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. +--- + +Acceleration +============ + +ある時間軸上でキャプチャーされた加速度センサーのデータを保持します。 + +プロパティー +---------- + +- __x__: x 軸上での加速度を表します。 (単位 m/s^2) _(Number)_ +- __y__: y 軸上での加速度を表します。 (単位 m/s^2) _(Number)_ +- __z__: z 軸上での加速度を表します。 (単位 m/s^2) _(Number)_ +- __timestamp:__ ミリ秒単位のタイムスタンプ値を表します。 _(DOMTimeStamp)_ + +概要 +----------- + +_x_, _y_, _z_ の加速度は重力の影響 (9.81 m/s^2) を含みます。デバイスが机の上に表向きで置かれている場合、値はそれぞれ _x_=0, _y_=0, _z_=9.81 となります。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function onSuccess(acceleration) { + alert('X 軸における加速度: ' + acceleration.x + '\n' + + 'Y 軸における加速度: ' + acceleration.y + '\n' + + 'Z 軸における加速度: ' + acceleration.z + '\n' + + 'タイムスタンプ: ' + acceleration.timestamp + '\n'); + }; + + function onError() { + alert('エラーが発生しました。'); + }; + + navigator.accelerometer.getCurrentAcceleration(onSuccess, onError); + +詳細な使用例 +------------ + + + + + 加速度センサーの使用例 + + + + + +

使用例

+

getCurrentAcceleration

+ + diff --git a/docs/jp/2.9.0/cordova/accelerometer/accelerometer.clearWatch.md b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.clearWatch.md new file mode 100755 index 0000000000..d86282d3ad --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.clearWatch.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. +--- + +accelerometer.clearWatch +======================== + +指定した watch ID の加速度情報の監視を停止します。 + + navigator.accelerometer.clearWatch(watchID); + +- __watchID__: `accelerometer.watchAcceleration` によって返される ID。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); + + // ... 後に続く ... + + navigator.accelerometer.clearWatch(watchID); + +詳細な使用例 +------------ + + + + + 加速度センサーの使用例 + + + + + +
加速度センサーを待機...
+ + + diff --git a/docs/jp/2.9.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md new file mode 100755 index 0000000000..7e999c84c6 --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md @@ -0,0 +1,109 @@ +--- +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. +--- + +accelerometer.getCurrentAcceleration +==================================== + +デバイスの傾きの増加量を計測します。 + + navigator.accelerometer.getCurrentAcceleration(accelerometerSuccess, accelerometerError); + +概要 +----------- + +加速度センサーはデバイスの傾きの増加量を計測します。 加速度センサーでは x, y, z 軸の3次元の傾きを取得出来ます。 + +加速度情報は `accelerometerSuccess` コールバック関数によって返されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function onSuccess(acceleration) { + alert('X 軸における加速度: ' + acceleration.x + '\n' + + 'Y 軸における加速度: ' + acceleration.y + '\n' + + 'Z 軸における加速度: ' + acceleration.z + '\n' + + 'タイムスタンプ: ' + acceleration.timestamp + '\n'); + }; + + function onError() { + alert('エラーが発生しました。'); + }; + + navigator.accelerometer.getCurrentAcceleration(onSuccess, onError); + +詳細な使用例 +------------ + + + + + 加速度センサーの使用 + + + + + +

使用例

+

getCurrentAcceleration

+ + + +iOS に関する注意点 +------------- + +- iOSはピンポイントで現在の加速度情報を得ることは出来ません。 +- 加速度情報を取得するには、一定の時間間隔で加速度データの変異を計測する必要があります。 +- そのため、 `getCurrentAcceleration` 関数は Cordova の `watchAccelerometer` 関数で取得した最新値を返します。 diff --git a/docs/jp/2.9.0/cordova/accelerometer/accelerometer.md b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.md new file mode 100755 index 0000000000..dc8cbd36ed --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.md @@ -0,0 +1,82 @@ +--- +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. +--- + +Accelerometer +============= + +> デバイスの動きを (_x_, _y_, _z_) 軸で取得します。 + +メソッド +------- + +- accelerometer.getCurrentAcceleration +- accelerometer.watchAcceleration +- accelerometer.clearWatch + +引数 +--------- + +- accelerometerSuccess +- accelerometerError +- accelerometerOptions + +オブジェクト (読み取り専用) +------------------- + +- Acceleration + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + +### iOS + +#### config.xml + + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + + パーミッションの設定は必要ありません。 diff --git a/docs/jp/2.9.0/cordova/accelerometer/accelerometer.watchAcceleration.md b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.watchAcceleration.md new file mode 100755 index 0000000000..a00357c4a4 --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/accelerometer.watchAcceleration.md @@ -0,0 +1,137 @@ +--- +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. +--- + +accelerometer.watchAcceleration +=============================== + +ある時間間隔における x, y, z 軸上の加速度を返します。 + + var watchID = navigator.accelerometer.watchAcceleration(accelerometerSuccess, + accelerometerError, + [accelerometerOptions]); + +概要 +----------- + +加速度センサーはデバイスの傾きの増加量を計測します。加速度センサーでは x, y, z 軸の3次元の傾きを取得出来ます。 + +`accelerometer.watchAcceleration` 関数を使うと、一定の間隔ごとにデバイスの加速度情報を取得できます。加速度情報を取得するたびに、 `accelerometerSuccess` コールバック関数が実行されます。加速度情報を取得する間隔は、 `acceleratorOptions` オブジェクトのパラメーター `frequency` を通じてミリ秒単位で指定できます。 + +本関数の戻り値である watch ID は、実行中の加速度センサー測定への参照を表します。また、 `accelerometer.clearWatch` 関数に watch ID を渡すことで、加速度センサーの監視を停止できます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function onSuccess(acceleration) { + alert('X 軸における加速度: ' + acceleration.x + '\n' + + 'Y 軸における加速度: ' + acceleration.y + '\n' + + 'Z 軸における加速度: ' + acceleration.z + '\n' + + 'タイムスタンプ: ' + acceleration.timestamp + '\n'); + }; + + function onError() { + alert('エラーが発生しました。'); + }; + + var options = { frequency: 3000 }; // 3秒ごとに更新 + + var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); + +詳細な使用例 +------------ + + + + + 加速度センサーの使用例 + + + + + +
加速度センサーを待機...
+ + + + iOS に関する注意点 +------------- + +- 指定された時間間隔に対して、 Cordova はコールバック関数を呼び出し、加速度情報を渡します。 +- ただし、時間間隔は Cordova によって最低 40ms 、最高 1000ms に制限されています。 +- たとえば時間間隔として 3秒 (3000ms) を指定した場合、 Cordova は加速度情報を1秒で取得しますが、コールバック関数は3秒ごとに呼び出されます。 diff --git a/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerError.md b/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerError.md new file mode 100644 index 0000000000..737cac5a4e --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerError.md @@ -0,0 +1,27 @@ +--- +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. +--- + +accelerometerError +================== + +加速度情報の取得に失敗したときに呼び出されるコールバック関数です。 + + function() { + // エラー処理 + } diff --git a/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerOptions.md b/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerOptions.md new file mode 100644 index 0000000000..f88c89f440 --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerOptions.md @@ -0,0 +1,28 @@ +--- +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. +--- + +accelerometerOptions +==================== + +加速度センサーを取得する際のパラメーターを表します。 + +オプション +------- + +- __frequency:__ 加速度情報の取得頻度をミリ秒単位で表します。 _(Number)_ (デフォルト: 10000) diff --git a/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerSuccess.md b/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerSuccess.md new file mode 100644 index 0000000000..1488b13312 --- /dev/null +++ b/docs/jp/2.9.0/cordova/accelerometer/parameters/accelerometerSuccess.md @@ -0,0 +1,42 @@ +--- +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. +--- + +accelerometerSuccess +==================== + +加速度情報を返す onSuccess コールバック関数です。 + + function(acceleration) { + // 任意のコード + } + +パラメーター +---------- + +- __acceleration:__ ある瞬間における加速度を表します。 (Acceleration) + +使用例 +------- + + function onSuccess(acceleration) { + alert('X 軸における加速度: ' + acceleration.x + '\n' + + 'Y 軸における加速度: ' + acceleration.y + '\n' + + 'Z 軸における加速度: ' + acceleration.z + '\n' + + 'タイムスタンプ: ' + acceleration.timestamp + '\n'); + }; diff --git a/docs/jp/2.9.0/cordova/camera/camera.cleanup.md b/docs/jp/2.9.0/cordova/camera/camera.cleanup.md new file mode 100755 index 0000000000..bdda3d267e --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/camera.cleanup.md @@ -0,0 +1,50 @@ +--- +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. +--- + +camera.cleanup +================= + +カメラで撮影され、ローカルストレージ temporary ディレクトリに保存された画像ファイルを削除します。 + + navigator.camera.cleanup( cameraSuccess, cameraError ); + +概要 +----------- + +`camera.getPicture` が `Camera.sourceType = Camera.PictureSourceType.CAMERA` と `Camera.destinationType = Camera.DestinationType.FILE_URI` と一緒に使用されたとき、ローカルストレージ temporary ディレクトリに保存された画像ファイルを削除します。 + + +サポートされているプラットフォーム +------------------- + +- iOS + + +使用例 +------------- + + navigator.camera.cleanup(onSuccess, onFail); + + function onSuccess() { + console.log("クリーンアップに成功しました。") + } + + function onFail(message) { + alert('クリーンアップに失敗: ' + message); + } diff --git a/docs/jp/2.9.0/cordova/camera/camera.getPicture.md b/docs/jp/2.9.0/cordova/camera/camera.getPicture.md new file mode 100755 index 0000000000..ae15a9c4be --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/camera.getPicture.md @@ -0,0 +1,221 @@ +--- +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. +--- + +camera.getPicture +================= + +デバイスのカメラで写真を撮る、またはデバイスのギャラリー内にある写真を検索します。 Base64 形式でエンコードされたフォトイメージを表す文字列、またはイメージファイルの URI が返されます。このメソッド自体は `CameraPopoverHandle` オブジェクトを返します。このオブジェクトを介して、ファイル選択popoverの位置を変更できます。 + + navigator.camera.getPicture( cameraSuccess, cameraError, [ cameraOptions ] ); + +概要 +----------- + +`camera.getPicture` 関数はユーザーが写真を撮れるように、デバイスが標準で備えるカメラアプリを起動します。この処理はデフォルト、もしくは`Camera.sourceType = Camera.PictureSourceType.CAMERA` の場合に行われます。写真の撮影が完了するとカメラアプリは終了し、アプリケーションに戻ります。 + +もし `Camera.sourceType = Camera.PictureSourceType.PHOTOLIBRARY` もしくは `Camera.PictureSourceType.SAVEDPHOTOALBUM` が指定された場合、写真選択ダイアログが表示され、既存の写真を選択できるようになります。`camera.getPicture`関数は`CameraPopoverHandle`オブジェクトを返します。このオブジェクトを介して、画像選択ダイアログの位置を変更できます。例えば、端末の向きを変えた場合などに使用します。 + +返り値は `cameraSuccess` 関数に送信されます。値は `cameraOptions` の設定に従い、以下のいずれかのフォーマットで送られます: + +- Base64 形式でエンコードされたフォトイメージを表す文字列 +- ローカルストレージ内に記録されたファイルの場所を表す文字列 (デフォルト) + +エンコードされたイメージや URI をもとに、以下のような処理の記述が可能です: + +- `` タグで画像を表示 _(下記の使用例を参考にしてください)_ +- データをローカルに保存 (`LocalStorage` や [Lawnchair](http://brianleroux.github.com/lawnchair/) など) +- データをリモートサーバーに送信 + +__注意:__ 最新のデバイスで撮影した写真は高い解像度を持っています。デバイスのギャラリーから取得する画像はたとえ `quality` パラメーターで画質を指定したとしても、縮小されません。メモリーの問題を回避するために、 `Camera.destinationType` を `DATA_URL` ではなく、 `FILE_URI` に設定して下さい。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +Androidに関する注意点 +---------- + +デバイス上で写真を撮影するために、Androidはインテントを使用してカメラ・アクティビティを起動します。低メモリーのデバイスでは、Cordovaアクティビティが停止するかもしれません。この場合、Cordovaアクティビティがリストアされても、画像が表示されない可能性があります。 + +iOS に関する注意点 +---------- + +JavaScript の alert() をコールバック関数に含めると、問題が生じる可能性があります。 alert を setTimeout() でラップすることで、 alert が表示される前に iOS の image picker または popover が完全に閉じるようにします: + + setTimeout(function() { + // 任意のコード + }, 0); + + +Windows Phone 7 に関する注意点 +---------------------- + +Zune とデバイスが接続している間は、ネイティブカメラアプリケーションは起動せずに、エラーコールバックが呼び出されます。 + +Tizen に関する注意点 +---------------------- + +Tizenは `destinationType` では `Camera.DestinationType.FILE_URI`、 `sourceType` では `Camera.PictureSourceType.PHOTOLIBRARY` のみをサポートしています。 + +使用例 +------------- + +写真を撮影し、 Base64 形式のイメージとして取得します。 + + navigator.camera.getPicture(onSuccess, onFail, { quality: 50, + destinationType: Camera.DestinationType.DATA_URL + }); + + function onSuccess(imageData) { + var image = document.getElementById('myImage'); + image.src = "data:image/jpeg;base64," + imageData; + } + + function onFail(message) { + alert('エラーが発生しました: ' + message); + } + +撮影した写真の URI を取得します。 + + navigator.camera.getPicture(onSuccess, onFail, { quality: 50, + destinationType: Camera.DestinationType.FILE_URI }); + + function onSuccess(imageURI) { + var image = document.getElementById('myImage'); + image.src = imageURI; + } + + function onFail(message) { + alert('エラーが発生しました: ' + message); + } + + +詳細な使用例 +------------ + + + + + 写真を撮ってみよう + + + + + +
+
+
+
+ + + + diff --git a/docs/jp/2.9.0/cordova/camera/camera.md b/docs/jp/2.9.0/cordova/camera/camera.md new file mode 100755 index 0000000000..59ad0deff8 --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/camera.md @@ -0,0 +1,85 @@ +--- +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. +--- + +Camera +====== + +> `camera` オブジェクトは、デバイスのカメラアプリへの制御を提供します。 + +**プライバシーに関する重要な注意点:** デバイスのカメラから画像を使用する場合、プライバシーに関する重要な問題があります。アプリケーションの[プライバシー・ポリシー](guide_getting-started_index.md.html)では、どのようにしてカメラを使用するのか、そして撮影された画像を他のアプリケーションと共有するのか否かを、説明するべきです。加えて、アプリケーションがカメラを使っていることがユーザー・インタフェース上で確認できない場合、アプリケーションがカメラを使用する直前にユーザーへ通知するべきです(デバイスのOSが通知をしない場合)。この通知では上記と同じ情報を表示し、ユーザーの許可を得るようにしましょう(例えば、"Yes"と"No"の選択ダイアログを表示するなど)。詳細はPrivacy Guideを参照してください。 + +メソッド +------- + +- camera.getPicture +- camera.cleanup + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + + use_camera + + +### iOS + +#### config.xml + + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + +#### config.xml + + + + +参照: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures) diff --git a/docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverHandle.md b/docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverHandle.md new file mode 100755 index 0000000000..f74be1bb26 --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverHandle.md @@ -0,0 +1,68 @@ +--- + 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. +--- + +CameraPopoverHandle +=================== + +`camera.getPicture` で生成されたpopoverダイアログへのハンドルです。 + +メソッド +------- + +- __setPosition__: popoverの位置を設定します。 + +サポートされているプラットフォーム +------------------- + +- iOS + +setPosition +----------- + +popoverの位置を設定します。 + +__Parameters:__ +- `cameraPopoverOptions`: 新しい位置を指定する `CameraPopoverOptions` 。 + +使用例 +------------- + + var cameraPopoverOptions = new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); + cameraPopoverHandle.setPosition(cameraPopoverOptions); + +詳細な使用例 +------------ + + function onSuccess(imageData) { + // 画像に保存します。 + } + + function onFail(message) { + alert('Failed to get the picture: ' + message); + } + + var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, + { destinationType: Camera.DestinationType.FILE_URI, + sourceType: Camera.PictureSourceType.PHOTOLIBRARY }); + + // デバイスの向きが変わったら、popoverの位置を再設定します。 + window.onorientationchange = function() { + var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, 0); + cameraPopoverHandle.setPosition(cameraPopoverOptions); + } diff --git a/docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverOptions.md b/docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverOptions.md new file mode 100755 index 0000000000..740f18a33a --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/parameter/CameraPopoverOptions.md @@ -0,0 +1,76 @@ +--- +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. +--- + +CameraPopoverOptions +==================== + +iOS のみのパラメーターです。画像をライブラリーもしくはアルバムから選択する際の、 iPad でのポップオーバーの位置や矢印の向きを指定します。 + + { x : 0, + y : 32, + width : 320, + height : 480, + arrowDir : Camera.PopoverArrowDirection.ARROW_ANY + }; + +CameraPopoverOptions +-------------------- + +- __x__: ポップオーバーの x 座標をピクセルで表します。 _(Number)_ + +- __y__: ポップオーバーの y 座標をピクセルで表します。 _(Number)_ + +- __width__: ポップオーバーの幅をピクセルで表します。 _(Number)_ + +- __height__: ポップオーバーの高さをピクセルで表します。 _(Number)_ + +- __arrowDir__: ポップオーバーの矢印の向きを表します。 `Camera.PopoverArrowDirection` で定義されます。 _(Number)_ + + Camera.PopoverArrowDirection = { + ARROW_UP : 1, // iOS の UIPopoverArrowDirection 定数に同じ + ARROW_DOWN : 2, + ARROW_LEFT : 4, + ARROW_RIGHT : 8, + ARROW_ANY : 15 + }; + +ポップオーバーのサイズは矢印の方向や画面の向きによって調節され、変わる可能性があることについて注意してください。アンカー要素の位置を特定するとき、画面の向きの変化を考慮に入れることを忘れないで下さい。 + +使用例 +------------- + + var popover = new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); + var options = { + quality: 50, + destinationType: Camera.DestinationType.DATA_URL, + sourceType: Camera.PictureSource.SAVEDPHOTOALBUM, + popoverOptions : popover + }; + + navigator.camera.getPicture(onSuccess, onFail, options); + + function onSuccess(imageData) { + var image = document.getElementById('myImage'); + image.src = "data:image/jpeg;base64," + imageData; + } + + function onFail(message) { + alert('Failed because: ' + message); + } + diff --git a/docs/jp/2.9.0/cordova/camera/parameter/cameraError.md b/docs/jp/2.9.0/cordova/camera/parameter/cameraError.md new file mode 100755 index 0000000000..f34ebaf1ee --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/parameter/cameraError.md @@ -0,0 +1,32 @@ +--- +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. +--- + +cameraError +=========== + +エラーが発生した場合に呼び出されるコールバック関数です。 + + function(message) { + // エラーメッセージを表示 + } + +パラメーター +---------- + +- __message:__ デバイスのネイティブコードによって与えられたメッセージ _(String)_ diff --git a/docs/jp/2.9.0/cordova/camera/parameter/cameraOptions.md b/docs/jp/2.9.0/cordova/camera/parameter/cameraOptions.md new file mode 100755 index 0000000000..ceb8801c02 --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/parameter/cameraOptions.md @@ -0,0 +1,120 @@ +--- +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. +--- + +cameraOptions +============= + +カメラの設定をカスタマイズするのためのオプションパラメーターです。 + + { quality : 75, + destinationType : Camera.DestinationType.DATA_URL, + sourceType : Camera.PictureSourceType.CAMERA, + allowEdit : true, + encodingType: Camera.EncodingType.JPEG, + targetWidth: 100, + targetHeight: 100, + popoverOptions: CameraPopoverOptions, + saveToPhotoAlbum: false }; + +オプション +------- + +- __quality:__ イメージの画質を指定します。 範囲は0から100までであり、100を指定すると非圧縮時の解像度となります。_(Number)_ (カメラ解像度に関する情報を利用することはできません) + +- __destinationType:__ 返り値のフォーマットを指定します。フォーマットは `navigator.camera.DestinationType` で定義されています。 _(Number)_ + + Camera.DestinationType = { + DATA_URL : 0, // 画像を Base64 形式で取得 + FILE_URI : 1, // 画像をファイル URI として取得 + NATIVE_URI : 2 // 画像のネイティブURIとして取得 (例えば、iOSなら assets-library:// 、Androidなら content://) + }; + +- __sourceType:__ 取得ソースを指定します。ソースは nagivator.camera.PictureSourceType で定義されています。 _(Number)_ + + Camera.PictureSourceType = { + PHOTOLIBRARY : 0, + CAMERA : 1, + SAVEDPHOTOALBUM : 2 + }; + +- __allowEdit:__ イメージ選択の前に、簡単な編集を許可します。 _(Boolean)_ + +- __encodingType:__ 画像ファイルのエンコード形式を選択します。形式は navigator.camera.EncodingType で定義されています。 _(Number)_ + + Camera.EncodingType = { + JPEG : 0, // 画像を JPEG 形式で取得 + PNG : 1 // 画像を PNG 形式で取得 + }; + +- __targetWidth:__ 画像をスケールするための幅をピクセルで指定します。 targetHeight と同時に使用してください。アスペクト比は保持されます。 _(Number)_ +- __targetHeight:__ 画像をスケールするための高さをピクセルで指定します。 targetWidth と同時に使用してください。アスペクト比は保持されます。 _(Number)_ + +- __mediaType:__ 画像の取得元を指定します。 PictureSourceType に PHOTOLIBRARY もしくは SAVEPHOTOALBUM が指定されている場合にのみ有効です。取得元は nagivator.camera.MediaType で定義されています。 _(Number)_ + + Camera.MediaType = { + PICTURE: 0, // 取得元は静止画像のみとします。デフォルトです。返り値のフォーマットは DestinationType によって指定されたものになります。 + VIDEO: 1, // 取得元はビデオのみとします。戻り値のフォーマットは常にファイル URI となります。 + ALLMEDIA : 2 // 全てのメディアタイプからの取得を許可します。 + }; + +- __correctOrientation:__ 写真が撮影されたときと同じ向きになるよう写真を回転させます。 _(Boolean)_ +- __saveToPhotoAlbum:__ 写真が撮影された後、デバイスのフォトアルバムに画像を保存します。 _(Boolean)_ +- __popoverOptions:__ iPad でのポップオーバーの位置を指定します。iOS のみのオプションです。 `CameraPopoverOptions` で定義されます。 +- __cameraDirection__: 使用するカメラを選択します(フロントかバックのカメラ)。 `navigator.camera.Direction` で定義されます。 _(Number)_ + + Camera.Direction = { + BACK : 0, // バックのカメラを使用します + FRONT : 1 // フロントのカメラを使用します + }; + + +Android に関する注意点 +-------------- + +- `allowEdit` は無視されます。 +- `Camera.PictureSourceType.PHOTOLIBRARY` と `Camera.PictureSourceType.SAVEDPHOTOALBUM` は同じフォトアルバムを表示します。 + +BlackBerry に関する注意点 +----------------- + +- `quality` パラメーターは無視されます。 +- `sourceType` パラメーターは無視されます。 +- `allowEdit` は無視されます。 +- 撮影後にカメラアプリを閉じるためには、アプリケーションにキー入力許可の権限が付与されている必要があります。 +- 大きなサイズで撮影を行った場合、高画質カメラを搭載したデバイスでエンコードすることができない場合があります。 (Torch 9800 など) +- Camera.MediaType はサポートされていません。 +- `correctOrientation` パラメーターは無視されます。 + +iOS に関する注意点 +-------------- + +- メモリエラーを防ぐには、 `quality` パラメーターを50以下に設定してください。 +- `destinationType.FILE_URI` が使用された場合、撮影された写真や編集された写真はアプリケーションの temporary ディレクトリに保存されます。もしストレージの空きが少ない場合、このディレクトリは `navigator.fileMgr` API を使って消去できます。 + +Tizen に関する注意点 +-------------- +- オプションはサポートされていません。 +- 常に FILE URI を返します。 + +Windows Phone 7 と 8 に関する注意点 +-------------- + +- `allowEdit` パラメーターは無視されます。 +- `correctOrientation` パラメーターは無視されます。 +- `cameraDirection ` パラメーターは無視されます。 diff --git a/docs/jp/2.9.0/cordova/camera/parameter/cameraSuccess.md b/docs/jp/2.9.0/cordova/camera/parameter/cameraSuccess.md new file mode 100755 index 0000000000..02fc2da1e8 --- /dev/null +++ b/docs/jp/2.9.0/cordova/camera/parameter/cameraSuccess.md @@ -0,0 +1,42 @@ +--- +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. +--- + +cameraSuccess +============= + +撮影が成功したときに呼び出されるコールバック関数です。 + + function(imageData) { + // 任意のコード + } + +パラメーター +---------- + +- __imageData:__ Base64 エンコーディングされた画像データ、またはイメージファイルの URI (`cameraOptions`による) _(String)_ + +使用例 +------- + + // 画像を表示 + // + function cameraCallback(imageData) { + var image = document.getElementById('myImage'); + image.src = "data:image/jpeg;base64," + imageData; + } diff --git a/docs/jp/2.9.0/cordova/compass/compass.clearWatch.md b/docs/jp/2.9.0/cordova/compass/compass.clearWatch.md new file mode 100755 index 0000000000..0ff8ac2331 --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/compass.clearWatch.md @@ -0,0 +1,110 @@ +--- +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. +--- + +compass.clearWatch +======================== + +watch ID パラメーターによって参照されるコンパスの監視を停止します。 + + navigator.compass.clearWatch(watchID); + +- __watchID__: `compass.watchHeading` によって返される ID。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS +- Tizen +- Windows Phone 7 and 8 ハードウェア内で有効な場合 +- Windows 8 + +使用例 +------------- + + var watchID = navigator.compass.watchHeading(onSuccess, onError, options); + + // ... 後に続く ... + + navigator.compass.clearWatch(watchID); + +詳細な使用例 +------------ + + + + + Compass Example + + + + + +
方位を待機...
+ + + + diff --git a/docs/jp/2.9.0/cordova/compass/compass.clearWatchFilter.md b/docs/jp/2.9.0/cordova/compass/compass.clearWatchFilter.md new file mode 100644 index 0000000000..b6f4b32afe --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/compass.clearWatchFilter.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. +--- + +compass.clearWatchFilter +======================== + +1.6以降はサポートされていません。 `compass.clearWatch` を参照してください。 diff --git a/docs/jp/2.9.0/cordova/compass/compass.getCurrentHeading.md b/docs/jp/2.9.0/cordova/compass/compass.getCurrentHeading.md new file mode 100755 index 0000000000..223089881c --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/compass.getCurrentHeading.md @@ -0,0 +1,96 @@ +--- +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. +--- + +compass.getCurrentHeading +========================= + +現在のコンパスの向きを取得します。 + + navigator.compass.getCurrentHeading(compassSuccess, compassError, compassOptions); + +概要 +----------- + +コンパスはデバイスが向いている方向を感知するセンサーです。コンパスはその方角を0から359.99の範囲で計測します。 + +コンパスの向き情報は、 `compassSuccess` コールバック関数の `CompassHeading` オブジェクトを通じて返されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS +- Tizen +- Windows Phone 7 and 8 ハードウェア内で有効な場合 +- Windows 8 + +使用例 +------------- + + function onSuccess(heading) { + alert('現在の方位: ' + heading.magneticHeading); + }; + + function onError(error) { + alert('コンパスのエラーが発生しました: ' + error.code); + }; + + navigator.compass.getCurrentHeading(onSuccess, onError); + +詳細な使用例 +------------ + + + + + コンパスの使用例 + + + + + +

使用例

+

getCurrentHeading

+ + + diff --git a/docs/jp/2.9.0/cordova/compass/compass.md b/docs/jp/2.9.0/cordova/compass/compass.md new file mode 100755 index 0000000000..0ea78e7961 --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/compass.md @@ -0,0 +1,73 @@ +--- +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. +--- + +Compass +======= + +> デバイスの向いている方向に関する情報を取得します。 + +メソッド +------- + +- compass.getCurrentHeading +- compass.watchHeading +- compass.clearWatch +- compass.watchHeadingFilter (廃止) +- compass.clearWatchFilter (廃止) + +引数 +--------- + +- compassSuccess +- compassError +- compassOptions +- compassHeading + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +### BlackBerry WebWorks + + パーミッションの設定は必要ありません。 + +### iOS + +#### config.xml + + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + + パーミッションの設定は必要ありません。 diff --git a/docs/jp/2.9.0/cordova/compass/compass.watchHeading.md b/docs/jp/2.9.0/cordova/compass/compass.watchHeading.md new file mode 100755 index 0000000000..3f516485eb --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/compass.watchHeading.md @@ -0,0 +1,134 @@ +--- +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. +--- + +compass.watchHeading +==================== + +コンパス方位を一定の時間間隔で取得します。 + + var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]); + +概要 +----------- + +コンパスはデバイスが向いている方向を感知するセンサーです。コンパスはその方角を0から359.99の範囲で計測します。 + +`compass.watchHeading` 関数は一定の時間間隔でデバイスの現在の方位を取得します。方位情報が取得されるごとに `headingSuccess` コールバック関数が実行されます。時間間隔は `compassOptions` オブジェクトの `frequency` パラメーターを通じてミリ秒単位で指定します。 + +本関数の戻り値である watch ID は、コンパスの監視間隔への参照を表します。 `compass.clearWatch` 関数に watch ID を渡すことで、監視を停止できます。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS +- Tizen +- Windows Phone 7 and 8 ハードウェア内で有効な場合 +- Windows 8 + + +使用例 +------------- + + function onSuccess(heading) { + var element = document.getElementById('heading'); + element.innerHTML = '方位: ' + heading.magneticHeading; + }; + + function onError(compassError) { + alert('コンパスのエラーが発生しました: ' + compassError.code); + }; + + var options = { + frequency: 3000 + }; // 3秒ごとに更新 + + var watchID = navigator.compass.watchHeading(onSuccess, onError, options); + +詳細な使用例 +------------ + + + + + コンパスの使用例 + + + + + +
方位を待機...
+ + + + + +iOS に関する注意点 +-------------- + +iOS では、指定された角度分だけデバイスの現在の方位が変更されたとき、 `compass.watchHeading` でそのデバイスの現在の向きを取得することもできます。方位が指定された角度以上で変更されるたび、 `headingSuccess` コールバック関数が呼び出されます。角度は、 `compassOptions` オブジェクトの `filter` パラメーターで指定します。 `compass.clearWatch` に `watch ID` を渡すことで、通常と同じように監視を停止できます。この機能は、1.6で廃止になった iOS 限定の `watchHeadingFilter` 関数と `clearWatchFilter` 関数に置き換わるものです。 + +iOS では、一度に一つの `watchHeading` のみが有効です。もし `watchHeading` が filter を使用している場合、 `getCurrentHeading` 関数または `watchHeading` 関数は既に存在している filter の値を、方位の角度変化量の指定に使用します。 iOS では、時間による監視より、 filter を用いた方位変化量による監視の方が効果的です。 diff --git a/docs/jp/2.9.0/cordova/compass/compass.watchHeadingFilter.md b/docs/jp/2.9.0/cordova/compass/compass.watchHeadingFilter.md new file mode 100644 index 0000000000..76228f84ea --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/compass.watchHeadingFilter.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. +--- + +compass.watchHeadingFilter +========================== + +1.6以降はサポートされていません。同等の機能として、 `compass.watchHeading` を参照してください。 diff --git a/docs/jp/2.9.0/cordova/compass/compassError/compassError.md b/docs/jp/2.9.0/cordova/compass/compassError/compassError.md new file mode 100755 index 0000000000..153a5f6950 --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/compassError/compassError.md @@ -0,0 +1,40 @@ +--- +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. +--- + +CompassError +========== + +エラーが起きた場合、 `compassError` コールバック関数には `CompassError` オブジェクトが返されます。 + +プロパティー +---------- + +- __code__: 事前に定義された以下のエラーコードのうちの1つを表します + +定数 +--------- +- `CompassError.COMPASS_INTERNAL_ERR` +- `CompassError.COMPASS_NOT_SUPPORTED` + +概要 +----------- + +エラーが起きた場合、 `compassError` コールバック関数には `CompassError` オブジェクトが返されます。 + + diff --git a/docs/jp/2.9.0/cordova/compass/parameters/compassError.md b/docs/jp/2.9.0/cordova/compass/parameters/compassError.md new file mode 100755 index 0000000000..15b3473119 --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/parameters/compassError.md @@ -0,0 +1,30 @@ +--- +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. +--- + +compassError +========== + +コンパス方位の取得に失敗したときに呼び出されるコールバック関数です。 + +使用例 +------- + +function(CompassError) { + // エラー処理 +} diff --git a/docs/jp/2.9.0/cordova/compass/parameters/compassHeading.md b/docs/jp/2.9.0/cordova/compass/parameters/compassHeading.md new file mode 100755 index 0000000000..d782c6abd4 --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/parameters/compassHeading.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. +--- + +compassHeading +========== + +`compassSuccess` コールバック関数には `CompassHeading` オブジェクトが返されます。 + +プロパティー +---------- +- __magneticHeading__: ある瞬間のコンパス方位を磁北を基準に0から359.99の範囲で表します。 _(Number)_ +- __trueHeading__: ある瞬間のコンパス方位を真北を基準に0から359.99の範囲で表します。負の値は、 trueHeading の値が定まっていないことを示しています。 _(Number)_ +- __headingAccuracy__: magneticHeading の値と trueHeading の値との角度の差、偏角を表します。 _(Number)_ +- __timestamp__: コンパス方位を取得した時間を表します。 _(milliseconds)_ + +概要 +----------- + +`CompassHeading` オブジェクトは、 `compassSuccess` コールバック関数に返されます。 + +Android に関する注意点 +-------------- +- `trueHeading` はサポートされていません。 `trueHeadingI には `magneticHeading` と同じ値が代入されます。 +- このため、 Android では `trueHeading` と `magneticHeading` に差が無いので、 `headingAccuracy` は常に0となります。 + +iOS に関する注意点 +---------- + +- `trueHeading` は、位置情報サービスが `navigator.geolocation.watchLocation()` によって稼動している場合にのみ返されます。 +- iOS 4より上位のデバイスでは、もしデバイスが横方向などに回転していて、アプリがそれをサポートしていれば、 `magneticHeading` の値は現在のデバイスの向きに対応して返されます。 + diff --git a/docs/jp/2.9.0/cordova/compass/parameters/compassOptions.md b/docs/jp/2.9.0/cordova/compass/parameters/compassOptions.md new file mode 100755 index 0000000000..5dc69d85dd --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/parameters/compassOptions.md @@ -0,0 +1,44 @@ +--- +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. +--- + +compassOptions +============== + +コンパス取得の設定をカスタマイズするためのパラメーターを表します。 + +オプション +------- + +- __frequency:__ コンパスの向きを取得する頻度をミリ秒で表します。 _(Number)_ (デフォルト: 100) +- __filter:__ watchHeading の成功時のコールバック関数を初期化する際に必要な、角度の変化量を表します。 _(Number)_ + +Android に関する注意点 +-------------- + +- `filter` はサポートされていません。 + +Tizen に関する注意点 +----------- + +- `filter` はサポートされていません。 + +Windows Phone 7, 8 に関する注意点 +-------------- + +- `filter` はサポートされていません。 diff --git a/docs/jp/2.9.0/cordova/compass/parameters/compassSuccess.md b/docs/jp/2.9.0/cordova/compass/parameters/compassSuccess.md new file mode 100755 index 0000000000..d7f4382c00 --- /dev/null +++ b/docs/jp/2.9.0/cordova/compass/parameters/compassSuccess.md @@ -0,0 +1,40 @@ +--- +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. +--- + +compassSuccess +============== + +コンパス方位の取得に成功したときに、 compassHeading オブジェクトを用いてコンパス方位情報を提供するコールバック関数です。 + + function(heading) { + // 任意のコード + } + +パラメーター +---------- + + +- __heading__: 方位情報。 _(compassHeading)_ + +使用例 +------- + + function onSuccess(heading) { + alert('現在の方位: ' + heading.magneticHeading); + }; diff --git a/docs/jp/2.9.0/cordova/connection/connection.md b/docs/jp/2.9.0/cordova/connection/connection.md new file mode 100755 index 0000000000..fe3c40212d --- /dev/null +++ b/docs/jp/2.9.0/cordova/connection/connection.md @@ -0,0 +1,85 @@ +--- +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. +--- + +Connection +========== + +> `navigator.connection` として提供されている `connection` オブジェクトを通じて、携帯電話ネットワーク及び wifi 接続情報にアクセス出来ます。 + +プロパティー +---------- + +- connection.type + +定数 +--------- + +- Connection.UNKNOWN +- Connection.ETHERNET +- Connection.WIFI +- Connection.CELL_2G +- Connection.CELL_3G +- Connection.CELL_4G +- Connection.CELL +- Connection.NONE + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest.xml + + + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +### iOS + +#### config.xml + + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + +#### config.xml + + + +参照: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures) diff --git a/docs/jp/2.9.0/cordova/connection/connection.type.md b/docs/jp/2.9.0/cordova/connection/connection.type.md new file mode 100755 index 0000000000..17d5350510 --- /dev/null +++ b/docs/jp/2.9.0/cordova/connection/connection.type.md @@ -0,0 +1,126 @@ +--- +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. +--- + +connection.type +=================== + +使われているネットワーク接続のタイプを確認します。 + +概要 +----------- + +このプロパティーは、デバイスのネットワーク接続状態や接続のタイプを手早く取得出来ます。 + +サポートされているプラットフォーム +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function checkConnection() { + var networkState = navigator.connection.type; + + var states = {}; + states[Connection.UNKNOWN] = '不明な接続'; + states[Connection.ETHERNET] = 'イーサネット接続'; + states[Connection.WIFI] = 'WiFi接続'; + states[Connection.CELL_2G] = '2G接続'; + states[Connection.CELL_3G] = '3G接続'; + states[Connection.CELL_4G] = '4G接続'; + states[Connection.CELL] = '汎用接続'; + states[Connection.NONE] = 'ネットワーク接続なし'; + + alert('コネクションタイプ: ' + states[networkState]); + } + + checkConnection(); + +詳細な使用例 +------------ + + + + + navigator.connection.type 使用例 + + + + + +

ダイアログボックスがネットワーク状態を表示します。

+ + + +API の変更点 +---------- +Cordova 2.3.0までは、 `Connection` オブジェクトは `navigator.network.connection` にありました。その後、W3Cの仕様と一致させるため、 `navigator.connection` に変更されました。`navigator.network.connection` はまだ存在していますが、非推奨であり、将来削除されるでしょう。 + +iOS に関する注意点 +---------- + +- iOS はネットワーク接続のタイプを特定することが出来ません。 + - 携帯電話ネットワークでの接続時、 `navigator.connection.type` には `Connection.CELL_2G` がセットされます。これは 2.6.0 で非推奨となり、将来のリリースでは `Connection.CELL` を返すように変更される予定です。 + +Windows Phone に関する注意点 +-------------------- + +- Windows Phone Emulator は常に `navigator.connection.type` を `Connection.UNKNOWN` と返します。 +- Windows Phone はネットワーク接続のタイプを特定することが出来ません。 + - 携帯電話ネットワークでの接続時、 `navigator.connection.type` には `Connection.CELL` がセットされます。 + +Tizen に関する注意点 +-------------------- + +- Tizen は WiFi または 携帯電話ネットワークに接続されているかどうかのみを特定できます。 + - 携帯電話ネットワークでの接続時、 `navigator.connection.type` には `Connection.CELL_2G` がセットされます。 diff --git a/docs/jp/2.9.0/cordova/contacts/Contact/contact.md b/docs/jp/2.9.0/cordova/contacts/Contact/contact.md new file mode 100755 index 0000000000..5e73175074 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/Contact/contact.md @@ -0,0 +1,226 @@ +--- +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. +--- + +Contact +======= + +連絡先に格納された情報を表します。 + +プロパティー +---------- + +- __id__: 固定のIDを表します _(DOMString)_ +- __displayName__: 連絡先の名称を表します _(DOMString)_ +- __name__: 個人名に関するオブジェクトを表します _(ContactName)_ +- __nickname__: ニックネームを表します _(DOMString)_ +- __phoneNumbers__: 連絡先のすべての電話番号の配列を表します _(ContactField[])_ +- __emails__: 連絡先のすべてのメールアドレスの配列を表します _(ContactField[])_ +- __addresses__: 連絡先のすべての住所の配列を表します _(ContactAddress[])_ +- __ims__: 連絡先のすべてのIMアドレスの配列を表します _(ContactField[])_ +- __organizations__: 連絡先のすべての組織名の配列を表します _(ContactOrganization[])_ +- __birthday__: 連絡先の誕生日を表します _(Date)_ +- __note__: 連絡先のメモを表します _(DOMString)_ +- __photos__: 連絡先の写真の配列を表します _(ContactField[])_ +- __categories__: 連絡先のユーザー定義カテゴリーの配列を表します _(ContactField[])_ +- __urls__: 連絡先に関連したURLの配列を表します _(ContactField[])_ + +メソッド +------- + +- __clone__: オブジェクトのディープコピーを行い、新しい `Contact` オブジェクトを作成して返します。 `id` プロパティーは `null` に設定されます。 +- __remove__: オブジェクトを連絡先データベースから削除します。 削除が失敗した場合は `ContactError` を伴ったエラーコールバック関数が呼び出されます。 +- __save__: 新しい連絡先を連絡先データベースに保存します。 __id__ が既に登録されている場合は連絡先データベースを上書きします。 + + +詳細 +------- + +`Contact` オブジェクトはユーザーの連絡先を格納します。 連絡先はデバイスの連絡先データベースから作成したり、保存したり、削除することが可能です。 `contacts.find` 関数を呼ぶことで、連絡先データベースから連絡先を取得することも出来ます。 + +__注意__: プラットフォームによっては、いくつかのフィールドがサポートされていない場合があります。プラットフォームごとの注意点に詳細を記載しています。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +保存する例 +------------------ + + function onSuccess(contact) { + alert("保存に成功しました。"); + }; + + function onError(contactError) { + alert("エラー = " + contactError.code); + }; + + // 新しい連絡先オブジェクトを作成 + var contact = navigator.contacts.create(); + contact.displayName = "Plumber"; + contact.nickname = "Plumber"; // すべてのデバイスに対応するため、両方の項目をセット + + // その他のフィールドを作成 + var name = new ContactName(); + name.givenName = "Jane"; + name.familyName = "Doe"; + contact.name = name; + + // デバイスに保存 + contact.save(onSuccess,onError); + +コピーを行う例 +------------------- + + // 連絡先オブジェクトをコピー + var clone = contact.clone(); + clone.name.givenName = "John"; + console.log("元の名前 = " + contact.name.givenName); + console.log("クローンの名前 = " + clone.name.givenName); + +削除を行う例 +-------------------- + + function onSuccess() { + alert("削除に成功しました。"); + }; + + function onError(contactError) { + alert("エラー = " + contactError.code); + }; + + // デバイスから連絡先を削除 + contact.remove(onSuccess,onError); + +詳細な使用例 +------------ + + + + + Contact の使用例 + + + + + +

使用例

+

連絡先の検索

+ + + +Android 2.X に関する注意点 +------------------ + +- __categories__: このプロパティーは Android 2.X ではサポートされておらず、常に `null` を返します。 + +BlackBerry WebWorks (OS 5.0 and higher) に関する注意点 +--------------------------------------------- + +- __id__: サポートされています。 連絡先が保存されたときに、デバイスによって割り当てられます。 +- __displayName__: サポートされています。 BlackBerry では __user1__ フィールドとして保存されます。 +- __nickname__: このプロパティーはサポートされておらず、常に `null` を返します。. +- __phoneNumbers__: 部分的にサポートされています。 BlackBerry では、電話番号はもし _type_ が 'home' の場合は __homePhone1__と __homePhone2__ に、 _type_ が 'work' の場合は __workPhone1__ と __workPhone2__ に、 _type_ が 'mobile' の場合は __mobilePhone__ に、 _type_ が 'fax' の場合は __faxPhone__ に、 _type_ が 'pager' の場合は __pagerPhone__ に、それ以外の場合は __otherPhone__ に保存されます。 +- __emails__: 部分的にサポートされています。 BlackBerry では、最初の3メールアドレスが __email1__, __email2__, __email3__ フィールドに保存されます。 +- __addresses__: 部分的にサポートされています。 BlackBerry では、最初の2つの住所が __homeAddress__ と __workAddress__ フィールドに保存されます。 +- __ims__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __organizations__: 部分的にサポートされています。 BlackBerry では、最初の組織の名前とタイトルが __company__ と __title__ フィールドに保存されます。 +- __photos__: 部分的にサポートされています。 サムネイルサイズの写真のみサポートされています。 連絡先に写真を登録する場合、 Base64 エンコードされたイメージか、イメージの場所を指定する URL を渡します。 写真は BlackBerry の連絡先データベースに保存される前に縮小されます。 連絡先写真は Base64 エンコードされたイメージとして返されます。 +- __categories__: 部分的にサポートされています。 'Business' と 'Personal' カテゴリーのみサポートされています。 +- __urls__: 部分的にサポートされています。 BlackBerry では、最初の URL が __webpage__ フィールドに保存されます。 + +iOS に関する注意点 +---------- +- __displayName__: このプロパティーは iOS ではサポートされておらず、 ContactName が指定されていない場合限り `null` を返します。 もし ContactName が指定されていない場合、合成された名前、 __nickname__ 、または "" が __displayName__ として返されます。 +- __birthday__: 入力として、このプロパティーは JavaScript の Date オブジェクトとして指定する必要があります。 JavaScript の Date オブジェクトとして返されます。 +- __photos__: 取得した写真はアプリの一時ディレクトリに保存され、写真への File URL が返されます。一時ディレクトリの中身はアプリを終了する際に削除されます。 +- __categories__: このプロパティーはサポートされておらず、常に `null` を返します。 + +Windows Phone 7 and 8 に関する注意点 +----------- + +- __displayName__: 連絡先を作成した時に提供される display name は、連絡先を見つけた時に読み込んだ display name とは異なります。 +- __urls__: 連絡先生成時には1つ以上のWebアドレスを保存できます。ただし、検索時には1つのアドレスしか利用できません。 +- __phoneNumbers__: _pref_ オプションはサポートされていません。 _type_ は _find_ 操作ではサポートされていません。 _type_ には `phoneNumber` のみを指定できます。 +- __emails__: _pref_ オプションはサポートされていません。 home と personal _type_ は同じエントリーを参照します。 各 _type_ に1つのエントリーのみ登録可能です。 +- __addresses__: _type_ はwork、home、personalのみをサポートしています。 home と personal _type_ は同じアドレス・エントリーを参照します。 各 _type_ に1つのエントリーのみ登録可能です。 +- __organizations__: 1つだけ登録できます。 _pref_、 _type_、_department_ 属性はサポートされていません。 +- __note__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __ims__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __birthdays__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __categories__: このプロパティーはサポートされておらず、常に `null` を返します。 diff --git a/docs/jp/2.9.0/cordova/contacts/ContactAddress/contactaddress.md b/docs/jp/2.9.0/cordova/contacts/ContactAddress/contactaddress.md new file mode 100755 index 0000000000..4110daedd3 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/ContactAddress/contactaddress.md @@ -0,0 +1,157 @@ +--- +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. +--- + +ContactAddress +============== + +`Contact` オブジェクトの住所プロパティーを表します。 + +プロパティー +---------- +- __pref__: `ContactAddress` がユーザーの推奨値を含むかどうかを表します。含む場合、 `true` がセットされます _(boolean)_ +- __type__: フィールドのタイプを表します (例: 'home') _(DOMString)_ +- __formatted__: 住所全体を表します _(DOMString)_ +- __streetAddress__: 番地を表します _(DOMString)_ +- __locality__: 都市名を表します _(DOMString)_ +- __region__: 地域名を表します _(DOMString)_ +- __postalCode__: 郵便番号を表します _(DOMString)_ +- __country__: 国を表します _(DOMString)_ + +詳細 +------- + +`ContactAddress` オブジェクトは連絡先の住所に関するプロパティーを表します。 `Contact` オブジェクトは、複数の住所が格納された `ContactAddress[]` 配列を保持しています。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // すべての連絡先の住所情報を取得し、表示します + function onSuccess(contacts) { + for (var i=0; i + + + Contact の使用例 + + + + + +

使用例

+

連絡先の検索

+ + + +Android 2.X に関する注意点 +------------------ + +- __pref__: このプロパティーは Android 2.X ではサポートされておらず、常に `false` を返します。 + +BlackBerry WebWorks (OS 5.0 and higher) に関する注意点 +-------------------------------------------- + +- __pref__: このプロパティーは BlackBerry ではサポートされておらず、常に `false` を返します。 +- __type__: 部分的にサポートされています。 一つの連絡先につき、一つずつの "Work" と "Home" タイプの住所が保存できます。 +- __formatted__: 部分的にサポートされています。 BlackBerry のアドレスフィールドの連結を返します。 +- __streetAddress__: サポートされています。 BlackBerry の __address1__ と __address2__ アドレスフィールドの連結を返します。 +- __locality__: サポートされています。 BlackBerry の __city__ アドレスフィールドに保存されます。 +- __region__: サポートされています。 BlackBerry の __stateProvince__ アドレスフィールドに保存されます。 +- __postalCode__: サポートされています。 BlackBerry の __zipPostal__ アドレスフィールドに保存されます。 +- __country__: サポートされています。 + +iOS に関する注意点 +---------- + +- __pref__: このプロパティーは iOS ではサポートされておらず、常に `false` を返します。 +- __formatted__: サポートされていません。 diff --git a/docs/jp/2.9.0/cordova/contacts/ContactError/contactError.md b/docs/jp/2.9.0/cordova/contacts/ContactError/contactError.md new file mode 100755 index 0000000000..1ea4b6674d --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/ContactError/contactError.md @@ -0,0 +1,45 @@ +--- +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. +--- + +ContactError +======== + +`ContactError` オブジェクトは、エラーが発生したときに `contactError` コールバック関数に渡されるオブジェクトです。 + +プロパティー +---------- + +- __code__: 事前に定義された以下のエラーコードのうちの1つを表します + +定数 +--------- + +- `ContactError.UNKNOWN_ERROR` +- `ContactError.INVALID_ARGUMENT_ERROR` +- `ContactError.TIMEOUT_ERROR` +- `ContactError.PENDING_OPERATION_ERROR` +- `ContactError.IO_ERROR` +- `ContactError.NOT_SUPPORTED_ERROR` +- `ContactError.PERMISSION_DENIED_ERROR` + +概要 +----------- + +`ContactError` オブジェクトは、エラーが発生したときに `contactError` コールバック関数に渡されるオブジェクトです。 + diff --git a/docs/jp/2.9.0/cordova/contacts/ContactField/contactfield.md b/docs/jp/2.9.0/cordova/contacts/ContactField/contactfield.md new file mode 100755 index 0000000000..5f425a129b --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/ContactField/contactfield.md @@ -0,0 +1,143 @@ +--- +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. +--- + +ContactField +============ + +`Contact` オブジェクトで使用される汎用フィールドに用いられます。 `ContactField` オブジェクトとして格納されるデータとしては、メールアドレス、電話番号、URLなどが挙げられます。 + +プロパティー +---------- + +- __type__: フィールドのタイプを表します (例: _home_) _(DOMString)_ +- __value__: フィールド値を表します (例: 電話番号、メールアドレス) _(DOMString)_ +- __pref__: `ContactField` がユーザーの推奨値を含むかどうかを表します。含む場合、 `true` がセットされます _(boolean)_ + +詳細 +------- + +`ContactField` オブジェクトは、連絡先の各フィールドを汎用的に格納するためのコンポーネントです。各 `ContactField` オブジェクトは、 `value` プロパティ、 `type` プロパティ、 `pref` プロパティーを持っています。 `Contact` オブジェクトは電話番号やメールアドレスなどといった複数のプロパティーを `ContactField[]` 配列に保存しています。 + +多くの場合 `ContactField` オブジェクトの __type__ 属性に定義済みの値は存在しません。例えば、電話番号について __type__ 属性の値として _home_, _work_, _mobile_, _iPhone_ など、デバイスのプラットフォームに応じて異なった値が格納されます。ただし `Contact` の __photos__ フィールドに限り、 __type__ 属性には、返す画像の画像フォーマットが格納されます。 __value__ 属性が画像への URL である場合、 _url_ を返します。 __value__ 属性が Base64 形式の画像データである場合、 _base64_ を返します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // 新しい連絡先を作成 + var contact = navigator.contacts.create(); + + // 連絡先の電話番号を ContactField[] に格納 + var phoneNumbers = []; + phoneNumbers[0] = new ContactField('work', '212-555-1234', false); + phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // 推奨された電話番号 + phoneNumbers[2] = new ContactField('home', '203-555-7890', false); + contact.phoneNumbers = phoneNumbers; + + // 連絡先を保存 + contact.save(); + +詳細な使用例 +------------ + + + + + Contact の使用例 + + + + + +

使用例

+

連絡先の検索

+ + + +Android に関する注意点 +-------------- + +- __pref__: このプロパティーはサポートされておらず、常に `false` を返します。 + +BlackBerry WebWorks (OS 5.0 and higher) に関する注意点 +-------------------------------------------- + +- __type__: 部分的にサポートされています。電話番号に使われます。 +- __value__: サポートされています。 +- __pref__: このプロパティーはサポートされておらず、常に `false` を返します。 + +iOS に関する注意点 +----------- + +- __pref__: このプロパティーはサポートされておらず、常に `false` を返します。 diff --git a/docs/jp/2.9.0/cordova/contacts/ContactFindOptions/contactfindoptions.md b/docs/jp/2.9.0/cordova/contacts/ContactFindOptions/contactfindoptions.md new file mode 100755 index 0000000000..821c8f44e4 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/ContactFindOptions/contactfindoptions.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. +--- + +ContactFindOptions +================== + +`contacts.find` 関数の検索結果を絞るために使用するプロパティーを表します。 + +プロパティー +---------- + +- __filter__: 絞り込み検索用の文字列を指定します _(DOMString)_ (デフォルト: "") +- __multiple__: 検索時に複数の連絡先を返すかどうかを指定します _(Boolean)_ (デフォルト: false) + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // 呼び出し成功 + function onSuccess(contacts) { + for (var i=0; i + + + Contact の使用例 + + + + + +

使用例

+

連絡先の検索

+ + diff --git a/docs/jp/2.9.0/cordova/contacts/ContactName/contactname.md b/docs/jp/2.9.0/cordova/contacts/ContactName/contactname.md new file mode 100755 index 0000000000..bd1cbd8a7a --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/ContactName/contactname.md @@ -0,0 +1,141 @@ +--- +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. +--- + +ContactName +=========== + +`Contact` オブジェクトの名前に関する様々な情報を保持します。 + +プロパティー +---------- + +- __formatted__: 連絡先のフルネームを表します _(DOMString)_ +- __familyName__: 連絡先の姓を表します _(DOMString)_ +- __givenName__: 連絡先の名を表します _(DOMString)_ +- __middleName__: 連絡先のミドルネームを表します _(DOMString)_ +- __honorificPrefix__: 連絡先の接頭敬称を表します (例: Mr. Dr.) _(DOMString)_ +- __honorificSuffix__: 連絡先の接尾敬称を表します (例: Esq.) _(DOMString)_ + +詳細 +------- + +`ContactName` オブジェクトは連絡先の名前プロパティーの情報を格納します。 + +サポートされているプラットフォーム +------------------- + +- Android 2.X +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function onSuccess(contacts) { + for (var i=0; i + + + Contact の使用例 + + + + + +

使用例

+

連絡先の検索

+ + + +Android に関する注意点 +------------ + +- __formatted__: 部分的にサポートされていますが、読み込み専用です。 honorificPrefix, givenName, middleName, familyName, honorificSuffix を連結したものを返します。 + +BlackBerry WebWorks (OS 5.0 and higher) に関する注意点 +--------------------------------------------- + +- __formatted__: 部分的にサポートされています。 BlackBerry の __firstName__ と __lastName__ フィールドを連結したものを返します。 +- __familyName__: サポートされています。 BlackBerry の __lastName__ フィールドに保存されています。 +- __givenName__: サポートされています。 BlackBerry の __firstName__ フィールドに保存されています。 +- __middleName__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __honorificPrefix__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __honorificSuffix__: このプロパティーはサポートされておらず、常に `null` を返します。 + +iOS に関する注意点 +------------ + +- __formatted__: 部分的にサポートされています。 iOS の合成名を返しますが、読み込み専用です。 diff --git a/docs/jp/2.9.0/cordova/contacts/ContactOrganization/contactorganization.md b/docs/jp/2.9.0/cordova/contacts/ContactOrganization/contactorganization.md new file mode 100755 index 0000000000..16203612a7 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/ContactOrganization/contactorganization.md @@ -0,0 +1,146 @@ +--- +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. +--- + +ContactOrganization +=================== + +`Contact` オブジェクトの組織プロパティーを表します。 + +プロパティー +---------- + +- __pref__: `ContactOrganization` がユーザーの推奨値を含むかどうかを表します。含む場合、 `true` がセットされます _(boolean)_ +- __type__: フィールドのタイプを表します (例: 'home') _(DOMString)_ +- __name__: 組織名を表します _(DOMString)_ +- __department__: 部署名を表します _(DOMString)_ +- __title__: 役職名を表します _(DOMString)_ + +詳細 +------- + +`ContactOrganization` オブジェクトは連絡先の組織情報を表します。 `Contact` オブジェクトは複数の `ContactOrganization` オブジェクトを配列に保持します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function onSuccess(contacts) { + for (var i=0; i + + + Contact の使用例 + + + + + +

使用例

+

連絡先の検索

+ + + + +Android 2.X に関する注意点 +------------------ + +- __pref__: このプロパティーはサポートされておらず、常に `false` を返します。 + +BlackBerry WebWorks (OS 5.0 and higher) に関する注意点 +-------------------------------------------- + +- __pref__: このプロパティーはサポートされておらず、常に `false` を返します。 +- __type__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __name__: 部分的にサポートされています。一つ目の組織名が BlackBerry の __company__ フィールドに保存されます。 +- __department__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __title__: 部分的にサポートされています。一つ目の役職名が BlackBerry の __jobTitle__ フィールドに保存されます。 + +iOS に関する注意点 +----------- + +- __pref__: このプロパティーはサポートされておらず、常に `false` を返します。 +- __type__: このプロパティーはサポートされておらず、常に `null` を返します。 +- __name__: 部分的にサポートされています。一つ目の組織名が iOS の __kABPersonOrganizationProperty__ フィールドに保存されます。 +- __department__: 部分的にサポートされています。一つ目の部署名が iOS の __kABPersonDepartmentProperty__ フィールドに保存されます。 +- __title:__ 部分的にサポートされています。一つ目の役職名が iOS の __kABPersonJobTitleProperty__ フィールドに保存されます。 diff --git a/docs/jp/2.9.0/cordova/contacts/contacts.create.md b/docs/jp/2.9.0/cordova/contacts/contacts.create.md new file mode 100755 index 0000000000..b3ea5ffc53 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/contacts.create.md @@ -0,0 +1,77 @@ +--- +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. +--- + +contacts.create +=============== + +新しい Contact オブジェクトを作成します。 + + var contact = navigator.contacts.create(properties); + +概要 +----------- + +`contacts.create` 関数は、新しい `Contact` オブジェクトを同期的に作成します。 + +この関数で作成した Contact オブジェクトは、デバイスの連絡先データベースには残りません。 Contact オブジェクトをデバイスに保存するには、 `Contact.save` 関数を使用します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 + +使用例 +------------- + + var myContact = navigator.contacts.create({"displayName": "Test User"}); + +詳細な使用例 +------------ + + + + + Contact の使用例 + + + + + +

使用例

+

連絡先を作成します

+ + diff --git a/docs/jp/2.9.0/cordova/contacts/contacts.find.md b/docs/jp/2.9.0/cordova/contacts/contacts.find.md new file mode 100755 index 0000000000..f38402e2bf --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/contacts.find.md @@ -0,0 +1,116 @@ +--- +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. +--- + +contacts.find +============= + +デバイスの連絡先データベースに問い合わせを行い、 `Contact` オブジェクトを取得します。 + + navigator.contacts.find(contactFields, contactSuccess, contactError, contactFindOptions); + +概要 +----------- + +`contacts.find` 関数は、デバイスの連絡先データベースに問い合わせを行い、 `Contact` オブジェクトの配列を返す非同期関数です。 作成されたオブジェクトは __contactSuccess__ として `contactSuccess` コールバック関数に渡されます。 + +このメソッドを使用する際は __contactFields__ パラメーターに検索フィールドを指定します。 __contactFields__ パラメーターに渡したフィールドだけが、 `Contact` オブジェクトのプロパティーとして __contactSuccess__ コールバック関数に渡されます。 __contactFields__ パラメーターが空の場合は不正な値とみなされ、 `ContactError.INVALID_ARGUMENT_ERROR` となります。 __contactFields__ の値が "*" の場合は、全ての連絡先フィールドが返されます。 + +連絡先データベースの問い合わせの際には、 __contactFindOptions.filter__ を用いて検索条件を絞ることが出来ます。このオプションが指定されていた場合、大文字小文字の区別なく、部分一致方式により __contactFields__ パラメーターに指定されたフィールドの検索が行われます。いずれかのフィールドにマッチした内容があった場合、その連絡先情報が返されます。 + +パラメーター +---------- + +- __contactFields__: 検索条件に格納されるフィールドを指定します。このパラメーターに定義されたフィールドのみが `Contact` オブジェクトにセットされます。 _(DOMString[])_ [必須] +- __contactSuccess__: 連絡先データベースへの問い合わせに成功した場合に呼び出されるコールバック関数を指定します [必須] +- __contactError__: エラーコールバック関数を指定します。連絡先データベースへの問い合わせに失敗した場合に呼び出されます [任意] +- __contactFindOptions__: 連絡先情報に絞り込み検索を行うための検索オプションを指定します [任意] + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function onSuccess(contacts) { + alert(contacts.length + ' 件の連絡先が見つかりました。'); + }; + + function onError(contactError) { + alert('エラーが発生しました。'); + }; + + // Bob という名前が含まれる全ての連絡先を取得 + var options = new ContactFindOptions(); + options.filter = "Bob"; + options.multiple = true; + var fields = ["displayName", "name"]; + navigator.contacts.find(fields, onSuccess, onError, options); + +詳細な使用例 +------------ + + + + + Contact の使用例 + + + + + +

使用例

+

連絡先の検索

+ + diff --git a/docs/jp/2.9.0/cordova/contacts/contacts.md b/docs/jp/2.9.0/cordova/contacts/contacts.md new file mode 100755 index 0000000000..19b111760e --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/contacts.md @@ -0,0 +1,94 @@ +--- +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. +--- + +Contacts +======== + +> `contacts` オブジェクトを通じて、デバイスの連絡先データベースにアクセスできます。 + +**プライバシーに関する重要な注意点:** 連絡先データを扱う場合、プライバシーに関する重要な問題があります。 アプリケーションの [プライバシー・ポリシー](guide_getting-started_index.md.html) では、連絡先データをどのように使用するのか、そして他のアプリケーションとデータを共有するのか否か、を説明するべきです。連絡情報は慎重に扱うべき情報です。なぜならば、ある個人が連絡を取り合っている相手を特定出来るからです。 それゆえに、アプリケーションのプライバシー・ポリシーに加えて、連絡先データへアクセスする際には、その都度通知するように強く心がけるべきでしょう (もしデバイスのOSが常に通知を行っていない場合)。この通知では、上記と同様の情報を提供し、ユーザーの許可を得るようにするべきです (例えば、"OK"と"NO"などの選択肢を表示するなど)。いくつかのアプリケーション・マーケットでは、連絡先データへアクセスする際には、アプリケーションはユーザーへ通知を行い、許可を得るようにしなければなりません。連絡先データ使用に関するユーザー体験を明確に理解することで、ユーザーの混乱を回避し、連絡先データの誤用を防ぐことにつながります。詳細は Privacy Guide を参照してください。 + +メソッド +------- + +- contacts.create +- contacts.find + +引数 +--------- + +- contactFields +- contactSuccess +- contactError +- contactFindOptions + +オブジェクト +------- + +- Contact +- ContactName +- ContactField +- ContactAddress +- ContactOrganization +- ContactFindOptions +- ContactError + +パーミッション +----------- + +### Android + +#### app/res/xml/plugins.xml + + + +#### app/AndroidManifest.xml + + + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + + + +### iOS + +#### config.xml + + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) diff --git a/docs/jp/2.9.0/cordova/contacts/parameters/contactError.md b/docs/jp/2.9.0/cordova/contacts/parameters/contactError.md new file mode 100644 index 0000000000..027c4d8795 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/parameters/contactError.md @@ -0,0 +1,27 @@ +--- +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. +--- + +contactError +============ + +連絡先情報の取得に失敗したときに呼び出されるコールバック関数です。 + + function(error) { + // エラー処理 + } diff --git a/docs/jp/2.9.0/cordova/contacts/parameters/contactFields.md b/docs/jp/2.9.0/cordova/contacts/parameters/contactFields.md new file mode 100644 index 0000000000..0139cc4980 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/parameters/contactFields.md @@ -0,0 +1,25 @@ +--- +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. +--- + +contactFields +============= + +`contacts.find` メソッドを使用する際の必須パラメーターです。このパラメーターを使って、検索操作によって得られる `Contact` オブジェクトが持つフィールドを指定します。 + + ["name", "phoneNumbers", "emails"] diff --git a/docs/jp/2.9.0/cordova/contacts/parameters/contactFindOptions.md b/docs/jp/2.9.0/cordova/contacts/parameters/contactFindOptions.md new file mode 100755 index 0000000000..dbc72130c9 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/parameters/contactFindOptions.md @@ -0,0 +1,35 @@ +--- +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. +--- + +contactFindOptions +================== + +`contacts.find` メソッドを使用する際のオプションのパラメーターです。連絡先の検索時にフィルターをかける場合に使用します。 + + { + filter: "", + multiple: true, + }; + +オプション +------- + +- __filter__: 絞り込み検索用の文字列を指定します _(DOMString)_ (デフォルト: "") +- __multiple__: 検索時に複数の連絡先を返すかどうかを指定します _(Boolean)_ (デフォルト: false) + diff --git a/docs/jp/2.9.0/cordova/contacts/parameters/contactSuccess.md b/docs/jp/2.9.0/cordova/contacts/parameters/contactSuccess.md new file mode 100755 index 0000000000..10d68af054 --- /dev/null +++ b/docs/jp/2.9.0/cordova/contacts/parameters/contactSuccess.md @@ -0,0 +1,41 @@ +--- +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. +--- + +contactSuccess +============== + +`contacts.find` メソッドの実行に成功した場合に呼び出される、 `Contact` 配列を提供するコールバック関数です。 + + function(contacts) { + // 任意のコード + } + +パラメーター +---------- + +- __contacts__: 検索の結果の連絡先配列 (`Contact`) + +使用例 +------- + + function contactSuccess(contacts) { + for (var i=0; i + + + デバイスプロパティーの使用例 + + + + + +

デバイスプロパティーを読込中...

+ + + diff --git a/docs/jp/2.9.0/cordova/device/device.md b/docs/jp/2.9.0/cordova/device/device.md new file mode 100755 index 0000000000..76e4c0fc7d --- /dev/null +++ b/docs/jp/2.9.0/cordova/device/device.md @@ -0,0 +1,92 @@ +--- +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. +--- + +Device +====== + +> `device` オブジェクトはデバイスのハードウェアとソフトウェアの情報を表します。 + +プロパティー +---------- + +- device.name +- device.cordova +- device.platform +- device.uuid +- device.version +- device.model + +変数の範囲 +-------------- + +`device` オブジェクトは `window` オブジェクトに割当たれるため、暗黙的にグローバルスコープとして扱われます。 + + // 下記は同じ `device` オブジェクト + var phoneName = window.device.name; + var phoneName = device.name; + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest.xml + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + read_device_identifying_information + + +### iOS + + パーミッションの設定は必要ありません。 + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + +#### config.xml + + + +参照: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures) diff --git a/docs/jp/2.9.0/cordova/device/device.model.md b/docs/jp/2.9.0/cordova/device/device.model.md new file mode 100755 index 0000000000..762a7ceb95 --- /dev/null +++ b/docs/jp/2.9.0/cordova/device/device.model.md @@ -0,0 +1,99 @@ +--- + 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. +--- + +device.model +=========== + +デバイスのモデル名を取得します。 + + var string = device.model; + +概要 +----------- + +`device.model` はデバイスのモデル名もしくは製品名を返します。この値はデバイスの製造者によって設定されるため、同じモデルでも異なるバージョンで値が異なる場合があります。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 and higher) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // Android: Nexus One は "Passion" (Nexus Oneのコード名) を返します。 + // Motorola Droid は "voles" を返します。 + // BlackBerry: Torch 9800 は "9800" を返します。 + // iOS: iPad Mini は iPad2,5を返し、 iPhone 5 は iPhone 5,1 を返します。詳細は http://theiphonewiki.com/wiki/index.php?title=Models を確認して下さい。 + // + var model = device.model; + +詳細な使用例 +------------ + + + + + Device Properties Example + + + + + +

Loading device properties...

+ + + +Android に関する注意点 +-------------- + +- [モデル名](http://developer.android.com/reference/android/os/Build.html#MODEL) の代わりに [製品名](http://developer.android.com/reference/android/os/Build.html#PRODUCT) を取得します。製品名はほとんどの場合、生産時のコードネームになります。例えば、Nexus One は "Passion" を返し、 Motorola Droid は "voles" を返します。 + +Tizen に関する注意点 +----------- + +- ベンダーが付けたデバイス名を返します。 例: 'TIZEN' + +Windows Phone 7 and 8 に関する注意点 +------------- + +- 製造時のデバイス名を返します。例えば、Samsung Focus は 'SGH-i917' を返します。 diff --git a/docs/jp/2.9.0/cordova/device/device.name.md b/docs/jp/2.9.0/cordova/device/device.name.md new file mode 100755 index 0000000000..8772ed124e --- /dev/null +++ b/docs/jp/2.9.0/cordova/device/device.name.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. +--- + +device.name +=========== + +__WARNING:__ バージョン2.3.0以降 `device.name` は廃止される予定です。代わりに `device.model` を使って下さい。 + +デバイスのモデル名を取得します。 + + var string = device.name; + +概要 +----------- + +`device.name` はデバイスのモデル名を返します。この値はデバイスの製造者によって設定されるため、同じモデルでも異なるバージョンで値が異なる場合があります。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // Android: Nexus One はコードネームである "Passion" を返します + // Motorola Droid は "voles" を返します + // BlackBerry: Torch 9800 は "9800" を返します + // iOS: "iPhone", "iPod Touch", "iPhone Simulator", "iPad", "iPad Simulator"のいずれかを返します + // + var name = device.name; + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

デバイスプロパティーを読込中...

+ + + + +Android に関する注意点 +-------------- + +- [モデル名](http://developer.android.com/reference/android/os/Build.html#MODEL) の代わりに [製品名](http://developer.android.com/reference/android/os/Build.html#PRODUCT) を取得します。製品名はほとんどの場合、生産時のコードネームになります。例えば、Nexus One は "Passion" を返し、 Motorola Droid は "voles" を返します。 + +Windows Phone 7 and 8 に関する注意点 +------------- + +- 製造時のデバイス名を返します。例えば、Samsung Focus は 'SGH-i917' を返します。 + +Tizen に関する注意点 +----------- + +- ベンダーが付けたデバイス名を返します。 例: 'TIZEN' diff --git a/docs/jp/2.9.0/cordova/device/device.platform.md b/docs/jp/2.9.0/cordova/device/device.platform.md new file mode 100755 index 0000000000..7ffc5d0663 --- /dev/null +++ b/docs/jp/2.9.0/cordova/device/device.platform.md @@ -0,0 +1,95 @@ +--- +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. +--- + +device.platform +=============== + +デバイスの OS 名を取得します。 + + var string = device.platform; + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // デバイスによって異なります。例: + // - "Android" + // - "BlackBerry" + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

デバイスプロパティーを読込中...

+ + + +BlackBerry に関する注意点 +----------------- + +OS 名ではなくプラットフォームのバージョンを返す可能性があります。例えば、 Storm2 9550 の場合 '2.13.0.95' を返すことがあります。 + +Windows Phone 7 に関する注意点 +----------------- + +Windows Phone 7 デバイスはプラットフォームとして 'WinCE' を返します。 + +Windows Phone 8 に関する注意点 +----------------- + +Windows Phone 8 デバイスはプラットフォームとして 'Win32NT' を返します。 diff --git a/docs/jp/2.9.0/cordova/device/device.uuid.md b/docs/jp/2.9.0/cordova/device/device.uuid.md new file mode 100755 index 0000000000..1ad38df250 --- /dev/null +++ b/docs/jp/2.9.0/cordova/device/device.uuid.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. +--- + +device.uuid +=========== + +デバイスの固定 ID ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)) を取得します。 + + var string = device.uuid; + +概要 +----------- + +UUID の生成方法については、デバイスの製造者やプラットフォームによって決定されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // Android: ランダムな64ビットの数値を文字列として返します + // 数値はデバイスの初回起動時に生成されます + // + // BlackBerry: デバイスの PIN 番号を文字列として返します + // この番号は9桁の一意な数値です + // + // iPhone: (UIDevice クラスのドキュメントに記載) + // ハードウエア ID に基づくハッシュ値を返します + // デバイスに固有でユーザーアカウントとは + // リンクされていません + // Windows Phone 7 : デバイスユーザーのハッシュ値を返します + // もしユーザーが定義されていない場合、ガイドが生成され、アプリがアンインストールするまで存続します + // Tizen: デバイスの IMEI (International Mobile Equipment Identity) を返します + // IMEI はGSM と UMTS の全ての携帯電話ごとに一意な番号です + var deviceID = device.uuid; + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

デバイスプロパティーを読込中...

+ + + +iOS に関する注意点 +------------- + +iOS の UUID はデバイスによって一意ではありませんが、インストールされたアプリごとに一意です。もしアプリを削除し再インストールすると、この値は変化します。また、 iOS のバージョンアップをしたとき、もしくはアプリのバージョンアップをしたときにも変化する可能性があります (iOS 5.1 で現象を確認) 。安定した値ではありません。 + +Windows Phone 7 と 8 に関する注意点 +------------- + +Windows Phone 7 の UUID には `ID_CAP_IDENTITY_DEVICE` の許可が必要です。 Microsoft はこのプロパティーを近い将来サポートしなくなります。もし機能が有効でなければ、アプリが永続的な guid を生成し、インストールされている限り保持されます。 diff --git a/docs/jp/2.9.0/cordova/device/device.version.md b/docs/jp/2.9.0/cordova/device/device.version.md new file mode 100755 index 0000000000..992bcb2bb2 --- /dev/null +++ b/docs/jp/2.9.0/cordova/device/device.version.md @@ -0,0 +1,84 @@ +--- +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. +--- + +device.version +============== + +OS のバージョンを取得します。 + + var string = device.version; + +サポートされているプラットフォーム +------------------- + +- Android 2.1+ +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // Android: Froyo の場合は "2.2" を返す + // Eclair の場合は "2.1", "2.0.1" もしくは "2.0" を返す + // アップデートが行われると "2.1-update1" のように返す + // + // BlackBerry: OS 6.0 を搭載した Torch 9800 の場合は "6.0.0.600" を返す + // + // iPhone: iOS 3.2 は "3.2" を返す + // + // Windows Phone 7: 現在の OS バージョンを返す、例: Mango は7.10.7720を返す + // Tizen: "TIZEN_20120425_2" を返す + var deviceVersion = device.version; + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

デバイスプロパティーを読込中...

+ + diff --git a/docs/jp/2.9.0/cordova/events/events.backbutton.md b/docs/jp/2.9.0/cordova/events/events.backbutton.md new file mode 100755 index 0000000000..4a417689bb --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.backbutton.md @@ -0,0 +1,81 @@ +--- +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. +--- + +backbutton +=========== + +このイベントはユーザーが戻るボタンを押したときに呼び出されます。 + + document.addEventListener("backbutton", yourCallbackFunction, false); + +詳細 +------- + +デフォルトの戻るボタンの挙動を上書きしたい場合は、 `backbutton` イベントにイベントリスナーを登録して下さい。通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。戻るボタンの挙動を上書きするために、他のメソッドを呼び出す必要はありません。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- Windows Phone 7 and 8 + +使用例 +------------- + + document.addEventListener("backbutton", onBackKeyDown, false); + + function onBackKeyDown() { + // メニューボタン関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Back Button 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.batterycritical.md b/docs/jp/2.9.0/cordova/events/events.batterycritical.md new file mode 100755 index 0000000000..34d6fb01a3 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.batterycritical.md @@ -0,0 +1,90 @@ +--- +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. +--- + +batterycritical +=========== + +このイベントはバッテリー残量が危険な閾値に達したときに呼び出されます。 + + window.addEventListener("batterycritical", yourCallbackFunction, false); + +詳細 +------- + +このイベントはバッテリー残量が危険なパーセンテージの閾値に達したときに呼び出されます。 + +`batterycritical` ハンドラーには、以下の2つのプロパティーを持つオブジェクトが引数として渡されます: + +- __level__: バッテリーのパーセンテージ (0-100) _(Number)_ +- __isPlugged__: デバイスが充電器に接続されているかどうかを表します _(Boolean)_ + +通常は、 `deviceready` イベントを受け取った後、 `window.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- Tizen + +使用例 +------------- + + window.addEventListener("batterycritical", onBatteryCritical, false); + + function onBatteryCritical(info) { + // バッテリー関する操作を記述 + alert("バッテリー残量が危険です " + info.level + "%\nすぐに充電してください。"); + } + +詳細な使用例 +------------ + + + + + Cordova Battery Criticaly 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.batterylow.md b/docs/jp/2.9.0/cordova/events/events.batterylow.md new file mode 100755 index 0000000000..45c0bc61ea --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.batterylow.md @@ -0,0 +1,90 @@ +--- +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. +--- + +batterylow +=========== + +このイベントはバッテリー残量が低下したときに呼び出されます。 + + window.addEventListener("batterylow", yourCallbackFunction, false); + +詳細 +------- + +このイベントはバッテリー残量のパーセンテージが低下の閾値に達したときに呼び出されます。この値はデバイス固有です。 + +`batterylow` ハンドラーには、以下の2つのプロパティー持つオブジェクトが引数として渡されます: + +- __level__ バッテリーのパーセンテージ (0-100) _(Number)_ +- __isPlugged:__ デバイスが充電器に接続されているかどうかを表します _(Boolean)_ + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- Tizen + +使用例 +------------- + + window.addEventListener("batterylow", onBatteryLow, false); + + function onBatteryLow(info) { + // バッテリー関する操作を記述 + alert("バッテリー残量が低下しています " + info.level + "%"); + } + +詳細な使用例 +------------ + + + + + Cordova Device Ready 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.batterystatus.md b/docs/jp/2.9.0/cordova/events/events.batterystatus.md new file mode 100755 index 0000000000..b8e5ec042c --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.batterystatus.md @@ -0,0 +1,96 @@ +--- +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. +--- + +batterystatus +=========== + +このイベントはバッテリーのステータスが変化したときに呼び出されます。 + + window.addEventListener("batterystatus", yourCallbackFunction, false); + +詳細 +------- + +このイベントはバッテリー残量のパーセンテージが1パーセントでも変化したときに呼び出されます。また、デバイスが充電器に接続されたとき、接続が解除されたときも呼び出されます。 + +`batterystatus` ハンドラーには、以下の2つのプロパティーを持つオブジェクトが引数として渡されます: + +- __level__: バッテリーのパーセンテージ (0-100) _(Number)_ +- __isPlugged__: デバイスが充電器に接続されているかどうかを表します _(Boolean)_ + +通常は、 `deviceready` イベントを受け取った後、 `window.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- iOS +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- Windows Phone 7 and 8 +- Tizen + +Windows Phone 7 と 8 に関する注意点 +---------------------- + +Windows Phone 7 はバッテリー残量を取得するネイティブの API を提供していないため、level プロパティーは利用できません。 `isPlugged` パラメーターはサポートされています。 + +使用例 +------------- + + window.addEventListener("batterystatus", onBatteryStatus, false); + + function onBatteryStatus(info) { + // バッテリーに関する操作を記述 + console.log("残量: " + info.level + " 充電器に接続: " + info.isPlugged); + } + +詳細な使用例 +------------ + + + + + Cordova Device Ready 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.deviceready.md b/docs/jp/2.9.0/cordova/events/events.deviceready.md new file mode 100755 index 0000000000..63970a5472 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.deviceready.md @@ -0,0 +1,87 @@ +--- +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. +--- + +deviceready +=========== + +このイベントは Cordova が完全にロードされたときに呼び出されます。 + + document.addEventListener("deviceready", yourCallbackFunction, false); + +詳細 +------- + +このイベントはすべてのアプリケーションで使用される重要なイベントです。このイベントは Cordova のデバイス API が読み込まれ、利用可能になったことを通知します。 + +Cordova はネイティブと JavaScript の2つのコードで形成されます。ネイティブコードがロードされている間は、カスタムのロード画面が表示されます。しかし、 DOM が読み込まれると JavaScript は 読み込まれます。そのため、 ネイティブコードが利用可能になる前に、 Cordova の JavaScript 関数群が呼ばれる可能性があります。 + +`deviceready` イベントは、 Cordova が完全にロードされた後で呼び出されます。このイベントが呼び出された後は、 Cordova API を安全に呼び出せます。通常は、 HTML の DOM が読み込まれた後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +`deviceready` イベントは他のイベントとは異なった振る舞いをします。 `deviceready` イベントが発火された後に登録された他のどのイベントハンドラーも、直ちに呼び出せるコールバック関数を保持しています。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + document.addEventListener("deviceready", onDeviceReady, false); + + function onDeviceReady() { + // Cordova API を安全に使用できます + } + +詳細な使用例 +------------ + + + + + Cordova Device Ready 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.endcallbutton.md b/docs/jp/2.9.0/cordova/events/events.endcallbutton.md new file mode 100755 index 0000000000..5089feba1c --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.endcallbutton.md @@ -0,0 +1,82 @@ +--- +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. +--- + +endcallbutton +=========== + +このイベントはユーザーがエンドコールボタンを押したときに呼び出されます。 + + document.addEventListener("endcallbutton", yourCallbackFunction, false); + +詳細 +------- + +このイベントはデフォルトのエンドコールボタンの挙動を上書きします。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- BlackBerry WebWorks (OS 5.0 以上) + +使用例 +------------- + + document.addEventListener("endcallbutton", onEndCallKeyDown, false); + + function onEndCallKeyDown() { + // エンドコールボタン関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova End Call Button 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.md b/docs/jp/2.9.0/cordova/events/events.md new file mode 100755 index 0000000000..3a5a993ac1 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.md @@ -0,0 +1,85 @@ +--- +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. +--- + +Events +====== + +> Cordova ライフサイクルのイベントです。 + +Event Types +----------- + +- deviceready +- pause +- resume +- online +- offline +- backbutton +- batterycritical +- batterylow +- batterystatus +- menubutton +- searchbutton +- startcallbutton +- endcallbutton +- volumedownbutton +- volumeupbutton + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest.xml + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + + +### iOS + +#### config.xml + + + +### Windows Phone + + No permissions are required. + +### Tizen + +#### config.xml + + + +参照: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures) diff --git a/docs/jp/2.9.0/cordova/events/events.menubutton.md b/docs/jp/2.9.0/cordova/events/events.menubutton.md new file mode 100755 index 0000000000..fd144413f0 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.menubutton.md @@ -0,0 +1,83 @@ +--- +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. +--- + +menubutton +=========== + +このイベントはユーザーがメニューボタンを押したときに呼び出されます。 + + document.addEventListener("menubutton", yourCallbackFunction, false); + +詳細 +------- + +イベントハンドラーを登録することで、デフォルトのメニューボタンの挙動を上書きします。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) + +使用例 +------------- + + document.addEventListener("menubutton", onMenuKeyDown, false); + + function onMenuKeyDown() { + // メニューボタン関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Menu Button 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.offline.md b/docs/jp/2.9.0/cordova/events/events.offline.md new file mode 100755 index 0000000000..922ed96111 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.offline.md @@ -0,0 +1,97 @@ +--- +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. +--- + +offline +=========== + +このイベントはアプリケーションがオフラインになったとき、つまりデバイスのインターネット接続が切れたときに呼び出されます。 + + document.addEventListener("offline", yourCallbackFunction, false); + +詳細 +------- + +デバイスのネットワーク接続が切れ、アプリケーションがインターネットへアクセスできなくなったとき、 `offline` イベントが呼び出されます。このイベントは Connection API と同じ情報を利用しており、 `connection.type` の値が `NONE` に変わった時に呼び出されます。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + document.addEventListener("offline", onOffline, false); + + function onOffline() { + // offlineイベントに関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Offline 使用例 + + + + + + + + +iOS に関する注意点 +-------------------------- +初回起動時、最初の `offline` イベントは少なくとも起動に1秒かかります。 + +Windows Phone 7 に関する注意点 +-------------------------- +エミュレータで起動している場合、デバイスの `connection.status` は常に unknown (不明) であるため、このイベントは呼び出されません。 + +Windows Phone 8 に関する注意点 +-------------------------- +エミュレータでは `Cellular` を connection type として報告されるため、このイベントは呼び出されません。 diff --git a/docs/jp/2.9.0/cordova/events/events.online.md b/docs/jp/2.9.0/cordova/events/events.online.md new file mode 100755 index 0000000000..c7ccf3f5e6 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.online.md @@ -0,0 +1,97 @@ +--- +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. +--- + +online +=========== + +このイベントはアプリケーションがオンラインになったとき、つまりデバイスがインターネットに接続されたときに呼び出されます。 + + document.addEventListener("online", yourCallbackFunction, false); + +詳細 +------- + +デバイスがネットワークに接続され、アプリケーションがインターネットへ接続できる状態になった時に `online` イベントが呼び出されます。このイベントは Connection API と同じ情報を利用しており、 `connection.type` の値が `NONE` から他の値へ変わった時に呼び出されます。 + +通常は、 Cordova の 'deviceready' イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + document.addEventListener("online", onOnline, false); + + function onOnline() { + // online イベントに関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Online 使用例 + + + + + + + + +iOS に関する注意点 +-------------------------- +初回起動時、最初の online イベントは少なくとも起動に1秒かかります。 + +Windows Phone 7 に関する注意点 +-------------------------- +エミュレータで起動している場合、デバイスの `connection.status` は常に unknown (不明) であるため、このイベントは呼び出されません。 + +Windows Phone 8 に関する注意点 +-------------------------- +エミュレータでは `Cellular` を connection type として報告されるため、このイベントは呼び出されません。 diff --git a/docs/jp/2.9.0/cordova/events/events.pause.md b/docs/jp/2.9.0/cordova/events/events.pause.md new file mode 100755 index 0000000000..a0fde3a8f7 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.pause.md @@ -0,0 +1,90 @@ +--- +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. +--- + +pause +=========== + +このイベントはアプリケーションがバックグラウンド動作になったときに呼び出されます。 + + document.addEventListener("pause", yourCallbackFunction, false); + +詳細 +------- + +OSがアプリをバックグラウンドへ移動したときに `pause` イベントが呼び出されます。通常はユーザーが別のアプリを使い出したときです。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + document.addEventListener("pause", onPause, false); + + function onPause() { + // pause イベントに関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Pause 使用例 + + + + + + + + +iOS に関する注意点 +-------------------------- +`pause` ハンドラー内では、 Cordova API や Objective-C を利用するネイティブプラグインへあらゆる呼び出しは一切動作しません。 alerts や `console.log` のような、あらゆるインタラクティブな呼び出しも同様に機能しません。これらは、アプリを再開したときに実行されます (次の run-loop で実行されます) 。 + +iOS固有の __resign__ イベントは `pause` イベントの一部として使用でき、アプリ実行中にオン/オフボタンが押されたことを検知するのに使われます。 もしアプリ (とデバイス) がマルチタスク可能なら、このイベントは iOS 5 でのみ続く `pause` と対になります。事実上マルチタスク可能な iOS 5 のすべてのロックされたアプリはバックグラウンド操作となります。iOS 5 で、もしデバイスがロック状態でもまだアプリを動かしたいのなら、アプリに対してマルチタスク機能を無効 (UIApplicationExitsOnSuspend - YES) にする必要があります。 iOS 4 の場合は、デバイスロック状態でアプリを動作させることと、マルチタスク機能の設定は関係ありません。 diff --git a/docs/jp/2.9.0/cordova/events/events.resume.md b/docs/jp/2.9.0/cordova/events/events.resume.md new file mode 100755 index 0000000000..e8061b41bf --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.resume.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. +--- + +resume +=========== + +このイベントはアプリケーションがバックグラウンドから復帰したときに呼び出されます。 + + document.addEventListener("resume", yourCallbackFunction, false); + +詳細 +------- + +OSがアプリをバックグラウンドから復帰させるとき、 `resume` イベントが呼び出されます。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + document.addEventListener("resume", onResume, false); + + function onResume() { + // resume イベントに関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Resume 使用例 + + + + + + + + +iOS に関する注意点 +-------------------------- +アプリが復帰したとき、つまり `resume` イベントが呼び出されたときに、 `pause` イベントハンドラーで呼び出されたインタラクティブな関数が実行されます。これには alerts や `console.log` 、 Objective-C を介して呼び出されるプラグインや Cordova API が含まれます。 + +- __active__ イベント + + iOS 固有の `active` イベントは `resume` イベントの代わりとして使用でき、アプリ実行中にオン/オフボタンが押されたことを検知するのに使われます。もしアプリ (とデバイス) がマルチタスク可能なら、このイベントは iOS 5 でのみ続く `resume` と対になります。事実上マルチタスク可能な iOS 5 のすべてのロックされたアプリはバックグラウンド操作となります。 iOS 5 で、もしデバイスがロック状態でもまだアプリを動かしたいのなら、アプリに対してマルチタスク機能を無効 (UIApplicationExitsOnSuspend - YES) にする必要があります。 iOS 4 の場合は、デバイスロック状態でアプリを動作させることと、マルチタスク機能の設定は関係ありません。 + +- __resume__ イベント + + `alert()` などのインタラクティブな関数群を `resume` イベントハンドラーから呼び出す場合、 遅延 0 秒で `setTimeout()` 関数を使って、その中で呼び出す必要があります。そうしなければ、アプリは応答しなくなります。使用例は次の通りです。 + + document.addEventListener("resume", onResume, false); + function onResume() { + setTimeout(function() { + // TODO: do your thing! + }, 0); + } diff --git a/docs/jp/2.9.0/cordova/events/events.searchbutton.md b/docs/jp/2.9.0/cordova/events/events.searchbutton.md new file mode 100755 index 0000000000..a2c119e6e0 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.searchbutton.md @@ -0,0 +1,82 @@ +--- +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. +--- + +searchbutton +=========== + +このイベントはユーザーが Android の検索ボタンを押したときに呼び出されます。 + + document.addEventListener("searchbutton", yourCallbackFunction, false); + +詳細 +------- + +もし Android にデフォルトの検索ボタンの挙動を上書きしたい場合は、 'searchbutton' イベントにイベントリスナーを登録することができます。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- Android + +使用例 +------------- + + document.addEventListener("searchbutton", onSearchKeyDown, false); + + function onSearchKeyDown() { + // 検索ボタン関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Search Button 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.startcallbutton.md b/docs/jp/2.9.0/cordova/events/events.startcallbutton.md new file mode 100755 index 0000000000..621a24b451 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.startcallbutton.md @@ -0,0 +1,82 @@ +--- +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. +--- + +startcallbutton +=========== + +このイベントはユーザーがスタートコールボタンを押したときに呼び出されます。 + + document.addEventListener("startcallbutton", yourCallbackFunction, false); + +詳細 +------- + +もしデフォルトの検索ボタンの挙動を上書きしたい場合は、 `startcallbutton` イベントにイベントリスナーを登録することができます。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- BlackBerry WebWorks (OS 5.0 以上) + +使用例 +------------- + + document.addEventListener("startcallbutton", onStartCallKeyDown, false); + + function onStartCallKeyDown() { + // スタートコールボタン関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Start Call Button 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.volumedownbutton.md b/docs/jp/2.9.0/cordova/events/events.volumedownbutton.md new file mode 100755 index 0000000000..efeb98eab0 --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.volumedownbutton.md @@ -0,0 +1,82 @@ +--- +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. +--- + +volumedownbutton +=========== + +このイベントはユーザーがボリュームダウンボタンを押したときに呼び出されます。 + + document.addEventListener("volumedownbutton", yourCallbackFunction, false); + +詳細 +------- + +もしデフォルトのボリュームダウンボタンの挙動を上書きしたい場合は、 `volumedownbutton` イベントにイベントリスナーを登録することができます。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- BlackBerry WebWorks (OS 5.0 以上) + +使用例 +------------- + + document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false); + + function onVolumeDownKeyDown() { + // ボリュームダウンボタン関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Volume Down Button 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/events/events.volumeupbutton.md b/docs/jp/2.9.0/cordova/events/events.volumeupbutton.md new file mode 100755 index 0000000000..3aa468514d --- /dev/null +++ b/docs/jp/2.9.0/cordova/events/events.volumeupbutton.md @@ -0,0 +1,82 @@ +--- +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. +--- + +volumeupbutton +=========== + +このイベントはユーザーがボリュームアップボタンを押したときに呼び出されます。 + + document.addEventListener("volumeupbutton", yourCallbackFunction, false); + +詳細 +------- + +もしデフォルトのボリュームアップボタンの挙動を上書きしたい場合は、 `volumeupbutton` イベントにイベントリスナーを登録することができます。 + +通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を通じてイベントリスナーを登録します。 + +サポートされているプラットフォーム +------------------- + +- BlackBerry WebWorks (OS 5.0 以上) + +使用例 +------------- + + document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false); + + function onVolumeUpKeyDown() { + // ボリュームアップボタン関する操作を記述 + } + +詳細な使用例 +------------ + + + + + Cordova Volume Up Button 使用例 + + + + + + + diff --git a/docs/jp/2.9.0/cordova/file/directoryentry/directoryentry.md b/docs/jp/2.9.0/cordova/file/directoryentry/directoryentry.md new file mode 100755 index 0000000000..f2b20632a6 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/directoryentry/directoryentry.md @@ -0,0 +1,398 @@ +--- +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. +--- + +DirectoryEntry +============== + +このオブジェクトはファイルシステムのディレクトリを表します。これは [W3C Directories and Systems](http://www.w3.org/TR/file-system-api/) の仕様書で定義されています。 + +プロパティー +---------- + +- __isFile__: 常に false を表します _(boolean)_ +- __isDirectory__: 常に true を表します _(boolean)_ +- __name__: パスを除いた `DirectoryEntry` の名前を表します _(DOMString)_ +- __fullPath__: ルートから `DirectoryEntry` への絶対パスを表します _(DOMString)_ + +注意: 以下の属性は W3C の仕様書によって定義されていますが、 Cordova ではサポートされていません: + +- __filesystem__: `DirectoryEntry` が属するファイルシステムを表します _(FileSystem)_ + +メソッド +------- + +以下のメソッドは `DirectoryEntry` オブジェクトから呼び出すことができます: + +- __getMetadata__: ディレクトリのメタデータを取得します +- __setMetadata__: ディレクトリのメタデータをセットします +- __moveTo__: ディレクトリを、ファイルシステム内の別の場所に移動します +- __copyTo__: ディレクトリを、ファイルシステム内の別の場所にコピーします +- __toURL__: ディレクトリの位置特定に使用できる URL を返します +- __remove__: ディレクトリを削除します。ディレクトリは空である必要があります +- __getParent__: 親ディレクトリを取得します +- __createReader__: ディレクトリからエントリを読み込みできる `DirectoryReader` を作成します +- __getDirectory__: ディレクトリを取得または作成します +- __getFile__: ファイルを取得または作成します +- __removeRecursively__: ディレクトリと、その中身をすべて削除します + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +getMetadata +----------- + +ディレクトリのメタデータを取得します。 + +__パラメーター:__ + +- __successCallback__: `Metadata` オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: `Metadata` の取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + + +__使用例__ + + function success(metadata) { + console.log("最終更新日: " + metadata.modificationTime); + } + + function fail(error) { + alert(error.code); + } + + // このエントリーの Metadata オブジェクトを取得 + entry.getMetadata(success, fail); + +setMetadata +---------------- + +ディレクトリのメタデータをセットします。 +**現在 iOS のみ対応しています** - ディレクトリの拡張属性をセットします。 + +__パラメーター:__ + +- __successCallback__: Metadata が正常にセットされたときに呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: Metadata のセット時にエラーが起きた場合に呼び出されるコールバック関数を表します _(Function)_ +- __metadataObject__: Metadata のキーと値が格納されているオブジェクトを表します _(Object)_ + + +__使用例__ + + function success() { + console.log("メタデータが正常にセットされました。"); + } + + function fail() { + alert("メタデータ作成中にエラーが発生しました。"); + } + + // メタデータをセット + entry.setMetadata(success, fail, { "com.apple.MobileBackup": 1}); +__iOS に関する注意点__ + +- `com.apple.MobileBackup` 拡張属性のみサポートされています。値を `1` とセットすることで、ディレクトリを iCloud でバックアップされない設定とします。値を `0` とセットすることで、再度ディレクトリを iCloud でバックアップされる設定とします。 + +__使用例__ + + function setFolderMetadata(localFileSystem, subFolder, metadataKey, metadataValue) + { + var onSetMetadataWin = function() { + console.log("メタデータが正常にセットされました。") + } + var onSetMetadataFail = function() { + console.log("メタデータ作成中にエラーが発生しました。") + } + + var onGetDirectoryWin = function(parent) { + var data = {}; + data[metadataKey] = metadataValue; + parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data); + } + var onGetDirectoryFail = function() { + console.log("ディレクトリ取得中にエラーが発生しました。") + } + + var onFSWin = function(fileSystem) { + fileSystem.root.getDirectory(subFolder, {create: true, exclusive: false}, onGetDirectoryWin, onGetDirectoryFail); + } + + var onFSFail = function(evt) { + console.log(evt.target.error.code); + } + + window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail); + } + + setFolderMetadata(LocalFileSystem.PERSISTENT, "Backups", "com.apple.MobileBackup", 1); + +moveTo +------ + +ディレクトリを、ファイルシステム内の別の場所に移動します。 以下のことを試みるとエラーが発生します: + +- ディレクトリをそれ自体、またはその子ディレクトリに移動する場合 +- もし移動先親ディレクトリが移動元と同じで、移動先ディレクトリ名も移動元と同じである場合 +- もし移動先のディレクトリ名がファイルである場合 +- もし移動先のディレクトリが空でないディレクトリである場合 + +ディレクトリをすでに存在するディレクトリの場所に移動する行為は、削除してディレクトリを置き換える行為となります。 + +__パラメーター:__ + +- __parent__: ディレクトリの移動先の親ディレクトリを表します _(DirectoryEntry)_ +- __newName__: ディレクトリの新しい名前を表します。 もし指定されていない場合は、デフォルトで現在の名前となります _(DOMString)_ +- __successCallback__: 新しいディレクトリの `DirectoryEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ディレクトリの移動中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + + +__使用例__ + + function success(entry) { + console.log("新しいパス: " + entry.fullPath); + } + + function fail(error) { + alert(error.code); + } + + function moveDir(entry) { + var parent = document.getElementById('parent').value, + parentName = parent.substring(parent.lastIndexOf('/')+1), + newName = document.getElementById('newName').value, + parentEntry = new DirectoryEntry(parentName, parent); + + // ディレクトリを新しいディレクトリに移動し、名前付け替えます + entry.moveTo(parentEntry, newName, success, fail); + } + +copyTo +------ + +ディレクトリを、ファイルシステム内の別の場所にコピーします 以下のことを試みるとエラーが発生します: + +- ディレクトリをそれ自体、またはその子ディレクトリにコピーする場合 +- もしコピー先親ディレクトリがコピー元と同じで、コピー先ディレクトリ名もコピー元と同じである場合 + +ディレクトリーのコピーは常に再帰的で、ディレクトリ内の全ての中身がコピーされます。 + +__パラメーター:__ + +- __parent__: ディレクトリのコピー先の親ディレクトリを表します _(DirectoryEntry)_ +- __newName__: ディレクトリの新しい名前を表します。 もし指定されていない場合は、デフォルトで現在の名前となります _(DOMString)_ +- __successCallback__: 新しいディレクトリの `DirectoryEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ディレクトリのコピー中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + + +__使用例__ + + function win(entry) { + console.log("新しいパス: " + entry.fullPath); + } + + function fail(error) { + alert(error.code); + } + + function copyDir(entry) { + var parent = document.getElementById('parent').value, + parentName = parent.substring(parent.lastIndexOf('/')+1), + newName = document.getElementById('newName').value, + parentEntry = new DirectoryEntry(parentName, parent); + + // ディレクトリを新しいディレクトリにコピーし、名前付け替えます + entry.copyTo(parentEntry, newName, success, fail); + } + + +toURL +----- + +ディレクトリの位置特定に使用できる URL を返します。 + +__使用例__ + + // ディレクトリ URL の取得 + var dirURL = entry.toURL(); + console.log(dirURL); + + +remove +------ + +ディレクトリを削除します。 以下のことを試みるとエラーが発生します: + +- 空でないディレクトリを削除する場合 +- ファイルシステムのルートディレクトリを削除する場合 + +__パラメーター:__ + +- __successCallback__: ディレクトリが削除されたときに呼び出されるコールバック関数を表します。パラメーターなしで呼び出されます _(Function)_ +- __errorCallback__: ディレクトリのコピー中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(entry) { + console.log("削除成功"); + } + + function fail(error) { + alert('ディレクトリの削除中にエラーが発生しました: ' + error.code); + } + + // ディレクトリを削除 + entry.remove(success, fail); + + +getParent +--------- + +そのディレクトリの親 DirectoryEntry を取得します。 + +__パラメーター:__ + +- __successCallback__: ディレクトリの親 `DirectoryEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ファイルの親 `DirectoryEntry` の取得中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(parent) { + console.log("親ディレクトリの名前: " + parent.name); + } + + function fail(error) { + alert('親ディレクトリの取得中にエラーが発生しました: ' + error.code); + } + + // 親 DirectoryEntry を取得 + entry.getParent(success, fail); + + +createReader +------------ + +ディレクトリのエントリを読み込みするための DirectoryReader を作成します。 + +__使用例__ + + // directory reader の作成 + var directoryReader = entry.createReader(); + + +getDirectory +------------ + +ディレクトリを取得または作成します。 以下のことを試みるとエラーが発生します: + +- 親ディレクトリが存在しないディレクトリを作る場合 + +__パラメーター:__ + +- __path__: 取得または作成したいディレクトリまでのパスを表します。 この `DirectoryEntry` からの絶対パスまたは相対パスを指定します _(DOMString)_ +- __options__: もしディレクトリが存在しない場合、作成するかどうかを指定するオプションを表します _(Flags)_ +- __successCallback__: `DirectoryEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ディレクトリの取得または作成中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(parent) { + console.log("親ディレクトリの名前: " + parent.name); + } + + function fail(error) { + alert("新しいディレクトリの作成中にエラーが発生しました: " + error.code); + } + + // 既存のディレクトリを取得。存在しない場合は作成 + entry.getDirectory("newDir", {create: true, exclusive: false}, success, fail); + + +getFile +------- + +ファイルを取得または作成します。 以下のことを試みるとエラーが発生します: + +- 親ディレクトリが存在しないファイルを作る場合 + +__パラメーター:__ + +- __path__: 取得または作成したいファイルまでのパスを表します。 この `DirectoryEntry` からの絶対パスまたは相対パスを指定します _(DOMString)_ +- __options__: もしファイルが存在しない場合、作成するかどうかを指定するオプションを表します _(Flags)_ +- __successCallback__: `FileEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ファイルの取得または作成中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(parent) { + console.log("親ディレクトリの名前: " + parent.name); + } + + function fail(error) { + alert("ファイルの取得中にエラーが発生しました: " + error.code); + } + + // 既存のファイルを取得。存在しない場合は作成 + entry.getFile("newFile.txt", {create: true, exclusive: false}, success, fail); + + +removeRecursively +----------------- + +ディレクトリと、その中身をすべて削除します。 エラーが起きたとき (例: 削除できないファイルが含まれるディレクトリを削除しようとした場合) +ディレクトリのコンテンツのいくつかは削除されている場合があります。 +以下のことを試みるとエラーが発生します: + +- ファイルシステムのルートディレクトリを削除する場合 + +__パラメーター:__ + +- __successCallback__: `DirectoryEntry` が削除されたときに呼び出されるコールバック関数を表します。 パラメーターなしで呼び出されます _(Function)_ +- __errorCallback__: `DirectoryEntry` の削除中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(parent) { + console.log("再帰的な削除成功"); + } + + function fail(error) { + alert("ディレクトリまたはディレクトリの中身の削除中にエラーが発生しました: " + error.code); + } + + // ディレクトリとディレクトリの中身を削除 + entry.removeRecursively(success, fail); + + +BlackBerry に関する注意点 +----------------- + +以下の場合、 `ControlledAccessException` とともにエラーとなります: + +- 前回インストールしたアプリケーションで生成したディレクトリへアクセスしようとした場合 + +> 解決策: 再インストール前に、一時ディレクトリを手動もしくはアプリケーションで消去して下さい。 + +- デバイスがUSB接続されている場合 + +> 解決策: デバイスからUSBケーブルを取り外し、再度実行して下さい。 \ No newline at end of file diff --git a/docs/jp/2.9.0/cordova/file/directoryreader/directoryreader.md b/docs/jp/2.9.0/cordova/file/directoryreader/directoryreader.md new file mode 100755 index 0000000000..dfe0dee488 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/directoryreader/directoryreader.md @@ -0,0 +1,67 @@ +--- +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. +--- + +DirectoryReader +=============== + +ディレクトリの中のファイルとディレクトリをリストアップするオブジェクトです。これは [W3C Directories and Systems](http://www.w3.org/TR/file-system-api/) の仕様書で定義されています。 + +メソッド +------- + +- __readEntries__: ディレクトリの中のエントリを読み込みます + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +readEntries +----------- + +このディレクトリの中のエントリを読み込みます。 + +__パラメーター:__ + +- __successCallback__: `FileEntry` と `DirectoryEntry` オブジェクトの配列を渡すコールバック関数を表します _(Function)_ +- __errorCallback__: ディレクトリリストの取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(entries) { + var i; + for (i=0; i このAPIはW3Cの [File API](http://www.w3.org/TR/FileAPI) をベースとしています。ファイルシステムへの読み書きのための API です。 + +オブジェクト +------- + +- DirectoryEntry +- DirectoryReader +- File +- FileEntry +- FileError +- FileReader +- FileSystem +- FileTransfer +- FileTransferError +- FileUploadOptions +- FileUploadResult +- FileWriter +- Flags +- LocalFileSystem +- Metadata + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + + +#### app/AndroidManifest.xml + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + + +#### www/config.xml + + + + + + access_shared + + +### iOS + +#### config.xml + + + + +### Windows Phone + + パーミッションの設定は必要ありません。 diff --git a/docs/jp/2.9.0/cordova/file/fileentry/fileentry.md b/docs/jp/2.9.0/cordova/file/fileentry/fileentry.md new file mode 100755 index 0000000000..9b0d4b3db7 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/fileentry/fileentry.md @@ -0,0 +1,328 @@ +--- +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. +--- + +FileEntry +========== + +このオブジェクトはファイルシステムのファイルを表します。これは [W3C Directories and Systems](http://www.w3.org/TR/file-system-api/) の仕様書で定義されています。 + +プロパティー +---------- + +- __isFile:__ 常に true を表します _(boolean)_ +- __isDirectory:__ 常に false を表します _(boolean)_ +- __name:__ パスを除いた `FileEntry` の名前を表します _(DOMString)_ +- __fullPath:__ ルートから `FileEntry` への絶対パスを表します _(DOMString)_ + +注意: 以下の属性は W3C の仕様書によって定義されていますが、 Cordova では __サポートされていません__ : + +- __filesystem:__ `FileEntry` が属するファイルシステムを表します _(FileSystem)_ + + +メソッド +------- + +- __getMetadata__: ファイルのメタデータを取得します +- __setMetadata__: ディレクトリのメタデータをセットします +- __moveTo__: ファイルを、ファイルシステム内の別の場所に移動します +- __copyTo__: ファイルを、ファイルシステム内の別の場所にコピーします +- __toURL__: ファイルの位置特定に使用できる URL を返します +- __remove__: ファイルを削除します +- __getParent__: 親ディレクトリを取得します +- __createWriter__: ファイルの書き込みに使用できる `FileWriter` オブジェクトを作成します +- __file__: ファイルプロパティーを含む `File` オブジェクトを作成します + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + + +getMetadata +---------------- + +ファイルのメタデータを取得します。 + +__パラメーター:__ + +- __successCallback__: `Metadata` オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: `Metadata` の取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + + +__使用例__ + + function success(metadata) { + console.log("最終更新日: " + metadata.modificationTime); + } + + function fail(error) { + alert(error.code); + } + + // このエントリーの Metadata オブジェクトを取得 + entry.getMetadata(success, fail); + + +setMetadata +---------------- + +ディレクトリのメタデータをセットします。 + +__現在 iOS のみ対応しています__ - ディレクトリの拡張属性をセットします。 + +__パラメーター:__ + +- __successCallback__: Metadata が正常にセットされたときに呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: Metadata のセット時にエラーが起きた場合に呼び出されるコールバック関数を表します _(Function)_ +- __metadataObject__: Metadata のキーと値が格納されているオブジェクトを表します _(Object)_ + + +__使用例__ + + function success() { + console.log("メタデータが正常にセットされました。"); + } + + function fail() { + alert("メタデータ作成中にエラーが発生しました。"); + } + + // メタデータをセット + entry.setMetadata(success, fail, { "com.apple.MobileBackup": 1}); +__iOS に関する注意点__ + +- `com.apple.MobileBackup` 拡張属性のみサポートされています。値を `1` とセットすることで、ディレクトリを iCloud でバックアップされない設定とします。値を `0` とセットすることで、再度ディレクトリを iCloud でバックアップされる設定とします。 + +__使用例__ + + function setFileMetadata(localFileSystem, filePath, metadataKey, metadataValue) + { + var onSetMetadataWin = function() { + console.log("メタデータが正常にセットされました。") + } + var onSetMetadataFail = function() { + console.log("メタデータ作成中にエラーが発生しました。") + } + + var onGetFileWin = function(parent) { + var data = {}; + data[metadataKey] = metadataValue; + parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data); + } + var onGetFileFail = function() { + console.log("ファイル取得中にエラーが発生しました。") + } + + var onFSWin = function(fileSystem) { + fileSystem.root.getFile(filePath, {create: true, exclusive: false}, onGetFileWin, onGetFileFail); + } + + var onFSFail = function(evt) { + console.log(evt.target.error.code); + } + + window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail); + } + + setFileMetadata(LocalFileSystem.PERSISTENT, "Backups/sqlite.db", "com.apple.MobileBackup", 1); + +moveTo +------ + +ファイルを、ファイルシステム内の別の場所に移動します。 以下のことを試みるとエラーが発生します: + +- もし移動先親ディレクトリが移動元と同じで、移動先ファイル名も移動元と同じである場合 +- もし移動先のファイル名がディレクトリである場合 + +ファイルをすでに存在するファイルの場所に移動する行為は、削除してファイルを置き換える行為となります。 + +__パラメーター:__ + +- __parent__: ファイルの移動先の親ディレクトリを表します _(DirectoryEntry)_ +- __newName__: ファイルの新しい名前を表します。もし指定されていない場合は、デフォルトで現在の名前となります _(DOMString)_ +- __successCallback__: 新しいファイルの `FileEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ファイルの移動中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + + +__使用例__ + + function success(entry) { + console.log("新しいパス: " + entry.fullPath); + } + + function fail(error) { + alert(error.code); + } + + function moveFile(entry) { + var parent = document.getElementById('parent').value, + parentName = parent.substring(parent.lastIndexOf('/')+1), + parentEntry = new DirectoryEntry(parentName, parent); + + // ファイルを新しいディレクトリに移動し、名前付け替えます + entry.moveTo(parentEntry, "newFile.txt", success, fail); + } + + +copyTo +------ + +ファイルを、ファイルシステム内の別の場所にコピーします。以下のことを試みるとエラーが発生します: + +- もしコピー先親ディレクトリがコピー元と同じで、コピー先ファイル名もコピー元と同じである場合 + +__パラメーター:__ + +- __parent__: ファイルのコピー先の親ディレクトリを表します _(DirectoryEntry)_ +- __newName__: ファイルの新しい名前を表します。もし指定されていない場合は、デフォルトで現在の名前となります _(DOMString)_ +- __successCallback__: 新しいファイルの `FileEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ファイルのコピー中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + + +__使用例__ + + function win(entry) { + console.log("新しいパス: " + entry.fullPath); + } + + function fail(error) { + alert(error.code); + } + + function copyFile(entry) { + var parent = document.getElementById('parent').value, + parentName = parent.substring(parent.lastIndexOf('/')+1), + parentEntry = new DirectoryEntry(parentName, parent); + + // ファイルを新しいディレクトリにコピーし、名前付け替えます + entry.copyTo(parentEntry, "file.copy", success, fail); + } + + +toURL +----- + +ファイルの位置特定に使用できる URL を返します。 + +__使用例__ + + // このエントリーの URL を取得 + var fileURL = entry.toURL(); + console.log(fileURL); + + +remove +------ + +ファイルを削除します。 + +__パラメーター:__ + +- __successCallback__: ファイルが削除されたときに呼び出されるコールバック関数を表します。 パラメーターなしで呼び出されます _(Function)_ +- __errorCallback__: ファイルの削除中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(entry) { + console.log("削除成功"); + } + + function fail(error) { + alert('ファイルの削除に失敗しました: ' + error.code); + } + + // ファイルの削除 + entry.remove(success, fail); + + +getParent +--------- + +そのファイルの親 `DirectoryEntry` を取得します。 + +__パラメーター:__ + +- __successCallback__: ファイルの親 `DirectoryEntry` を伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: ファイルの親 `DirectoryEntry` の取得中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(parent) { + console.log("親ディレクトリの名前: " + parent.name); + } + + function fail(error) { + alert(error.code); + } + + // 親 DirectoryEntry を取得 + entry.getParent(success, fail); + + +createWriter +------------ + +`FileEntry` の表すファイルに使われる `FileWriter` オブジェクトを作成します。 + +__パラメーター:__ + +- __successCallback__: `FileWriter` オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: `FileWriter` の作成中にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(writer) { + writer.write("ファイルに書き込むテキスト"); + } + + function fail(error) { + alert(error.code); + } + + // ファイルへの書き込みのための FileWriter を作成 + entry.createWriter(success, fail); + + +file +---- + +`FileEntry` の表すファイルの現在の状態を表す `File` オブジェクトを返します。 + +__パラメーター:__ + +- __successCallback__: `File` オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: `File` オブジェクト作成中にエラーが起きた場合に呼び出されるコールバック関数を表します (例: 元のファイルが既に存在しない場合) 。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ + +__使用例__ + + function success(file) { + console.log("File サイズ: " + file.size); + } + + function fail(error) { + alert("ファイルのプロパティーを取得できませんでした: " + error.code); + } + + // ファイルのプロパティーを取得 + entry.file(success, fail); diff --git a/docs/jp/2.9.0/cordova/file/fileerror/fileerror.md b/docs/jp/2.9.0/cordova/file/fileerror/fileerror.md new file mode 100755 index 0000000000..04358bf526 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/fileerror/fileerror.md @@ -0,0 +1,49 @@ +--- +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. +--- + +FileError +======== + +`FileError` オブジェクトはエラーが発生した際に File API のメソッドに渡されます。 + +プロパティー +---------- + +- __code__: 事前に定義された以下のエラーコードのうちの1つを表します + +定数 +--------- + +- `FileError.NOT_FOUND_ERR` +- `FileError.SECURITY_ERR` +- `FileError.ABORT_ERR` +- `FileError.NOT_READABLE_ERR` +- `FileError.ENCODING_ERR` +- `FileError.NO_MODIFICATION_ALLOWED_ERR` +- `FileError.INVALID_STATE_ERR` +- `FileError.SYNTAX_ERR` +- `FileError.INVALID_MODIFICATION_ERR` +- `FileError.QUOTA_EXCEEDED_ERR` +- `FileError.TYPE_MISMATCH_ERR` +- `FileError.PATH_EXISTS_ERR` + +概要 +----------- + +`FileError` オブジェクトは File API のあらゆるエラーコールバック関数への唯一のパラメーターです。エラーのタイプを特定する場合、 `code` プロパティーを上記の定数と比較して下さい。 diff --git a/docs/jp/2.9.0/cordova/file/fileobj/fileobj.md b/docs/jp/2.9.0/cordova/file/fileobj/fileobj.md new file mode 100755 index 0000000000..2c6952e90d --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/fileobj/fileobj.md @@ -0,0 +1,78 @@ +--- +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. +--- + +File +==== + +このオブジェクトは一つのファイルの属性を含みます。 + +プロパティー +---------- + +- __name__: ファイルの名前を表します。 _(DOMString)_ +- __fullPath__: ファイルの名前を含むフルパスを表します。 _(DOMString)_ +- __type__: ファイルの MIME 型を表します。 _(DOMString)_ +- __lastModifiedDate__: ファイルの最終更新日時を表します。 _(Date)_ +- __size__: ファイルのサイズをバイトで表します。 _(long)_ + +メソッド +------- + +- __slice__: ファイルの一部分のみを選択し、読み込めるようにします。 + +詳細 +------- + +この `File` オブジェクトは一つのファイルの属性を含みます。 `FileEntry` オブジェクトの `file()` メソッドを呼び出すことで、 `File` オブジェクトのインスタンスを取得できます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +slice +-------------- + +新しい `File` オブジェクトを返します。 このオブジェクトを `FileReader` に渡すと、元のファイルの特定の部分だけを読み込みます。 `start` もしくは `end` パラメータに負の値を設定すると、読み込み開始もしくは終了位置をファイルの最後から指定できます。各インデクスには現在の slice からの相対的な位置を指定します。(下記の詳細な使用例を参照のこと) + +__パラメータ:__ + +- __start__: 何バイト目から読み込み始めるか指定します (`start`バイト目から読み込みます)。 +- __end__: 何バイト目の直前まで読み込むか指定します (`end - 1`バイト目まで読み込みます)。 + +__使用例__ + + var slicedFile = file.slice(10, 30); + +__詳細な使用例__ + + var slice1 = file.slice(100, 400); + var slice2 = slice1.slice(20, 35); + + var slice3 = file.slice(120, 135); + // slice2 と slice3 の内容は同じです + +__Supported Platforms__ + +- Android +- iOS diff --git a/docs/jp/2.9.0/cordova/file/filereader/filereader.md b/docs/jp/2.9.0/cordova/file/filereader/filereader.md new file mode 100755 index 0000000000..266c85c67a --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/filereader/filereader.md @@ -0,0 +1,256 @@ +--- +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. +--- + +FileReader +========== + +FileReader はファイルの読み込みを行うオブジェクトです。 + +プロパティー +---------- + +- __readyState__: 右の3種類の状態のいずれかを表します (`EMPTY`, `LOADING`, `DONE`) +- __result__: 読み込まれたファイルのコンテンツを表します _(DOMString)_ +- __error__: エラー情報を表します _(FileError)_ +- __onloadstart__: 読み込み開始時に呼ばれる関数を表します _(Function)_ +- __onload__: 読み込みが成功したときに呼ばれる関数を表します _(Function)_ +- __onabort__: abort() メソッドを実行したときなど、 読み込みが強制終了したときに呼ばれる関数を表します _(Function)_ +- __onerror__: 読み込みが失敗したときに呼ばれる関数を表します _(Function)_ +- __onloadend__: 成功、失敗にかかわらずリクエストが完了した際に呼ばれる関数を表します _(Function)_ + +__注意:__ 以下のプロパティはサポートされていません: + +- __onprogress__: 読込中に呼ばれ、進捗状況を報告する関数を表します (progess.loaded/progress.total) _(Function)_ + +メソッド +------- + +- __abort__: 読み込みを強制終了します +- __readAsDataURL__: ファイルを読み込み、データを Base64 エンコードされたデータ URL で返します +- __readAsText__: テキストファイルを読み込みます +- __readAsBinaryString__: ファイルをバイナリとして読み込み、バイナリ文字列を返します +- __readAsArrayBuffer__: `ArrayBuffer` としてファイルを読み込みます + +詳細 +------- + +`FileReader` オブジェクトはデバイスのファイルシステムからファイルを読み込む際に使用します。ファイルはテキストもしくは Base64 でエンコードされた文字列として読み込まれます。また、 `loadstart`, `progress`, `load`, `loadend`, `error` や `abort` などのイベントを受け取るための独自のイベントリスナーを登録することも出来ます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +データ URL として読み込む場合 +---------------- + +__パラメーター:__ +- __file__: 読み込むファイルのフルパスを表します + + +使用例 +------------- + + function win(file) { + var reader = new FileReader(); + reader.onloadend = function(evt) { + console.log("読み込み成功"); + console.log(evt.target.result); + }; + reader.readAsDataURL(file); + }; + + var fail = function(error) { + console.log(error.code); + }; + + entry.file(win, fail); + +テキストとして読み込む場合 +------------ + +__パラメーター:__ + +- __file__: 読み込むファイルのフルパスを表します +- __encoding__: ファイルのコンテンツのエンコードを表します (デフォルト: UTF-8) + +使用例 +------------- + + function win(file) { + var reader = new FileReader(); + reader.onloadend = function(evt) { + console.log("読み込み成功"); + console.log(evt.target.result); + }; + reader.readAsText(file); + }; + + var fail = function(error) { + console.log(error.code); + }; + + entry.file(win, fail); + +Abort の例 +------------------- + + function win(file) { + var reader = new FileReader(); + reader.onloadend = function(evt) { + console.log("読み込み成功"); + console.log(evt.target.result); + }; + reader.readAsText(file); + reader.abort(); + }; + + function fail(error) { + console.log(error.code); + } + + entry.file(win, fail); + +詳細な使用例 +------------ + + + + + FileReader の使用例 + + + + + +

使用例

+

ファイルを読み込みます。

+ + + +iOS に関する注意点 +---------- +- __encoding__ パラメーターはサポートされておらず、常に UTF-8 エンコーディングが使われます。 + +Binary 文字列として読み込む +--------------------- + +現在 iOS と Android でのみサポートされています。 + +__パラメータ:__ + +- __file__: 読み込む file オブジェクト + +使用例 +------------- + + function win(file) { + var reader = new FileReader(); + reader.onloadend = function (evt) { + console.log("read success"); + console.log(evt.target.result); + }; + reader.readAsBinaryString(file); + }; + + var fail = function (evt) { + console.log(error.code); + }; + + entry.file(win, fail); + +Array Buffer として読み込む +-------------------- + +現在 iOS と Android でのみサポートされています。 + +__パラメータ:__ + +- __file__: 読み込む file オブジェクト + +使用例 +------------- + + function win(file) { + var reader = new FileReader(); + reader.onloadend = function (evt) { + console.log("read success"); + console.log(new Uint8Array(evt.target.result)); + }; + reader.readAsArrayBuffer(file); + }; + + var fail = function (evt) { + console.log(error.code); + }; + + entry.file(win, fail); diff --git a/docs/jp/2.9.0/cordova/file/filesystem/filesystem.md b/docs/jp/2.9.0/cordova/file/filesystem/filesystem.md new file mode 100755 index 0000000000..e0a0176691 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/filesystem/filesystem.md @@ -0,0 +1,92 @@ +--- +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. +--- + +FileSystem +========== + +このオブジェクトはファイルシステムを表します。 + +プロパティー +---------- + +- __name__: ファイルシステムの名前を表します _(DOMString)_ +- __root__: ファイルシステムのルートディレクトリを表します _(DirectoryEntry)_ + +詳細 +------- + +`FileSystem` オブジェクトはファイルシステムの情報を表します。ファイルシステムの名前は既にあるファイルシステムに対して一意になります。 root プロパティーはファイルシステムのルートディレクトリを表す `DirectoryEntry` オブジェクトを保持します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +File System の使用例 +------------------------- + + function onSuccess(fileSystem) { + console.log(fileSystem.name); + console.log(fileSystem.root.name); + } + + // ファイルシステムをリクエスト + window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, null); + +詳細な使用例 +------------ + + + + + File System の使用例 + + + + + +

Example

+

File System

+ + diff --git a/docs/jp/2.9.0/cordova/file/filetransfer/filetransfer.md b/docs/jp/2.9.0/cordova/file/filetransfer/filetransfer.md new file mode 100755 index 0000000000..9773e0baef --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/filetransfer/filetransfer.md @@ -0,0 +1,295 @@ +--- +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. +--- + +FileTransfer +========== + +`FileTransfer` オブジェクトはファイルをサーバーにアップロードまたはサーバからダウンロードする際に使用します。 + +プロパティー +---------- + +- __onprogress__: `ProgressEvent` とともに、新しいデーターの塊が転送される度に呼び出される関数を表します _(Function)_ + +メソッド +------- + +- __upload__: サーバーにファイルを送信します +- __download__: サーバーからファイルをダウンロードします +- __abort__: 進行中の転送を中止します + +詳細 +------- + +`FileTransfer` オブジェクトは HTTP マルチパート POST リクエストを使ってファイルをサーバーにアップロードする機能を提供します。このメソッドは HTTP と HTTPS の両方のプロトコルをサポートします。 `upload()` メソッドに `FileUploadOptions` オブジェクトを渡すことで、任意のパラメーターを追加できます。アップロードが成功した場合 `FileUploadResult` オブジェクトとともに success コールバック関数が呼ばれます。エラーが発生した場合は `FileTransferError` オブジェクトとともに error コールバック関数が呼ばれます。また、サーバーからファイルをダウンロードし保存することもできます (iOS と Android のみ) 。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +upload +-------------- + +__パラメーター:__ + +- __filePath__: デバイス内のファイルのフルパスを表します +- __server__: ファイルを受け取るサーバーの URL を表します (`encodeURI()` を使用して既にエンコードされている必要があります) +- __successCallback__: `Metadata` オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__: `Metadata` の取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ +- __options__ - ファイル名や minetype などのオプションのパラメーターを表します +- __trustAllHosts__: オプションのパラメータで、デフォルトは `false` です。 `true` に設定すると、あらゆるセキュリティ証明書を受け入れます。 Android は自己証明書を拒否するため、この機能は便利です。ただ、製品版では非推奨です。 Android と iOS でのみサポートしています。 _(boolean)_ + +__使用例__ + + // !! fileURI の値は有効なデバイス内の有効なテキストファイルの URI であるとみなします + + var win = function(r) { + console.log("コード = " + r.responseCode); + console.log("結果 = " + r.response); + console.log("送信バイト数 = " + r.bytesSent); + } + + var fail = function(error) { + alert("エラーが発生しました: Code = " + error.code); + console.log("upload error source " + error.source); + console.log("upload error target " + error.target); + } + + var options = new FileUploadOptions(); + options.fileKey="file"; + options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1); + options.mimeType="text/plain"; + + var params = {}; + params.value1 = "test"; + params.value2 = "param"; + + options.params = params; + + var ft = new FileTransfer(); + ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options); + +__詳細な使用例__ + + + + + File Transfer の使用例 + + + + + +

使用例

+

ファイルアップロード

+ + + +__アップロードヘッダーの設定__ + +Android と iOS でサポートされています。 + + function win(r) { + console.log("コード = " + r.responseCode); + console.log("結果 = " + r.response); + console.log("送信バイト数 = " + r.bytesSent); + } + + function fail(error) { + alert("エラーが発生しました: Code = " + error.code); + console.log("upload error source " + error.source); + console.log("upload error target " + error.target); + } + + var uri = encodeURI("http://some.server.com/upload.php"); + + var options = new FileUploadOptions(); + options.fileKey="file"; + options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1); + options.mimeType="text/plain"; + + var params = {}; + params.headers={'headerParam':'headerValue'}; + + options.params = params; + + var ft = new FileTransfer(); + ft.upload(fileURI, uri, win, fail, options); + +__Android に関する注意点__ + +Nginx サーバーへのアップロードで問題が発生した場合は、 `chunkedMode` オプションを `false` に設定して下さい。 + +download +-------------- + +__パラメーター:__ + +- __source__ - ファイルを取得するサーバーの URL を表します (`encodeURI()` を使用して既にエンコードされている必要があります) +- __target__ - デバイス内のファイルのフルパスを表します +- __successCallback__ - `FileEntry` オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_ +- __errorCallback__ - `Metadata` の取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 `FileError` オブジェクトを伴って呼び出されます _(Function)_ +- __trustAllHosts__: オプションのパラメータで、デフォルトは `false` です。 `true` に設定すると、あらゆるセキュリティ証明書を受け入れます。 Android は自己証明書を拒否するため、この機能は便利です。ただ、製品版では非推奨です。 Android と iOS でのみサポートしています。 _(boolean)_ +- __options__: オプションのパラメータで、現在は headers のみサポートしています ( Basic 認証の Authorization など)。 + +__使用例__ + + // !! filePath がデバイス内の有効な値であるとみなします + + var fileTransfer = new FileTransfer(); + var uri = encodeURI("http://some.server.com/download.php"); + + fileTransfer.download( + url, + filePath, + function(entry) { + console.log("ダウンロード完了: " + entry.fullPath); + }, + function(error) { + console.log("download error source " + error.source); + console.log("download error target " + error.target); + console.log("upload error code" + error.code); + }, + false, + { + headers: { + "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" + } + } + ); + +abort +-------------- + +進行中の転送を中止します。 FileTransferError.ABORT_ERR エラーコードを持つ FileTransferError オブジェクトを伴って onerror コールバックが呼び出されます。 + +__サポートされているプラットフォーム__ + +- Android +- iOS + +__使用例__ + + // !! fileURIがデバイス内の有効な値であるとみなします + + var win = function(r) { + console.log("Code = " + r.responseCode); + console.log("Response = " + r.response); + console.log("Sent = " + r.bytesSent); + } + + var fail = function(error) { + alert("An error has occurred: Code = " + error.code); + console.log("upload error source " + error.source); + console.log("upload error target " + error.target); + } + + var options = new FileUploadOptions(); + options.fileKey="file"; + options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1); + options.mimeType="text/plain"; + + var params = {}; + params.value1 = "test"; + params.value2 = "param"; + + options.params = params; + + var ft = new FileTransfer(); + ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options); + ft.abort(win, fail); + +onprogress +-------------- + +ProgressEvent とともに、新しいデーターの塊が転送される度に呼び出されます。 + +__サポートされているプラットフォーム__ + +- Android +- iOS + +__使用例__ + + fileTransfer.onprogress = function(progressEvent) { + if (progressEvent.lengthComputable) { + loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total); + } else { + loadingStatus.increment(); + } + }; + fileTransfer.download(...); // または fileTransfer.upload(...); + +__注意点__ +- Android と iOS の両方で、 gzip エンコーディングを用いるダウンロードの際には lengthComputable が false になります。 diff --git a/docs/jp/2.9.0/cordova/file/filetransfererror/filetransfererror.md b/docs/jp/2.9.0/cordova/file/filetransfererror/filetransfererror.md new file mode 100755 index 0000000000..418ce92348 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/filetransfererror/filetransfererror.md @@ -0,0 +1,44 @@ +--- +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. +--- + +FileTransferError +======== + +`FileTransferError` オブジェクトは、エラーが発生したときエラーコールバック関数に渡されます。 + +プロパティー +---------- + +- __code__: 事前に定義された以下のエラーコードのうちの1つを表します (Number) +- __source__: ソースの URI を表します (String) +- __target__: ターゲットの URI を表します (String) +- __http_status__: HTTP のステータスコードを表します。この属性は、レスポンスコードが HTTP コネクションから返されたときのみ有効です (Number) + +定数 +--------- + +- `FileTransferError.FILE_NOT_FOUND_ERR` +- `FileTransferError.INVALID_URL_ERR` +- `FileTransferError.CONNECTION_ERR` +- `FileTransferError.ABORT_ERR` + +概要 +----------- + +`FileTransferError` オブジェクトは、ファイルアップロードまたはダウンロード時にエラーが発生したときエラーコールバック関数に渡されます。 diff --git a/docs/jp/2.9.0/cordova/file/fileuploadoptions/fileuploadoptions.md b/docs/jp/2.9.0/cordova/file/fileuploadoptions/fileuploadoptions.md new file mode 100755 index 0000000000..2f865737be --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/fileuploadoptions/fileuploadoptions.md @@ -0,0 +1,44 @@ +--- +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. +--- + +FileUploadOptions +======== + +`FileUploadOptions` オブジェクトは upload メソッドを実行する際に FileTransfer オブジェクトに渡して、追加のパラメーターとして設定する場合に使用します。 + +プロパティー +---------- + +- __fileKey__: フォーム要素の名前を指定します。 デフォルトは `file` です (DOMString) +- __fileName__: サーバーに保存する際のファイル名を指定します。 デフォルトは `image.jpg` です (DOMString) +- __mimeType__: データの MIME 形式を指定します。 デフォルトは `image/jpeg` です (DOMString) +- __params__: その他の HTTP リクエストで送信されるパラメーターを指定します (Object) +- __chunkedMode__: アップロードにチャンクドストリーミングモードを使用するかを指定します。 デフォルトは `true` です (Boolean) +- __headers__: ヘッダー名 => ヘッダー値の Map を指定します。ヘッダーへ複数の値を設定するには、配列を使用します (Object) + + +概要 +----------- + +`FileUploadOptions` オブジェクトは `upload()` メソッドを実行する際に `FileTransfer` オブジェクトに渡して、追加のパラメーターとして設定する場合に使用します。 + +WP7 に関する注意点 +--------- + +- __chunkedMode__: WP7 ではこの値は無視されます。 diff --git a/docs/jp/2.9.0/cordova/file/fileuploadresult/fileuploadresult.md b/docs/jp/2.9.0/cordova/file/fileuploadresult/fileuploadresult.md new file mode 100755 index 0000000000..0573124951 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/fileuploadresult/fileuploadresult.md @@ -0,0 +1,39 @@ +--- +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. +--- + +FileUploadResult +======== + +`FileUploadResult` オブジェクトは、 `FileTransfer` の `upload()` メソッドの呼び出しが成功した時に、成功コールバック関数に渡されるオブジェクトです。 + +プロパティー +---------- + +- __bytesSent__: 送信されたバイト数を表します (long) +- __responseCode__: サーバーから返された HTTP のレスポンスコードを表します (long) +- __response__: サーバーから返された HTTP のレスポンスを表します (DOMString) + +概要 +----------- + +`FileUploadResult` オブジェクトは、 `FileTransfer` の `upload()` メソッドの呼び出しが成功した時に、成功コールバック関数に渡されるオブジェクトです。 + +iOS に関する注意点 +---------- +- `responseCode` も `bytesSent` もサポートしていません。 diff --git a/docs/jp/2.9.0/cordova/file/filewriter/filewriter.md b/docs/jp/2.9.0/cordova/file/filewriter/filewriter.md new file mode 100755 index 0000000000..133cb7e59d --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/filewriter/filewriter.md @@ -0,0 +1,227 @@ +--- +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. +--- + +FileWriter +========== + +ファイルへの書き込みを行うオブジェクトです。 + +プロパティー +---------- + +- __readyState__: 右の3種類の状態のいずれかを表します (`INIT`, `WRITING`, `DONE`) +- __fileName__: 書き込みの対象となるファイル名を表します _(DOMString)_ +- __length__: 書き込みの対象となるファイル名を表します _(long)_ +- __position__: ファイルポインタの現在の位置を表します _(long)_ +- __error__: エラー情報を表します _(FileError)_ +- __onwritestart__: 書き込み開始時に呼ばれる関数を表します _(Function)_ +- __onwrite__: リクエストが成功したときに呼ばれる関数を表します _(Function)_ +- __onabort__: abort() メソッドを実行したときなど、 書き込みが強制終了したときに呼ばれる関数を表します _(Function)_ +- __onerror__: 書き込みが失敗したときに呼ばれる関数を表します _(Function)_ +- __onwriteend__: 成功、失敗にかかわらずリクエストが完了した際に呼ばれる関数を表します _(Function)_ + +以下のプロパティはサポートされていません: + +- __onprogress__: ファイル書き込み中に呼ばれ、進捗状況を報告する関数を表します (progess.loaded/progress.total) _(Function)_ - 現在サポートされていません + +メソッド +------- + +- __abort__: 書き込みを中断します +- __seek__: ファイルポインタを指定したバイトまで移動します +- __truncate__: ファイルを指定した長さに切り詰めます +- __write__: ファイルにデータを書き込みます + +詳細 +------- + +`FileWriter` オブジェクトはデバイスのファイルシステムに UTF-8 で書きこむ際に使用します。また、 `writestart`, `progress`, `write`, `writeend`, `error` や `abort` などのイベントを受け取るための独自のイベントリスナーを登録することも出来ます。 + +各 `FileWriter` は一つのファイルに対して使用されます。複数回の書き込みを行うこともできます。 `FileWriter` はファイルポインタの位置と `length` 属性を指定することができるので、ファイルのどの位置からでも書き込みを行うことができます。デフォルトではファイルの開始位置にポインタがセットされ、既存のデータを上書きしながら書き込みが行われます。書き込みをファイルの最終から始める場合は、 FileWriter のコンストラクタに `true` をオプションとして指定してください。 + +テキストデータは以下のプラットーフォーム上でサポートされています。テキストはファイルシステムに書き込まれる前に UTF-8 としてエンコードされます。いくつかのプラットフォームではバイナリデータをサポートしており、 ArrayBuffer や Blob で書き込めます。 + +サポートされているプラットフォーム +------------------- + +### テキストとバイナリをサポートしているプラットフォーム + +- Android +- iOS + +### テキストのみサポートしているプラットフォーム + +- BlackBerry WebWorks (OS 5.0 以上) +- Windows Phone 7 and 8 +- Windows 8 + +Seek の例 +------------------------------ + + function win(writer) { + // ファイルポインタを EOF (ファイルの終端) に移動 + writer.seek(writer.length); + }; + + var fail = function(error) { + console.log(error.code); + }; + + entry.createWriter(win, fail); + +Truncate の例 +-------------------------- + + function win(writer) { + writer.truncate(10); + }; + + var fail = function(error) { + console.log(error.code); + }; + + entry.createWriter(win, fail); + +Write の例 +------------------- + + function win(writer) { + writer.onwrite = function(evt) { + console.log("書き込み成功"); + }; + writer.write("サンプルテキスト"); + }; + + var fail = function(error) { + console.log(error.code); + }; + + entry.createWriter(win, fail); + +バイナリ書き込みの例 +-------------------------- + + function win(writer) { + var data = new ArrayBuffer(5), + dataView = new Int8Array(data); + for (i=0; i < 5; i++) { + dataView[i] = i; + } + writer.onwrite = function(evt) { + console.log("write success"); + }; + writer.write(data); + }; + + var fail = function(evt) { + console.log(error.code); + }; + + entry.createWriter(win, fail); + + +Append の例 +-------------------- + + function win(writer) { + writer.onwrite = function(evt) { + console.log("書き込み成功"); + }; + writer.seek(writer.length); + writer.write("付加テキスト); + }; + + var fail = function(error) { + console.log(error.code); + }; + + entry.createWriter(win, fail); + +Abort の例 +------------------- + + function win(writer) { + writer.onwrite = function(evt) { + console.log("書き込み成功"); + }; + writer.write("サンプルテキスト"); + writer.abort(); + }; + + var fail = function(error) { + console.log(error.code); + }; + + entry.createWriter(win, fail); + +詳細な使用例 +------------ + + + + FileWriter の使用例 + + + + + +

使用例

+

ファイルに書き込みます。

+ + diff --git a/docs/jp/2.9.0/cordova/file/flags/flags.md b/docs/jp/2.9.0/cordova/file/flags/flags.md new file mode 100755 index 0000000000..fe8caf2c62 --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/flags/flags.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. +--- + +Flags +===== + +このオブジェクトは、 `DirectoryEntry` の `getFile()` メソッドと `getDirectory()` メソッド (ファイルやディレクトリを取得または作成するメソッド) に渡される引数として使われます。 + +プロパティー +---------- + +- __create__: もし対象のファイルまたはディレクトリが無かった場合、作成するかどうかを表します _(boolean)_ +- __exclusive__: このプロパティー単体では効果はありません。 create プロパティーと一緒に使います。もし対象のパスが既に存在した場合は、取得するのではなくファイルまたはディレクトリの作成に失敗します _(boolean)_ + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // data ディレクトリを取得します。もし存在しない場合は、作成します + dataDir = fileSystem.root.getDirectory("data", {create: true}); + + // lockfile.txt ファイルを、存在しない場合のみ作成します + lockFile = dataDir.getFile("lockfile.txt", {create: true, exclusive: true}); diff --git a/docs/jp/2.9.0/cordova/file/localfilesystem/localfilesystem.md b/docs/jp/2.9.0/cordova/file/localfilesystem/localfilesystem.md new file mode 100755 index 0000000000..6efd4585ba --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/localfilesystem/localfilesystem.md @@ -0,0 +1,111 @@ +--- +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. +--- + +LocalFileSystem +=============== + +このオブジェクトは、ファイルシステムのルートの取得方法を提供します。 + +メソッド +---------- + +- __requestFileSystem__: ファイルシステムをリクエストします _(Function)_ +- __resolveLocalFileSystemURI__: ローカル URI を使用して `DirectoryEntry` または `FileEntry` を取得します _(Function)_ + +定数 +--------- + +- `LocalFileSystem.PERSISTENT`: アプリやユーザーの許可なしに、ユーザエージェントのみでは削除されないような永続的なストレージを表します +- `LocalFileSystem.TEMPORARY`: 永続性が保証されていないようなストレージを表します + +詳細 +------- + +`LocalFileSystem` オブジェクトのメソッドは `window` オブジェクトに定義されています。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +Request File Systemの使用例 +--------------------------------- + + function onSuccess(fileSystem) { + console.log(fileSystem.name); + } + + // ファイルシステムをリクエスト + window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError); + +Resolve Local File System URIの使用例 +------------------------------------------- + + function onSuccess(fileEntry) { + console.log(fileEntry.name); + } + + window.resolveLocalFileSystemURI("file:///example.txt", onSuccess, onError); + +詳細な使用例 +------------ + + + + + + Local File System の使用例 + + + + + +

使用例

+

Local File System

+ + diff --git a/docs/jp/2.9.0/cordova/file/metadata/metadata.md b/docs/jp/2.9.0/cordova/file/metadata/metadata.md new file mode 100755 index 0000000000..5f5b395ede --- /dev/null +++ b/docs/jp/2.9.0/cordova/file/metadata/metadata.md @@ -0,0 +1,52 @@ +--- +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. +--- + +Metadata +========== + +ファイルやディレクトリの状態を提供します。 + +プロパティー +---------- + +- __modificationTime__: ファイルまたはディレクトリの最終更新日時を表します _(Date)_ + +詳細 +------- + +`Metadata` オブジェクトは、ファイルやディレクトリの状態を表します。 `DirectoryEntry` または `FileEntry` の `getMetadata()` メソッドを呼び出すことで、 `Metadata` オブジェクトが取得できます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + function win(metadata) { + console.log("最終更新日: " + metadata.modificationTime); + } + + // このエントリーの Metadata オブジェクトを取得 + entry.getMetadata(win, null); diff --git a/docs/jp/2.9.0/cordova/geolocation/Coordinates/coordinates.md b/docs/jp/2.9.0/cordova/geolocation/Coordinates/coordinates.md new file mode 100755 index 0000000000..27cc774458 --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/Coordinates/coordinates.md @@ -0,0 +1,125 @@ +--- +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. +--- + +Coordinates +=========== + +位置情報で使用される座標を格納します。 + +プロパティー +---------- + +* __latitude__: 緯度を数値で表します _(Number)_ +* __longitude__: 経度を数値で表します _(Number)_ +* __altitude__: 海抜からの高度をメートル単位で表します _(Number)_ +* __accuracy__: 位置の精度をメートル単位で表します _(Number)_ +* __altitudeAccuracy__: 高度の精度をメートル単位で表します _(Number)_ +* __heading__: 北から時計回りでのデバイスの方位を角度で表します _(Number)_ +* __speed__: 現在のデバイスのスピードをメートル/秒で表します _(Number)_ + +概要 +----------- + +`Coordinates` オブジェクトは `Position` オブジェクトのプロパティーとして作成されます。 `Position` オブジェクトは、現在地を取得する際に、コールバック関数を通してユーザーに返されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // 成功時のコールバック関数 + // + var onSuccess = function(position) { + alert('緯度: ' + position.coords.latitude + '\n' + + '経度: ' + position.coords.longitude + '\n' + + '高度: ' + position.coords.altitude + '\n' + + '位置精度: ' + position.coords.accuracy + '\n' + + '高度精度: ' + position.coords.altitudeAccuracy + '\n' + + '方位: ' + position.coords.heading + '\n' + + '速度: ' + position.coords.speed + '\n' + + 'タイムスタンプ: ' + position.timestamp + '\n'); + }; + + // エラー時のコールバック関数 + // + var onError = function() { + alert('エラーが発生しました。'); + }; + + navigator.geolocation.getCurrentPosition(onSuccess, onError); + +詳細な使用例 +------------ + + + + + 位置情報の使用例 + + + + +
+ + + +Android に関する注意点 +------------- + +このプロパティーは Android ではサポートされておらず、常に null を返します。 diff --git a/docs/jp/2.9.0/cordova/geolocation/Position/position.md b/docs/jp/2.9.0/cordova/geolocation/Position/position.md new file mode 100755 index 0000000000..3e9c5cbb5b --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/Position/position.md @@ -0,0 +1,118 @@ +--- +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. +--- + +Position +======== + +geolocation API によって作成された位置情報 (`Position`) とタイムスタンプとを扱うオブジェクトです。 + +プロパティー +---------- + +- __coords__: 地理座標を表します _(Coordinates)_ +- __timestamp__: `coords` のタイムスタンプ値を表します _(Date)_ + +概要 +----------- + +`Position` オブジェクトは Cordova によって作られ、コールバック関数を通してユーザーに返されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // 成功時のコールバック関数 + // + var onSuccess = function(position) { + alert('緯度: ' + position.coords.latitude + '\n' + + '経度: ' + position.coords.longitude + '\n' + + '高度: ' + position.coords.altitude + '\n' + + '位置精度: ' + position.coords.accuracy + '\n' + + '高度精度: ' + position.coords.altitudeAccuracy + '\n' + + '方位: ' + position.coords.heading + '\n' + + '速度: ' + position.coords.speed + '\n' + + 'タイムスタンプ: ' + position.timestamp + '\n'); + }; + + // エラー時のコールバック関数は PositionError オブジェクトを受けとる + // + function onError(error) { + alert('コード: ' + error.code + '\n' + + 'メッセージ: ' + error.message + '\n'); + } + + navigator.geolocation.getCurrentPosition(onSuccess, onError); + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

位置情報を取得中...

+ + diff --git a/docs/jp/2.9.0/cordova/geolocation/PositionError/positionError.md b/docs/jp/2.9.0/cordova/geolocation/PositionError/positionError.md new file mode 100755 index 0000000000..244d5fb5a4 --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/PositionError/positionError.md @@ -0,0 +1,53 @@ +--- +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. +--- + +PositionError +======== + +`PositionError` オブジェクトは、エラーが発生したときに `geolocationError` コールバック関数に渡されます。 + +プロパティー +---------- + +- __code__: 事前に定義された以下のエラーコードのうちの1つを表します +- __message__: エラーの内容を表すエラーメッセージを表します + +定数 +--------- + +- `PositionError.PERMISSION_DENIED` +- `PositionError.POSITION_UNAVAILABLE` +- `PositionError.TIMEOUT` + +概要 +----------- + +`PositionError` オブジェクトは、位置情報取得に関するエラーが発生したときに `geolocationError` コールバック関数を通してユーザーに返されます。 + +### `PositionError.PERMISSION_DENIED` + +ユーザーがアプリケーションに対して、位置情報の取得を許可しなかった場合に返されます。これはプラットフォームに依存します。 + +### `PositionError.POSITION_UNAVAILABLE` + +デバイスが位置を取得できなかった場合に返されます。大抵、これはデバイスがネットワークに接続されていない、および/または衛生情報が取得出来なかったことを意味します。 + +### `PositionError.TIMEOUT` + +デバイスが、 `geolocationOptions` の `timeout` プロパティーによって指定された時間内に位置が取得できなかった場合に返されます。 `geolocation.watchPosition` と一緒に使用するとき、`geolocationError` コールバックが `timeout` ミリ秒ごとに呼び出される可能性があります。 diff --git a/docs/jp/2.9.0/cordova/geolocation/geolocation.clearWatch.md b/docs/jp/2.9.0/cordova/geolocation/geolocation.clearWatch.md new file mode 100755 index 0000000000..922e66172d --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/geolocation.clearWatch.md @@ -0,0 +1,117 @@ +--- +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. +--- + +geolocation.clearWatch +====================== + +`watchID` パラメーターによって参照されるデバイスの位置情報の監視を停止します。 + + navigator.geolocation.clearWatch(watchID); + +パラメーター +---------- + +- __watchID:__ `watchPosition` 関数での監視を停止したい `watchID` を表します (String) + +概要 +----------- + +`geolocation.clearWatch` 関数は、 `watchID` によって参照される `geolocation.watchPosition` 関数を停止させることによって、位置情報の監視を停止します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows Phone + +使用例 +------------- + + // 位置の変化を監視し、取得可能なもっとも精度の高い位置を使います + // (オプション) + // + var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { enableHighAccuracy: true }); + + // ... 後に続く ... + + navigator.geolocation.clearWatch(watchID); + + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

位置情報を監視中...

+ + + diff --git a/docs/jp/2.9.0/cordova/geolocation/geolocation.getCurrentPosition.md b/docs/jp/2.9.0/cordova/geolocation/geolocation.getCurrentPosition.md new file mode 100755 index 0000000000..38fdcf2dcc --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/geolocation.getCurrentPosition.md @@ -0,0 +1,126 @@ +--- +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. +--- + +geolocation.getCurrentPosition +============================== + +デバイスの現在位置を `Position` オブジェクトとして返します。 + + navigator.geolocation.getCurrentPosition(geolocationSuccess, + [geolocationError], + [geolocationOptions]); + +パラメーター +---------- + +- __geolocationSuccess__: 現在位置情報の取得成功時に呼ばれるコールバック関数を表します +- __geolocationError__: (オプション) エラー発生時に呼ばれるコールバック関数を表します +- __geolocationOptions__: (オプション) 位置情報取得のオプションを表します + +概要 +----------- + +`geolocation.getCurrentPositon` 関数は非同期関数です。 `geolocationSuccess` コールバック関数に、`Position` オブジェクトをパラメーターとしてデバイスの現在位置を返します。エラーが発生した場合、 `PositionError` オブジェクトとともに `geolocationError` コールバック関数が呼び出されます。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // 成功時のコールバック関数 + // このメソッドは GPS の現在座標を保持する + // `Position` オブジェクトを引数とする + // + var onSuccess = function(position) { + alert('緯度: ' + position.coords.latitude + '\n' + + '経度: ' + position.coords.longitude + '\n' + + '高度: ' + position.coords.altitude + '\n' + + '位置精度: ' + position.coords.accuracy + '\n' + + '高度精度: ' + position.coords.altitudeAccuracy + '\n' + + '方位: ' + position.coords.heading + '\n' + + '速度: ' + position.coords.speed + '\n' + + 'タイムスタンプ: ' + position.timestamp + '\n'); + }; + + // エラー時のコールバック関数は PositionError オブジェクトを受けとる + // + function onError(error) { + alert('コード: ' + error.code + '\n' + + 'メッセージ: ' + error.message + '\n'); + } + + navigator.geolocation.getCurrentPosition(onSuccess, onError); + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

位置情報を取得中...

+ + diff --git a/docs/jp/2.9.0/cordova/geolocation/geolocation.md b/docs/jp/2.9.0/cordova/geolocation/geolocation.md new file mode 100755 index 0000000000..a9b1ceadd0 --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/geolocation.md @@ -0,0 +1,98 @@ +--- +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. +--- + +Geolocation +=========== + +> `geolocation` オブジェクトはデバイスの GPS センサーに基づく位置情報、もしくはネットワーク信号から推測された位置情報へのアクセスを提供します。 + +`Geolocation` は緯度や経度といったデバイスの位置情報を提供します。主に Global Positioning System (GPS) から位置情報を取得しますが、 IP アドレスや RFID, WiFi, Bluetooh, MAC アドレス, 基地局 ID などのソースからも現在位置を推測します。ただしこの API がデバイスの正確な位置を特定する保証はありません。 + +この API は [W3C Geolocation API 仕様書](http://dev.w3.org/geo/api/spec-source.html) をベースとしており、W3Cの仕様を実装していないデバイスでのみ実行されます。 + +**プライバシーに関する重要な注意点:** 位置情報データを扱う場合、プライバシーに関して重要な問題が発生します。 アプリケーションの [プライバシー・ポリシー](guide_getting-started_index.md.html) では、位置情報をどのように使用するのか、他のアプリケーションとデータを共有するのか否か、さらにデータ精度はどの程度なのか (例えば、大まかな位置、詳細な位置、郵便番号レベルの位置など)、などを説明するべきです。位置情報は慎重に扱うべき情報です。なぜならば、ある個人の活動地域特定出来き、移動履歴を保存できるからです。それゆえに、アプリケーションのプライバシー・ポリシーに加えて、位置情報データへアクセスする際には、その都度通知するように強く心がけるべきでしょう (もしデバイスのOSが常に通知を行っていない場合)。この通知では、上記と同様の情報を提供し、ユーザーの許可を得るようにするべきです (例えば、"OK"と"NO"などの選択肢を表示するなど)。詳細は Privacy Guide を参照してください。 + +メソッド +------- + +- geolocation.getCurrentPosition +- geolocation.watchPosition +- geolocation.clearWatch + + +引数 +--------- + +- geolocationSuccess +- geolocationError +- geolocationOptions + +オブジェクト (読み取り専用) +------------------- + +- Position +- PositionError +- Coordinates + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest.xml + + + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + read_geolocation + + +### iOS + +#### config.xml + + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + + パーミッションの設定は必要ありません。 diff --git a/docs/jp/2.9.0/cordova/geolocation/geolocation.watchPosition.md b/docs/jp/2.9.0/cordova/geolocation/geolocation.watchPosition.md new file mode 100755 index 0000000000..c3f1a02f9a --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/geolocation.watchPosition.md @@ -0,0 +1,128 @@ +--- +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. +--- + +geolocation.watchPosition +========================= + +デバイスの現在の位置情報の変化を監視します。 + + var watchId = navigator.geolocation.watchPosition(geolocationSuccess, + [geolocationError], + [geolocationOptions]); + +パラメーター +---------- + +- __geolocationSuccess__: 現在位置情報の取得成功時に呼ばれるコールバック関数を表します +- __geolocationError__: (オプション) エラー発生時に呼ばれるコールバック関数を表します +- __geolocationOptions__: (オプション) 位置情報取得のオプションを表します + +返り値 +------- + +- __String__: 位置変化を参照する watch ID を返します。 watch ID は `geolocation.clearWatch` に渡すことで位置変化の監視を中止するために使われます。 + +概要 +----------- + +`geolocation.watchPosition` 関数は非同期関数です。位置情報に変化があった場合に、デバイスの現在位置を返します。デバイスが新しい位置情報を取得したとき、 `Position` オブジェクトとともに `geolocationSuccess` コールバック関数が呼び出されます。エラーが発生した場合、 `PositionError` オブジェクトとともに `geolocationError` コールバック関数が呼び出されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // 成功時のコールバック関数 + // このメソッドは GPS の現在座標を保持する + // `Position` オブジェクトを引数とする + // + function onSuccess(position) { + var element = document.getElementById('geolocation'); + element.innerHTML = '緯度: ' + position.coords.latitude + '
' + + '経度: ' + position.coords.longitude + '
' + + '
' + element.innerHTML; + } + + // エラー時のコールバック関数は PositionError オブジェクトを受けとる + // + function onError(error) { + alert('コード: ' + error.code + '\n' + + 'メッセージ: ' + error.message + '\n'); + } + + // もし30秒ごとに更新が取得できない場合、エラーが投げられる (オプション) + // + var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { frequency: 30000 }); + + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

位置情報を監視中...

+ + diff --git a/docs/jp/2.9.0/cordova/geolocation/parameters/geolocation.options.md b/docs/jp/2.9.0/cordova/geolocation/parameters/geolocation.options.md new file mode 100755 index 0000000000..e0db9124eb --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/parameters/geolocation.options.md @@ -0,0 +1,40 @@ +--- +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. +--- + +geolocationOptions +================== + +位置情報 (`Position`) 取得の設定をカスタマイズするためのパラメーターを表します。 + + { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }; + +オプション +------- + +- __enableHighAccuracy__: より精度の高い位置情報を取得するためのヒントを提供するかどうかを表します。デフォルトでは、デバイスはネットワークベースでの位置情報取得を試みます。プロパティーを `true` と設定することで、衛星位置情報などの精度の高い方法を使用します _(Boolean)_ +- __timeout__: `geolocation.getCurrentPosition` または `geolocation.watchPosition` 関数が呼び出されたときに、それぞれに対応する `geolocationSuccess` コールバック関数が呼ばれるまでの最大経過時間をミリ秒単位で表します。もし `geolocationSuccess` コールバック関数がこの時間内に呼ばれなかった場合、 `PositionError.TIMEOUT` エラーコードを伴った `geolocationError` コールバック関数が呼び出されます。 (注意: `geolocation.watchPosition` と一緒に使われる場合、 `geolocationError` コールバックが `timeout` ミリ秒ごとに呼び出される可能性があります) _(Number)_ +- __maximumAge__: キャッシュされた位置情報の取得を許容する最大時間をミリ秒単位で表します _(Number)_ + +Android に関する注意点 +-------------- + +Android 2.x のシミュレーターは `enableHighAccuracy` オプションを `true` にセットしない限り位置情報の取得結果を通知しません。 + + { enableHighAccuracy: true } + diff --git a/docs/jp/2.9.0/cordova/geolocation/parameters/geolocationError.md b/docs/jp/2.9.0/cordova/geolocation/parameters/geolocationError.md new file mode 100755 index 0000000000..0eabaddc24 --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/parameters/geolocationError.md @@ -0,0 +1,32 @@ +--- +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. +--- + +geolocationError +================ + +位置情報取得関数にエラーが発生したときに呼び出されるコールバック関数です。 + + function(error) { + // エラー処理 + } + +パラメーター +---------- + +- __error:__ デバイスから返されるエラーを表します _(PositionError)_ diff --git a/docs/jp/2.9.0/cordova/geolocation/parameters/geolocationSuccess.md b/docs/jp/2.9.0/cordova/geolocation/parameters/geolocationSuccess.md new file mode 100755 index 0000000000..5070948eec --- /dev/null +++ b/docs/jp/2.9.0/cordova/geolocation/parameters/geolocationSuccess.md @@ -0,0 +1,46 @@ +--- +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. +--- + +geolocationSuccess +================== + +位置情報取得に成功したとき (`geolocation.getCurrentPosition` と一緒に使われた時) 、または位置情報が変化したとき (`geolocation.watchPosition` と一緒に使われた時) に呼び出されるコールバック関数です。 + + function(position) { + // 任意のコード + } + +パラメーター +---------- + +- __position__: デバイスによって返される位置情報を表します _(Position)_ + +使用例 +------- + + function geolocationSuccess(position) { + alert('緯度: ' + position.coords.latitude + '\n' + + '経度: ' + position.coords.longitude + '\n' + + '高度: ' + position.coords.altitude + '\n' + + '位置精度: ' + position.coords.accuracy + '\n' + + '高度精度: ' + position.coords.altitudeAccuracy + '\n' + + '方位: ' + position.coords.heading + '\n' + + '速度: ' + position.coords.speed + '\n' + + 'タイムスタンプ: ' + position.timestamp + '\n'); + } diff --git a/docs/jp/2.9.0/cordova/globalization/GlobalizationError/globalizationerror.md b/docs/jp/2.9.0/cordova/globalization/GlobalizationError/globalizationerror.md new file mode 100755 index 0000000000..4f94ce30bf --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/GlobalizationError/globalizationerror.md @@ -0,0 +1,93 @@ +--- +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. +--- + +GlobalizationError +============ + +Globalization API からのエラーを表すオブジェクトです。 + +プロパティー +---------- + +- __code__: 以下のエラータイプを表すコードのうちの1つを表します _(Number)_ + - GlobalizationError.UNKNOWN\_ERROR: 0 + - GlobalizationError.FORMATTING\_ERROR: 1 + - GlobalizationError.PARSING\_ERROR: 2 + - GlobalizationError.PATTERN\_ERROR: 3 +- __message__: エラーの内容を表すエラーメッセージを表します _(String)_ + +概要 +----------- + +このオブジェクトは Cordova によって作られ、エラー発生時にコールバック関数に渡されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS + +使用例 +------------- + +以下のエラーコールバックが呼び出されるとき、 `code: 3` と `message:` といったような文字列とともにポップアップダイアログが表示されます。 + + function errorCallback(error) { + alert('code: ' + error.code + '\n' + + 'message: ' + error.message + '\n'); + }; + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.dateToString.md b/docs/jp/2.9.0/cordova/globalization/globalization.dateToString.md new file mode 100755 index 0000000000..38d2b94c33 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.dateToString.md @@ -0,0 +1,94 @@ +--- +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. +--- + +globalization.dateToString +=========== + +クライアントのロケールとタイムゾーンを元にフォーマットされた日時を文字列で返します。 + + navigator.globalization.dateToString(date, successCallback, errorCallback, options); + +概要 +----------- + +フォーマットされた日時は、 `successCallback` に渡されるプロパティオブジェクトの `value` プロパティに文字列で渡されます。 + +引数の `date` パラメーターは `Date` 型である必要があります。 + +もし日時のフォーマット中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.FORMATTING_ERROR` です。 + +`options` パラメーターはオプション (任意) であり、デフォルト値は以下の通りです: + + {formatLength:'short', selector:'date and time'}` + +`options.formatLength` には `short`, `medium`, `long`, または `full` が指定出来ます。 + +`options.selector` には `date`, `time` または `date and time` が指定出来ます。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iPhone +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en\_US` に設定されている場合、次のコードはデフォルトのオプションを使用して `date: 9/25/2012 4:21PM` といったような文字列をポップアップダイアログに表示します。 + + navigator.globalization.dateToString( + new Date(), + function (date) {alert('date:' + date.value + '\n');}, + function () {alert('Error getting dateString\n');}, + {formatLength:'short', selector:'date and time'} + ); + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + + +Windows Phone 8 に関する注意点 +-------------- + +- `formatLength` オプションは `short` と `full` のみをサポートしています。 diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.getCurrencyPattern.md b/docs/jp/2.9.0/cordova/globalization/globalization.getCurrencyPattern.md new file mode 100755 index 0000000000..34f7007bc1 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.getCurrencyPattern.md @@ -0,0 +1,108 @@ +--- +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. +--- + +globalization.getCurrencyPattern +=========== + +クライアントのユーザー設定と ISO 4217 通貨コードを元に、通貨の値のフォーマットと変換のためのパターン文字列を返します。 + + navigator.globalization.getCurrencyPattern(currencyCode, successCallback, errorCallback); + +概要 +----------- + +successCallback コールバック関数に、プロパティーオブジェクトをパラメーターとしてパターンを返します。このオブジェクトは以下のプロパティーを持っています: + +- __pattern__: 通貨の値のフォーマットと変換のためのパターンを表します。このパターンは Unicode Technical Standard #35 に従っています。 _(String)_ +- __code__: パターンのための The ISO 4217 の通貨コードを表します。 _(String)_ +- __fraction__: フォーマットおよび変換時に使う小数の桁数を表します。 _(Number)_ +- __rounding__: フォーマットおよび変換時に使う丸めの単位を表します。 _(Number)_ +- __decimal__: フォーマットおよび変換時に使う小数の記号を表します。 _(String)_ +- __grouping__: フォーマットおよび変換時に使うグルーピング時の記号を表します。 _(String)_ + +引数の `currencyCode` パラメーターは、例えば 'USD' などの、 ISO 4217 通貨コードのうちの1つである必要があります。 + +もしパターン取得中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.FORMATTING_ERROR` です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS + +使用例 +------------- + +ブラウザーのロケールが en\_US に設定され、通貨には US ドルが選択された場合、以下のような文字列をポップアップダイアログに表示します: + + navigator.globalization.getCurrencyPattern( + 'USD', + function (pattern) { + alert('pattern: ' + pattern.pattern + '\n' + + 'code: ' + pattern.code + '\n' + + 'fraction: ' + pattern.fraction + '\n' + + 'rounding: ' + pattern.rounding + '\n' + + 'decimal: ' + pattern.decimal + '\n' + + 'grouping: ' + pattern.grouping); + }, + function () {alert('Error getting pattern\n');} + ); + +期待される結果 + + pattern: $#,##0.##;($#,##0.##) + code: USD + fraction: 2 + rounding: 0 + decimal: . + grouping: , + + + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.getDateNames.md b/docs/jp/2.9.0/cordova/globalization/globalization.getDateNames.md new file mode 100755 index 0000000000..f0e551a69b --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.getDateNames.md @@ -0,0 +1,95 @@ +--- +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. +--- + +globalization.getDateNames +=========== + +クライアントのユーザー設定とカレンダーを元に、月と曜日の名前の配列を返します。 + + navigator.globalization.getDateNames(successCallback, errorCallback, options); + +概要 +----------- + +`successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとして名前の配列を返します。このオブジェクトは文字列配列の `value` プロパティーを持っています。この文字列配列は、オプションで何が選択されたかによって、最初の月もしくは最初の曜日の名前から始まります。 + +もし名前の取得中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.UNKNOWN\_ERROR` です。 + +`options` パラメーターはオプション (任意) であり、デフォルト値は以下の通りです: + + {type: 'wide', item: 'months'} + +`options.type` には `narrow` または `wide` が指定出来ます。 + +`options.item` には `months` または `days` が指定出来ます。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en\_US` に設定されている場合、次のコードは 12 個のポップアップダイアログを次々と表示します。それぞれのポップアップダイアログには、 `month: January` といったような文字列が表示されます。 + + navigator.globalization.getDateNames( + function (names) { + for (var i=0; i + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.getDatePattern.md b/docs/jp/2.9.0/cordova/globalization/globalization.getDatePattern.md new file mode 100755 index 0000000000..e52a93ea26 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.getDatePattern.md @@ -0,0 +1,99 @@ +--- +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. +--- + +globalization.getDatePattern +=========== + +クライアントのユーザー設定を元に、日時のフォーマットと変換のためのパターン文字列を返します。 + + navigator.globalization.getDatePattern(successCallback, errorCallback, options); + +概要 +----------- + +`successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとしてパターンを返します。このオブジェクトは以下のプロパティーを持っています: + +- __pattern__: 日時のフォーマットと変換のための日付および時間のパターンを表します。このパターンは Unicode Technical Standard #35 に従っています。 _(String)_ +- __timezone__: クライアントのタイムゾーンの省略名を表します。 _(String)_ +- __utc\_offset__: クライアントのタイムゾーンと協定世界時との現在の差を秒で表します。 _(Number)_ +- __dst\_offset__: 現在のサマータイム (デイライトセービングタイム) のオフセットを秒で表します。 _(Number)_ + +もしパターン取得中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.PATTERN_ERROR` です。 + +options パラメーターはオプション (任意) ですあり、デフォルト値は以下の通りです: + + {formatLength: 'short', selector: 'date and time'} + + +`options.formatLength` には `short`, `medium`, `long`, または `full` が指定出来ます。 `options.selector` には `date`, `time` または `date and time` が指定出来ます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定されている場合、次のコードは `pattern: M/d/yyyy h:mm a` といったような文字列をポップアップダイアログに表示します。 + + function checkDatePattern() { + navigator.globalization.getDatePattern( + function (date) {alert('pattern: ' + date.pattern + '\n');}, + function () {alert('Error getting pattern\n');}, + {formatLength:'short', selector:'date and time'} + ); + } + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + + +Windows Phone 8 に関する注意点 +-------------- + +- `formatLength` は `short` と `full` のみサポートしています。 +- `date and time` が指定されている場合、 `pattern` は日時とタイムゾーンを含むフォーマットを返します。 +- `timezone` はタイムゾーンの正式名称を返します。 +- `dst_offset` プロパティはサポートされておらず、常に 0 を返します。 diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.getFirstDayOfWeek.md b/docs/jp/2.9.0/cordova/globalization/globalization.getFirstDayOfWeek.md new file mode 100755 index 0000000000..672cb480ab --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.getFirstDayOfWeek.md @@ -0,0 +1,76 @@ +--- +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. +--- + +globalization.getFirstDayOfWeek +=========== + +クライアントのユーザー設定とカレンダーを元に、週の最初の曜日を返します。 + + navigator.globalization.getFirstDayOfWeek(successCallback, errorCallback); + +概要 +----------- + +週の曜日は 1 から始まり、 1 は日曜日を表します。 `successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとして曜日を返します。このオブジェクトは数字の `value` プロパティーを持っています。 + +もし曜日の取得中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.UNKNOWN\_ERROR` です。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定されている場合、次のコードは `day: 1` といったような文字列をポップアップダイアログに表示します。 + + navigator.globalization.getFirstDayOfWeek( + function (day) {alert('day: ' + day.value + '\n');}, + function () {alert('Error getting day\n');} + ); + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.getLocaleName.md b/docs/jp/2.9.0/cordova/globalization/globalization.getLocaleName.md new file mode 100755 index 0000000000..4e691a660c --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.getLocaleName.md @@ -0,0 +1,77 @@ +--- +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. +--- + +globalization.getLocaleName +=========== + +クライアントの現在のロケールの設定の識別文字列を取得します。 + + navigator.globalization.getLocaleName(successCallback, errorCallback); + + +概要 +----------- + +`successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとしてロケールの識別文字列を返します。このオブジェクトは文字列の `value` プロパティーを持っています。 + +もしロケールの取得中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.UNKNOWN_ERROR` です。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定された場合、次のコードは `locale: en_US` という文字列をポップアップダイアログに表示します。 + + navigator.globalization.getLocaleName( + function (locale) {alert('locale: ' + locale.value + '\n');}, + function () {alert('Error getting locale\n');} + ); + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.getNumberPattern.md b/docs/jp/2.9.0/cordova/globalization/globalization.getNumberPattern.md new file mode 100755 index 0000000000..350dc2c2ee --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.getNumberPattern.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. +--- + +globalization.getNumberPattern +=========== + +クライアントのユーザー設定を元に、数字のフォーマットと変換のためのパターン文字列を返します。 + + navigator.globalization.getNumberPattern(successCallback, errorCallback, options); + +概要 +----------- + +`successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとしてパターンを返します。このオブジェクトは以下のプロパティーを持っています: + +- __pattern__: 数字のフォーマットと変換のためのパターンを表します。このパターンは Unicode Technical Standard #35 に従っています。 _(String)_ +- __symbol__: フォーマットおよび変換時に使うパーセントや通貨といったシンボルを表します。 _(String)_ +- __fraction__: フォーマットおよび変換時に使う小数の桁数を表します。 _(Number)_ +- __rounding__: フォーマットおよび変換時に使う丸めの単位を表します。 _(Number)_ +- __positive__: フォーマットおよび変換時に使う正の数のための記号を表します。 _(String)_ +- __negative__: フォーマットおよび変換時に使う負の数のための記号を表します。 _(String)_ +- __decimal__: フォーマットおよび変換時に使う小数の記号を表します。 _(String)_ +- __grouping__: フォーマットおよび変換時に使うグルーピング時の記号を表します。 _(String)_ + +もしパターン取得中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.PATTERN_ERROR` です。 + +`options` パラメーターはオプション (任意) であり、デフォルト値は以下の通りです: + + {type:'decimal'} + +`options.type` には `decimal`, `percent`, または `currency` が指定出来ます。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定されている場合、以下のような文字列をポップアップダイアログに表示します: + + navigator.globalization.getNumberPattern( + function (pattern) {alert('pattern: ' + pattern.pattern + '\n' + + 'symbol: ' + pattern.symbol + '\n' + + 'fraction: ' + pattern.fraction + '\n' + + 'rounding: ' + pattern.rounding + '\n' + + 'positive: ' + pattern.positive + '\n' + + 'negative: ' + pattern.negative + '\n' + + 'decimal: ' + pattern.decimal + '\n' + + 'grouping: ' + pattern.grouping);}, + function () {alert('Error getting pattern\n');}, + {type:'decimal'} + ); + +結果: + + pattern: #,##0.### + symbol: . + fraction: 0 + rounding: 0 + positive: + negative: - + decimal: . + grouping: , + + + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.getPreferredLanguage.md b/docs/jp/2.9.0/cordova/globalization/globalization.getPreferredLanguage.md new file mode 100755 index 0000000000..2c17e98ad2 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.getPreferredLanguage.md @@ -0,0 +1,79 @@ +--- +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. +--- + +globalization.getPreferredLanguage +=========== + +クライアントの現在の言語の識別文字列を取得します。 + + navigator.globalization.getPreferredLanguage(successCallback, errorCallback); + + +概要 +----------- + +`successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとして言語の識別文字列を返します。このオブジェクトは文字列の `value` プロパティーを持っています。 + +もし言語の取得中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.UNKNOWN_ERROR` です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定された場合、次のコードは `language: English` という文字列をポップアップダイアログに表示します。 + + navigator.globalization.getPreferredLanguage( + function (language) {alert('language: ' + language.value + '\n');}, + function () {alert('Error getting language\n');} + ); + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + +Windows Phone 8 に関する注意点 +------- +- 現在の言語として、 ISO 639-1 言語コード (2文字) を返します。 diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.isDayLightSavingsTime.md b/docs/jp/2.9.0/cordova/globalization/globalization.isDayLightSavingsTime.md new file mode 100755 index 0000000000..cd2dd7ae4f --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.isDayLightSavingsTime.md @@ -0,0 +1,79 @@ +--- +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. +--- + +globalization.isDayLightSavingsTime +=========== + +クライアントのタイムゾーンとカレンダーを元に、夏時間が与えられた日付で有効かどうかを返します。 + + navigator.globalization.isDayLightSavingsTime(date, successCallback, errorCallback); + +概要 +----------- + +`successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとして夏時間かどうかを返します。このオブジェクトは `Boolean` の `dst` プロパティーを持っています。 `true` は夏時間が現在有効であること、 `false` はそうでないことを表します。 + +引数の `date` パラメーターは `Date` 型である必要があります。 + +もし日付の読み取り中にエラーが発生した場合、 `errorCallback` コールバックが呼び出されます。このエラーに対するエラーコードは `GlobalizationError.UNKNOWN_ERROR` です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーが DST が有効なタイムゾーンで、夏の場合、次のコードは `dst: true` といったような文字列をポップアップダイアログに表示します。 + + navigator.globalization.isDayLightSavingsTime( + new Date(), + function (date) {alert('dst: ' + date.dst + '\n');}, + function () {alert('Error getting names\n');} + ); + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.md b/docs/jp/2.9.0/cordova/globalization/globalization.md new file mode 100755 index 0000000000..91da4d5880 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.md @@ -0,0 +1,61 @@ +--- +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. +--- + +Globalization +====== + +> `globalization` オブジェクトはユーザーのロケールとタイムゾーンの情報を取得し、固有の操作を実行します。 + +オブジェクト +------- + +- GlobalizationError + +メソッド +------- + +- globalization.getPreferredLanguage +- globalization.getLocaleName +- globalization.dateToString +- globalization.stringToDate +- globalization.getDatePattern +- globalization.getDateNames +- globalization.isDayLightSavingsTime +- globalization.getFirstDayOfWeek +- globalization.numberToString +- globalization.stringToNumber +- globalization.getNumberPattern +- globalization.getCurrencyPattern + +スコープ +-------------- + +この `globalization` オブジェクトは `navigator` オブジェクトのプロパティであり、グローバルスコープを持っています。 + + // グローバル globalization オブジェクト + var globalization = navigator.globalization; + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.numberToString.md b/docs/jp/2.9.0/cordova/globalization/globalization.numberToString.md new file mode 100755 index 0000000000..4f75aaf633 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.numberToString.md @@ -0,0 +1,85 @@ +--- +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. +--- + +globalization.numberToString +=========== + +クライアントのユーザー設定を元にフォーマットされた数字を文字列で返します。 + + navigator.globalization.numberToString(number, successCallback, errorCallback, options); + +概要 +----------- + +`successCallback` コールバック関数に、プロパティーオブジェクトをパラメーターとしてフォーマットされた数字を渡します。このオブジェクトは文字列の `value` プロパティーを持っています。 + +もし数字のフォーマット中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.FORMATTING_ERROR` です。 + +`options` パラメーターはオプション (任意) であり、デフォルト値は以下の通りです。 + + {type:'decimal'} + +`options.type` には `decimal`, `percent`, または `currency` が指定出来ます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定されている場合、次のコードは `number: 3.142` といったような文字列をポップアップダイアログに表示します。 + + navigator.globalization.numberToString( + 3.1415926, + function (number) {alert('number: ' + number.value + '\n');}, + function () {alert('Error getting number\n');}, + {type:'decimal'} + ); + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.stringToDate.md b/docs/jp/2.9.0/cordova/globalization/globalization.stringToDate.md new file mode 100755 index 0000000000..2c63572604 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.stringToDate.md @@ -0,0 +1,107 @@ +--- +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. +--- + +globalization.stringToDate +=========== + +クライアントのユーザー設定とカレンダーを元に、 +タイムゾーンを使って文字列を日付に変換し、 +対応する日付オブジェクトを返します。 + + navigator.globalization.stringToDate(dateString, successCallback, errorCallback, options); + +概要 +----------- + +プロパティーオブジェクトをパラメーターとして日付を成功コールバックに返します。このオブジェクトは以下のプロパティーを持っています: + +- __year__: 4桁の年を表します _(Number)_ +- __month__: (0 - 11) の月を表します _(Number)_ +- __day__: (1 - 31) の日を表します _(Number)_ +- __hour__: (0 - 23) の時を表します _(Number)_ +- __minute__: (0 - 59) の分を表します _(Number)_ +- __second__: (0 - 59) の秒を表します _(Number)_ +- __millisecond__: (0 - 999) のミリ秒を表します。すべてのプラットフォームで有効というわけではありません _(Number)_ + +引数の `dateString` パラメーターは `String` 型である必要があります。 + +`options` パラメーターはオプション (任意) であり、デフォルト値は以下の通りです: + + {formatLength:'short', selector:'date and time'} + +`options.formatLength` には `short`, `medium`, `long`, または `full` が指定出来ます。`options.selector` には `date`, `time` または `date and time` が指定出来ます。 + +もし変換中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.PARSING_ERROR` です。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定されている場合、次のコードは `month:8 day:25 year:2012` といったような文字列をポップアップダイアログに表示します。月として返る数値は文字列より 1 少ないので気をつけてください。 + + navigator.globalization.stringToDate( + '9/25/2012', + function (date) {alert('month:' + date.month + + ' day:' + date.day + + ' year:' + date.year + '\n');}, + function () {alert('Error getting date\n');}, + {selector:'date'} + ); + + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + +Windows Phone 8 に関する注意点 +------------------ + +- `formatLength` オプションは `short` と `full` のみをサポートしています。 diff --git a/docs/jp/2.9.0/cordova/globalization/globalization.stringToNumber.md b/docs/jp/2.9.0/cordova/globalization/globalization.stringToNumber.md new file mode 100755 index 0000000000..387bc3fbf0 --- /dev/null +++ b/docs/jp/2.9.0/cordova/globalization/globalization.stringToNumber.md @@ -0,0 +1,87 @@ +--- +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. +--- + +globalization.stringToNumber +=========== + +クライアントのユーザー設定を元に文字列を数字に変換し、対応する数字を返します。 + + navigator.globalization.stringToNumber(string, successCallback, errorCallback, options); + +概要 +----------- + +プロパティーオブジェクトをパラメーターとして数字を `successCallback` コールバック関数に返します。このオブジェクトは数字の `value` プロパティーを持っています。 + +もし数字の変換中にエラーが発生した場合、 `errorCallback` コールバックが `GlobalizationError` オブジェクトをパラメーターとして呼び出されます。このエラーに対するエラーコードは `GlobalizationError.PARSING_ERROR` です。 + +`options` パラメーターはオプション (任意) であり、デフォルト値は以下の通りです: + + {type:'decimal'} + +`options.type` には `decimal`, `percent`, または `currency` が指定出来ます。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 8 + +使用例 +------------- + +ブラウザーのロケールが `en_US` に設定されている場合、次のコードは `number: 1234.56` といったような文字列をポップアップダイアログに表示します。 + + navigator.globalization.stringToNumber( + '1234.56', + function (number) {alert('number: ' + number.value + '\n');}, + function () {alert('Error getting number\n');}, + {type:'decimal'} + ); + + +詳細な使用例 +------------ + + + + + Cordova + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/inappbrowser/inappbrowser.md b/docs/jp/2.9.0/cordova/inappbrowser/inappbrowser.md new file mode 100755 index 0000000000..f8ab143fc2 --- /dev/null +++ b/docs/jp/2.9.0/cordova/inappbrowser/inappbrowser.md @@ -0,0 +1,425 @@ +--- +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. +--- + +InAppBrowser +============ + +> `InAppBrowser` は、 `window.open` 使用時にアプリ内に表示される Web ブラウザです。 + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + +概要 +----------- + +返り値で受け取るオブジェクトについては、 `window.open` を参照してください。 + +メソッド +---------- + +- addEventListener +- removeEventListener +- close +- executeScript +- insertCSS + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +### iOS + +#### config.xml + + + +### Windows Phone 7 + 8 + +#### config.xml + + + +addEventListener +================ + +> `InAppBrowser` のイベントにリスナーを追加します。 + + ref.addEventListener(eventname, callback); + +- __ref__: `InAppBrowser` ウィンドウへの参照 _(InAppBrowser)_ +- __eventname__: 購読するイベント名 _(String)_ + + - __loadstart__: `InAppBrowser` が URL を読み込み始めた際に発行されるイベント。 + - __loadstop__: `InAppBrowser` が URL を読み込み終えた際に発行されるイベント。 + - __loaderror__: `InAppBrowser` が URL 読み込み時にエラーを検出した際に発行されるイベント。 + - __exit__: `InAppBrowser` ウィンドウを閉じる際に発行されるイベント。 + +- __callback__: イベント発行時に実行される関数。 `InAppBrowserEvent` オブジェクトを引数として受け取ります。 + + +サポートされているプラットフォーム +------------------- + +- Android +- iOS +- Windows Phone 7 and 8 + +使用例 +------------- + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.addEventListener('loadstart', function() { alert(event.url); }); + +詳細な使用例 +------------ + + + + + InAppBrowser.addEventListener Example + + + + + + + + +removeEventListener +=================== + +> `InAppBrowser` のイベントからリスナーを取り除きます。 + + ref.removeEventListener(eventname, callback); + + +- __ref__: `InAppBrowser` ウィンドウへの参照 _(InAppBrowser)_ +- __eventname__: 購読するイベント名 _(String)_ + + - __loadstart__: `InAppBrowser` が URL を読み込み始めた際に発行されるイベント。 + - __loadstop__: `InAppBrowser` が URL を読み込み終えた際に発行されるイベント。 + - __loaderror__: `InAppBrowser` が URL 読み込み時にエラーを検出した際に発行されるイベント。 + - __exit__: `InAppBrowser` ウィンドウを閉じる際に発行されるイベント。 + +- __callback__: イベント発行時に実行される関数。 `InAppBrowserEvent` オブジェクトを引数として受け取ります。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS +- Windows Phone 7 and 8 + +使用例 +------------- + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + var myCallback = function() { alert(event.url); } + ref.addEventListener('loadstart', myCallback); + ref.removeEventListener('loadstart', myCallback); + +詳細な使用例 +------------ + + + + + InAppBrowser.removeEventListener Example + + + + + + + + +close +===== + +> `InAppBrowser` ウィンドウを閉じます。 + + ref.close(); + +- __ref__: `InAppBrowser` ウィンドウへの参照 _(InAppBrowser)_ + +サポートされているプラットフォーム +------------------- + +- Android +- iOS +- Windows Phone 7 and 8 +- BlackBerry 10 + +使用例 +------------- + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.close(); + +詳細な使用例 +------------ + + + + + InAppBrowser.close Example + + + + + + + + +executeScript +============= + +> `InAppBrowser`でJavaScriptを実行します。 + + ref.executeScript(details, callback); + +- __ref__: `InAppBrowser`ウィンドウへの参照。 _(InAppBrowser)_ +- __injectDetails__: 実行するスクリプト。オブジェクト形式で、`file`キーか`code`キーに以下の値を指定します。 _(Object)_ + - __file__: 実行するスクリプトのURL。 + - __code__: 実行するスクリプト内容を記述した文字列。 +- __callback__: JavaScript コード実行後に呼び出される関数。 + - `code` キーでスクリプトを渡した場合、 `callback` は引数を1つ受け取ります。この引数は配列であり、その要素はスクリプトの戻り値です。複数行のスクリプトの場合、最後の行か、最後に評価された部分の戻り値が引数となります。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS + +使用例 +------------- + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.addEventListener('loadstop', function() { + ref.executeSript({file: "myscript.js"}); + }); + +詳細な使用例 +------------ + + + + + InAppBrowser.executeScript Example + + + + + + + + +insertCSS +========= + +> `InAppBrowser` へ CSS を追加する + + ref.insertCSS(details, callback); + +- __ref__: `InAppBrowser` ウィンドウへの参照。 _(InAppBrowser)_ +- __injectDetails__: 追加する CSS 。オブジェクト形式で、 `file` キーか `code` キーに以下の値を指定します。 + - __file__: 追加するスタイルシートの URL。 + - __code__: 追加するスタイルシート内容を記述した文字列。 +- __callback__: CSS を追加した後に呼び出される関数。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS + +使用例 +------------- + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.addEventListener('loadstop', function() { + ref.insertCSS({file: "mystyles.css"}); + }); + +詳細な使用例 +------------ + + + + + InAppBrowser.insertCSS Example + + + + + + + + +InAppBrowserEvent +================= + +`InAppBrowser` オブジェクトに `addEventListener` で登録されたコールバック関数へ渡されるオブジェクト。 + +プロパティ +---------- + +- __type__: イベント名。 `loadstart`, `loadstop`, `loaderror`, もしくは `exit` のいずれか。 _(String)_ +- __url__: 読み込んだURL。 _(String)_ +- __code__: エラーコード。 `loaderror` の場合のみ保持。 _(Number)_ +- __message__: エラーメッセージ。 `loaderror` の場合のみ保持。 _(String)_ diff --git a/docs/jp/2.9.0/cordova/inappbrowser/window.open.md b/docs/jp/2.9.0/cordova/inappbrowser/window.open.md new file mode 100755 index 0000000000..8b9be4835e --- /dev/null +++ b/docs/jp/2.9.0/cordova/inappbrowser/window.open.md @@ -0,0 +1,99 @@ +--- +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. +--- + +window.open +=========== + +新しい `InAppBrowser`、 現在のブラウザインスタンス、もしくはシステムのブラウザで URL を開きます。 + + var ref = window.open(url, target, options); + +- __ref__: `InAppBrowser` ウィンドウへの参照 _(InAppBrowser)_ +- __url__: 読み込む URL _(String)_。 URL にユニコード文字が含まれるなら、`encodeURI()` を使って URL を変換して下さい。 +- __target__: URL を読み込むブラウザ種別を設定します。オプションのパラメータであり、デフォルト値は `_self` です。 _(String)_ + + - `_self`: URL がホワイトリストに入っていれば、Cordova WebViewで開きます。ホワイトリストに入っていない場合、 `InAppBrowser` で開きます。 + - `_blank`: `InAppBrowser` で開きます。 + - `_system`: システムの Web ブラウザで開きます。 + +- __options__: `InAppBrowser` へのオプション値 (任意) であり、デフォルト値は `location=yes` です。 _(String)_ + + `options` 文字列には空白を入れられません。各設定 (名前/値のペア) はカンマで区切ります。設定名は大文字・小文字を区別します。全てのプラットフォームが以下の値をサポートしています: + + - __location__: `yes` もしくは `no` を設定することで、 `InAppBrowser` のロケーションバーを表示もしくは非表示にします。 + + Android のみ + ------------ + - __closebuttoncaption__ - "Done" ボタンの表示名を文字列で指定します。 + + iOS のみ + -------- + - __closebuttoncaption__ - "Done" ボタンの表示名を文字列で指定します。この値自体をローカライズしなければならないことに注意して下さい。 + - __toolbar__ - `yes` もしくは `no` を設定することで、 InAppBrowser のツールバーを表示もしくは非表示にします (デフォルト値は `yes`)。 + - __enableViewportScale__: `yes` もしくは `no` に設定することで、 META タグでの viewport によるスケール変換を有効もしくは無効にします (デフォルト値は `no`)。 + - __mediaPlaybackRequiresUserAction__: `yes` もしくは `no` に設定することで、 HTML5 の audio もしくは video の自動再生を有効もしくは無効にします(デフォルト値は `no`)。 + - __allowInlineMediaPlayback__: `yes` もしくは `no` に設定することで、 ブラウザのウィンドウ内で表示している HTML5 のインライン・メディアの再生を許可するか設定します。HTML の `video` 要素には `webkit-playsinline` 属性を指定する必要があります。 (デフォルト値は `no`) + - __keyboardDisplayRequiresUserAction__: `yes` もしくは `no` に設定することで、 フォーム要素がJavaScriptの `focus()` によってフォーカスされた際にキーボードを表示するか否かを設定します (デフォルト値は `yes`) 。 + - __suppressesIncrementalRendering__: `yes` もしくは `no` を設定することで、新しい内容を全て受け取ってからレンダリングするか否かを設定します (デフォルト値は `no`) 。 + - __presentationstyle__: `pagesheet`, `formsheet` もしくは `fullscreen` に設定することで、 [presentation style](http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle) を設定します (デフォルト値は `fullscreen`) 。 + - __transitionstyle__: `fliphorizontal`, `crossdissolve` もしくは `coververtical` に設定することで、 [transition style](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle) を設定します (デフォルト値は `coververtical`) 。 + +Supported Platforms +------------------- + +- Android +- iOS +- BlackBerry 10 +- Windows Phone 7 and 8 + +Quick Example +------------- + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + var ref2 = window.open(encodeURI('http://ja.m.wikipedia.org/wiki/日本語'), '_blank', 'location=yes'); + +Full Example +------------ + + + + + window.open Example + + + + + + + diff --git a/docs/jp/2.9.0/cordova/media/MediaError/mediaError.md b/docs/jp/2.9.0/cordova/media/MediaError/mediaError.md new file mode 100755 index 0000000000..f9f0b9f91b --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/MediaError/mediaError.md @@ -0,0 +1,44 @@ +--- +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. +--- + +MediaError +========== + +`MediaError` オブジェクトは、エラー発生時に `mediaError` コールバック関数に渡されます。 + +プロパティー +---------- + +- __code__: 事前に定義された以下のエラーコードのうちの1つを表します +- __message__: エラーの内容を表すエラーメッセージを表します + +定数 +--------- + +- `MediaError.MEDIA_ERR_ABORTED` +- `MediaError.MEDIA_ERR_NETWORK` +- `MediaError.MEDIA_ERR_DECODE` +- `MediaError.MEDIA_ERR_NONE_SUPPORTED` + + +概要 +----------- + +`MediaError` オブジェクトは、エラー発生時に `mediaError` コールバック関数に渡されます。 + diff --git a/docs/jp/2.9.0/cordova/media/Parameters/mediaError.md b/docs/jp/2.9.0/cordova/media/Parameters/mediaError.md new file mode 100755 index 0000000000..839b34a7b0 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/Parameters/mediaError.md @@ -0,0 +1,32 @@ +--- +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. +--- + +mediaError +========== + +メディア関数群にエラーが発生したときのユーザーによって定義されるコールバック関数です。 + + function(error) { + // エラー処理 + } + +パラメーター +---------- + +- __error__: デバイスから返されるエラーを表します (`MediaError`) diff --git a/docs/jp/2.9.0/cordova/media/capture/CaptureCB.md b/docs/jp/2.9.0/cordova/media/capture/CaptureCB.md new file mode 100755 index 0000000000..1c50ce9537 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/CaptureCB.md @@ -0,0 +1,44 @@ +--- +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. +--- + +CaptureCB +========= + +> メディアキャプチャー操作が成功した場合に呼び出されます。 + + function captureSuccess( MediaFile[] mediaFiles ) { ... }; + +概要 +----------- + +この関数は、キャプチャー操作が正常に完了したときに呼び出されます。これは、メディアファイルがキャプチャーされ、ユーザーがメディアキャプチャーアプリを終了した、もしくはキャプチャーの取得制限値に達したという意味です。 + +それぞれの `MediaFile` オブジェクトはキャプチャーされたメディアファイルを表します。 + +使用例 +------------- + + // capture コールバック関数 + function captureSuccess(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // ファイルを使用した処理 + } + }; diff --git a/docs/jp/2.9.0/cordova/media/capture/CaptureError.md b/docs/jp/2.9.0/cordova/media/capture/CaptureError.md new file mode 100755 index 0000000000..03e0e808ef --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/CaptureError.md @@ -0,0 +1,37 @@ +--- +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. +--- + +CaptureError +============ + +> 失敗したメディアキャプチャー操作のエラーコードをカプセル化します。 + +プロパティー +---------- + +- __code__: 事前に定義された以下のエラーコードのうちの1つを表します + +定数 +--------- + +- `CaptureError.CAPTURE_INTERNAL_ERR`: カメラまたはマイクが画像または音のキャプチャーに失敗した場合。 +- `CaptureError.CAPTURE_APPLICATION_BUSY`: カメラアプリまたはオーディオ録音アプリが現在他のキャプチャーリクエストを扱っている場合。 +- `CaptureError.CAPTURE_INVALID_ARGUMENT`: API の使用方法が不正であった場合 (例: limit パラメーターの値が1未満である) 。 +- `CaptureError.CAPTURE_NO_MEDIA_FILES`: ユーザーが何もキャプチャーせずにカメラアプリやオーディオ録音アプリを終了した場合。 +- `CaptureError.CAPTURE_NOT_SUPPORTED`: キャプチャー操作のリクエストがサポートされていない場合。 diff --git a/docs/jp/2.9.0/cordova/media/capture/CaptureErrorCB.md b/docs/jp/2.9.0/cordova/media/capture/CaptureErrorCB.md new file mode 100755 index 0000000000..b177fc68ca --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/CaptureErrorCB.md @@ -0,0 +1,40 @@ +--- +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. +--- + +CaptureErrorCB +============== + +> メディアキャプチャー操作中にエラーが発生した場合に呼び出されます。 + + function captureError( CaptureError error ) { ... }; + +概要 +----------- + +もしメディアキャプチャーアプリを起動しようとしてエラーが発生した場合に、この関数は呼び出されます。エラーとなるのは、アプリがビジー状態であった場合、キャプチャー操作を既に実行中である場合、ユーザーによってメディアファイルがキャプチャーされる前にキャプチャー操作がキャンセルされた場合、などです。 + +この関数は適切なエラーコードが含まれた `CaptureError` オブジェクトを伴って呼び出されます。 + +使用例 +------------- + + // capture エラーコールバック関数 + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; diff --git a/docs/jp/2.9.0/cordova/media/capture/ConfigurationData.md b/docs/jp/2.9.0/cordova/media/capture/ConfigurationData.md new file mode 100755 index 0000000000..e5fa921f6e --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/ConfigurationData.md @@ -0,0 +1,62 @@ +--- +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. +--- + +ConfigurationData +================= + +> デバイスがサポートしているメディアキャプチャーのパラメーターのセットをカプセル化します。 + +概要 +----------- + +このオブジェクトは、デバイスによってサポートされているメディアキャプチャーのモードを表すために使われています。設定データは MIME 型とビデオまたはイメージキャプチャーのためのサイズ情報を含んでいます。 + +MIME 型は [RFC2046](http://www.ietf.org/rfc/rfc2046.txt) に従っています。 例: + +- `video/3gpp` +- `video/quicktime` +- `image/jpeg` +- `audio/amr` +- `audio/wav` + +プロパティー +---------- + +- __type__: ASCII エンコードされた小文字の文字列でメディアタイプを表します。 (DOMString) +- __height__: 画像またはビデオの高さをピクセルで表します。 オーディオの場合は、 0 に設定されます。 (Number) +- __width__: 画像またはビデオの幅をピクセルで表します。 オーディオの場合は、 0 に設定されます。 (Number) + +使用例 +------------- + + // サポートされている画像のモードを取得 + var imageModes = navigator.device.capture.supportedImageModes; + + // 幅が一番高い解像度を持つモードを選択 + var width = 0; + var selectedmode; + for each (var mode in imageModes) { + if (mode.width > width) { + width = mode.width; + selectedmode = mode; + } + } + + +どのプラットフォームからもサポートされていません。全ての設定データは空となっています。 diff --git a/docs/jp/2.9.0/cordova/media/capture/MediaFile.getFormatData.md b/docs/jp/2.9.0/cordova/media/capture/MediaFile.getFormatData.md new file mode 100755 index 0000000000..d6ad48f8ff --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/MediaFile.getFormatData.md @@ -0,0 +1,54 @@ +--- +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. +--- + +MediaFile.getFormatData +======================= + +> メディアキャプチャーファイルのフォーマット情報を取得します。 + + mediaFile.getFormatData( + MediaFileDataSuccessCB successCallback, + [MediaFileDataErrorCB errorCallback] + ); + +概要 +----------- + +この関数は、メディアファイルのフォーマット情報の取得を非同期で試みます。もし成功すれば、 `MediaFileData` オブジェクトを伴った `MediaFileDataSuccessCB` コールバック関数を呼び出します。もし失敗すれば、 `MediaFileDataErrorCB` コールバック関数を呼び出します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +BlackBerry WebWorks に関する注意点 +-------------------------- +メディアファイルのフォーマット情報を提供する API はありません。従って、全ての `MediaFileData` オブジェクトはデフォルト値で返されます。 + +Android に関する注意点 +-------------- +メディアファイルのフォーマット情報を取得する API は限定されています。従って、全ての `MediaFileData` のプロパティーがサポートされている訳ではありません。 + +iOS に関する注意点 +---------- +メディアファイルのフォーマット情報を取得する API は限定されています。従って、全ての `MediaFileData` のプロパティーがサポートされている訳ではありません。 diff --git a/docs/jp/2.9.0/cordova/media/capture/MediaFile.md b/docs/jp/2.9.0/cordova/media/capture/MediaFile.md new file mode 100755 index 0000000000..3792f0ba77 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/MediaFile.md @@ -0,0 +1,37 @@ +--- +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. +--- + +MediaFile +========= + +> メディアキャプチャーファイルのプロパティーをカプセル化します。 + +プロパティー +---------- + +- __name__: パス情報を含まないファイルの名前を表します。 (DOMString) +- __fullPath__: ファイルの名前を含むフルパスを表します。 (DOMString) +- __type__: ファイルの MIME 型を表します。 (DOMString) +- __lastModifiedDate__: ファイルの最終更新日時を表します。 (Date) +- __size__: ファイルのサイズをバイトで表します。 (Number) + +メソッド +------- + +- __MediaFile.getFormatData__: メディアファイルのフォーマット情報を取得します。 diff --git a/docs/jp/2.9.0/cordova/media/capture/MediaFileData.md b/docs/jp/2.9.0/cordova/media/capture/MediaFileData.md new file mode 100755 index 0000000000..ba27e6cd43 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/MediaFileData.md @@ -0,0 +1,65 @@ +--- +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. +--- + +MediaFileData +============= + +> メディアファイルのフォーマット情報をカプセル化します。 + +プロパティー +---------- + +- __codecs__: オーディオやビデオの実際のフォーマットを表します。 (DOMString) +- __bitrate__: ファイルの平均ビットレートを表します。画像の場合は、0 に設定されます。 (Number) +- __height__: 画像またはビデオの高さをピクセルで表します。オーディオの場合は、0 に設定されます。 (Number) +- __width__: 画像またはビデオの幅をピクセルで表します。オーディオの場合は、0 に設定されます。 (Number) +- __duration__: ビデオまたはオーディオの長さを秒で表します。画像の場合は、0 に設定されます。 (Number) + +BlackBerry WebWorks に関する注意点 +-------------------------- + +メディアファイルのフォーマット情報を提供する API はありません。 `MediaFileData` オブジェクトは、 `MediaFile.getFormatData` 関数によって返され、以下のようなデフォルト値を持ちます: + +- __codecs__: サポートされていません。この属性は常に `null` となります。 +- __bitrate__: サポートされていません。この属性は常に 0 となります。 +- __height__: サポートされていません。この属性は常に 0 となります。 +- __width__: サポートされていません。この属性は常に 0 となります。 +- __duration__: サポートされていません。この属性は常に 0 となります。 + +Android に関する注意点 +-------------- + +`MediaFileData` プロパティーへのサポートは以下のとおりです: + +- __codecs__: サポートされていません。この属性は常に `null` となります。 +- __bitrate__: サポートされていません。この属性は常に 0 となります。 +- __height__: サポートされています。 (画像及びビデオに限る) 。 +- __width__: サポートされています。 (画像及びビデオに限る) 。 +- __duration__: サポートされています。 (オーディオ及びビデオに限る) 。 + +iOS に関する注意点 +---------- + +`MediaFileData` プロパティーへのサポートは以下のとおりです: + +- __codecs__: サポートされていません。この属性は常に `null` となります。 +- __bitrate__: iOS4 のデバイスにおいて、オーディオのみサポートされています。この属性は、画像とビデオについては常に 0 となります。 +- __height__: サポートされています。 (画像及びビデオに限る) 。 +- __width__: サポートされています。 (画像及びビデオに限る) 。 +- __duration__: サポートされています。 (オーディオ及びビデオに限る) 。 diff --git a/docs/jp/2.9.0/cordova/media/capture/capture.md b/docs/jp/2.9.0/cordova/media/capture/capture.md new file mode 100755 index 0000000000..d21fdec37b --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/capture.md @@ -0,0 +1,121 @@ +--- +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. +--- + +Capture +======= + +> デバイスのオーディオ、イメージ、ビデオキャプチャー機能への制御を提供します。 + +**プライバシーに関する重要な注意点:** デバイスのカメラやマイクを使って、画像、動画、オーディオを利用する場合、プライバシーに関して重要な問題が発生します。 アプリケーションの [プライバシー・ポリシー](guide_getting-started_index.md.html) では、そのようなセンサーをどのように使用するのか、他のアプリケーションとデータを共有するのか否か、などを説明するべきです。加えて、アプリケーションがカメラやマイクを使用することが、ユーザーインタフェース上で明確ではない場合、アプリケーションがカメラやマイクにアクセスする前にユーザーへ通知を行うべきです (デバイスのOSが通知を行っていない場合)。この通知では、上記と同様の情報を提供し、ユーザーの許可を得るようにするべきです (例えば、"OK"と"NO"などの選択肢を表示するなど)。詳細は Privacy Guide を参照してください。 + +オブジェクト +------- + +- Capture +- CaptureAudioOptions +- CaptureImageOptions +- CaptureVideoOptions +- CaptureCB +- CaptureErrorCB +- ConfigurationData +- MediaFile +- MediaFileData + +メソッド +------- + +- capture.captureAudio +- capture.captureImage +- capture.captureVideo +- MediaFile.getFormatData + +スコープ +----- + +`capture` オブジェクトは `navigator.device` オブジェクトに割り当てられており、そのためグローバルスコープです。 + + // グローバル capture オブジェクト + var capture = navigator.device.capture; + +プロパティー +---------- + +- __supportedAudioModes__: デバイスによってサポートされているオーディオ録音のフォーマットです。 (ConfigurationData[]) +- __supportedImageModes__: デバイスによってサポートされている記録用の画像サイズやフォーマットです。 (ConfigurationData[]) +- __supportedVideoModes__: デバイスによってサポートされている記録用のビデオ解像度やフォーマットです。 (ConfigurationData[]) + +メソッド +------- + +- `capture.captureAudio`: オーディオ録音のために、デバイスのオーディオ録音アプリを起動します。 +- `capture.captureImage`: 画像取得のために、デバイスのカメラアプリを起動します。 +- `capture.captureVideo`: ビデオ録画のために、デバイスのビデオ録画アプリを起動します。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +パーミッション +----------- + +### Android + +#### app/res/xml/plugins.xml + + + +#### app/AndroidManifest.xml + + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + + +### iOS + +#### config.xml + + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + + + + diff --git a/docs/jp/2.9.0/cordova/media/capture/captureAudio.md b/docs/jp/2.9.0/cordova/media/capture/captureAudio.md new file mode 100755 index 0000000000..da853847ed --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/captureAudio.md @@ -0,0 +1,141 @@ +--- +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. +--- + +capture.captureAudio +==================== + +> オーディオ録音アプリを起動し、キャプチャーしたファイルの情報を返します。 + + navigator.device.capture.captureAudio( + CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options] + ); + +概要 +----------- + +このメソッドは、デバイスのデフォルトのオーディオ録音アプリを使用して、オーディオをキャプチャーするための非同期操作を開始します。この操作はユーザーに、単一セッションで複数のビデオのキャプチャーをユーザーに許可します。 + +キャプチャー操作は、ユーザーがオーディオ録音アプリを終了するか、 `CaptureAudioOptions.limit` で指定された最大録音回数に達した場合に終了します。もし `limit` パラメーターが指定されていない場合は、デフォルト値である1が使用され、キャプチャー操作はユーザーが1度オーディオを録音した後に終了します。 + +キャプチャー操作が終了した時、それぞれのオーディオ録音ファイル情報が書かれた `MediaFile` オブジェクトの配列を伴った `CaptureCB` コールバック関数を呼び出します。もしオーディオがキャプチャーされる前にユーザーによって操作が終了されたら、 `CaptureError.CAPTURE_NO_MEDIA_FILES` エラーコードを持つ `CaptureError` オブジェクトを伴った `CaptureErrorCB` コールバック関数が呼び出されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // capture コールバック関数 + var captureSuccess = function(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // ファイルを使用した処理 + } + }; + + // capture エラーコールバック関数 + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + + // オーディオキャプチャーを開始 + navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2}); + +詳細な使用例 +------------ + + + + + オーディオキャプチャー + + + + + + +
+ + + +BlackBerry WebWorks に関する注意点 +-------------------------- + +- Cordova for BlackBerry WebWorks は、オーディオ録音のために RIM より提供されている __Voice Notes Recorder__ の起動を試みます。デベロッパーは、もしアプリがインストールされていない場合は `CaptureError.CAPTURE_NOT_SUPPORTED` エラーを受け取ります。 + +iOS に関する注意点 +---------- + +- iOS にはデフォルトのオーディオ録音アプリがないため、シンプルなユーザーインターフェースが提供されます。 + +Windows Phone 7 と 8 に関する注意点 +---------- + +- Windows Phone 7 にはデフォルトのオーディオ録音アプリがないため、シンプルなユーザーインターフェースが提供されます。 diff --git a/docs/jp/2.9.0/cordova/media/capture/captureAudioOptions.md b/docs/jp/2.9.0/cordova/media/capture/captureAudioOptions.md new file mode 100755 index 0000000000..73dae9521b --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/captureAudioOptions.md @@ -0,0 +1,52 @@ +--- +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. +--- + +CaptureAudioOptions +=================== + +> オーディオキャプチャーのオプションをカプセル化します。 + +プロパティー +---------- + +- __limit__: 一つのキャプチャー操作で録音できるオーディオクリップの最大値を表します。値は1以上の必要があります (デフォルトは1です) 。 +- __duration__: オーディオクリップの最大録音時間を秒で表します。 + +使用例 +------------- + + // キャプチャー操作時のオーディオクリップの最大値を3に制限、最大録音時間を10秒に設定 + var options = { limit: 3, duration: 10 }; + + navigator.device.capture.captureAudio(captureSuccess, captureError, options); + +Android に関する注意点 +-------------- + +- `duration` パラメーターはサポートされていません。録画時間をプログラム的に制限することは出来ません。 + +BlackBerry WebWorks に関する注意点 +-------------------------- + +- `duration` パラメーターはサポートされていません。録画時間をプログラム的に制限することは出来ません。 + +iOS に関する注意点 +---------- + +- `limit` パラメーターはサポートされていません。1つのキャプチャー操作につき1つの録音が作られます。 diff --git a/docs/jp/2.9.0/cordova/media/capture/captureImage.md b/docs/jp/2.9.0/cordova/media/capture/captureImage.md new file mode 100755 index 0000000000..4a0aeb74ca --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/captureImage.md @@ -0,0 +1,131 @@ +--- +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. +--- + +capture.captureImage +==================== + +> カメラアプリを起動し、キャプチャーしたファイルの情報を返します。 + + navigator.device.capture.captureImage( + CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options] + ); + +概要 +----------- + +このメソッドは、デバイスのカメラアプリを使用して、画像をキャプチャーするための非同期操作を開始します。この操作はユーザーに、単一セッションで複数の画像のキャプチャーをユーザーに許可します。 + +キャプチャー操作は、ユーザーがカメラアプリを終了するか、 `CaptureImageOption.limit` パラメーターで指定された最大撮影回数に達した場合に終了します。もし `limit` パラメーターが指定されていない場合は、デフォルト値である1が使用され、キャプチャー操作はユーザーが1度画像を撮影した後に終了します。 + +キャプチャー操作が終了した時、それぞれの画像ファイル情報が書かれた `MediaFile` オブジェクトの配列を伴った `CaptureCB` コールバック関数を呼び出します。もし画像がキャプチャーされる前にユーザーによって操作が終了されたら、 `CaptureError.CAPTURE_NO_MEDIA_FILES` エラーコードを持つ `CaptureError` オブジェクトを伴った `CaptureErrorCB` コールバック関数が呼び出されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +Windows Phone 7 に関する注意点 +---------------------- + +Zune とデバイスが接続している間は、ネイティブカメラアプリケーションは起動せずに、エラーコールバックが呼び出されます。 + +使用例 +------------- + + // capture コールバック関数 + var captureSuccess = function(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // ファイルを使用した処理 + } + }; + + // capture エラーコールバック関数 + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + + // 画像のキャプチャーを開始 + navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2}); + +詳細な使用例 +------------ + + + + + 画像キャプチャー + + + + + + +
+ + diff --git a/docs/jp/2.9.0/cordova/media/capture/captureImageOptions.md b/docs/jp/2.9.0/cordova/media/capture/captureImageOptions.md new file mode 100755 index 0000000000..f28e8489a4 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/captureImageOptions.md @@ -0,0 +1,41 @@ +--- +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. +--- + +CaptureImageOptions +=================== + +> 画像キャプチャーのオプションをカプセル化します。 + +プロパティー +---------- + +- __limit__: 一つのキャプチャー操作で撮影できる画像の最大値を表します。値は1以上の必要があります (デフォルトは1です) 。 + +使用例 +------------- + + // キャプチャー操作時の取得画像の最大値を3に制限 + var options = { limit: 3 }; + + navigator.device.capture.captureImage(captureSuccess, captureError, options); + +iOS に関する注意点 +---------- + +- `limit` パラメーターはサポートされていません。1つのキャプチャー操作につき1つの画像が撮影されます。 diff --git a/docs/jp/2.9.0/cordova/media/capture/captureVideo.md b/docs/jp/2.9.0/cordova/media/capture/captureVideo.md new file mode 100755 index 0000000000..cd4f073885 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/captureVideo.md @@ -0,0 +1,131 @@ +--- +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. +--- + +capture.captureVideo +==================== + +> ビデオ録画アプリを起動し、キャプチャーしたビデオファイルの情報を返します。 + + navigator.device.capture.captureVideo( + CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options] + ); + +概要 +----------- + +このメソッドは、デバイスのビデオ録画アプリを使用して、ビデオをキャプチャーするための非同期操作を開始します。この操作はユーザーに、単一セッションで複数のビデオのキャプチャーをユーザーに許可します。 + +キャプチャー操作は、ユーザーがビデオ録画アプリを終了するか、 `CaptureVideoOptions.limit` で指定された最大録画回数に達した場合に終了します。もし `limit` パラメーターが指定されていない場合は、デフォルト値である1が使用され、キャプチャー操作はユーザーが1度ビデオを録画した後に終了します。 + +キャプチャー操作が終了した時、それぞれのビデオ録画ファイル情報が書かれた `MediaFile` オブジェクトの配列を伴った `CaptureCB` コールバック関数を呼び出します。もしオーディオがキャプチャーされる前にユーザーによって操作が終了されたら、 `CaptureError.CAPTURE_NO_MEDIA_FILES` エラーコードを持つ `CaptureError` オブジェクトを伴った `CaptureErrorCB` コールバック関数が呼び出されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // capture コールバック関数 + var captureSuccess = function(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // ファイルを使用した処理 + } + }; + + // capture エラーコールバック関数 + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + + // ビデオキャプチャーを開始 + navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2}); + +詳細な使用例 +------------ + + + + + ビデオキャプチャー + + + + + + +
+ + + +BlackBerry WebWorks に関する注意点 +-------------------------- + +- Cordova for BlackBerry WebWorks は、ビデオ録画のために RIM より提供されている __Video Recorder__ の起動を試みます。デベロッパーは、もしアプリがインストールされていない場合は `CaptureError.CAPTURE_NOT_SUPPORTED` エラーを受け取ります。 diff --git a/docs/jp/2.9.0/cordova/media/capture/captureVideoOptions.md b/docs/jp/2.9.0/cordova/media/capture/captureVideoOptions.md new file mode 100755 index 0000000000..09fe157d68 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/capture/captureVideoOptions.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. +--- + +CaptureVideoOptions +=================== + +> ビデオキャプチャーのオプションをカプセル化します。 + +プロパティー +---------- + +- __limit__: 一つのキャプチャー操作で録画できるビデオの最大値を表します。値は1以上の必要があります (デフォルトは1です) 。 +- __duration__: ビデオクリップの最大録画時間を秒で表します。 + +使用例 +------------- + + // キャプチャー操作時のビデオクリップの最大値を3に制限 + var options = { limit: 3 }; + + navigator.device.capture.captureVideo(captureSuccess, captureError, options); + +BlackBerry WebWorks に関する注意点 +-------------------------- + +- __duration__ パラメーターはサポートされていません。 録画時間をプログラム的に制限することは出来ません。 + +iOS に関する注意点 +---------- + +- __limit__ パラメーターはサポートされていません。1つのキャプチャー操作につき1つのビデオが録画されます。 diff --git a/docs/jp/2.9.0/cordova/media/media.getCurrentPosition.md b/docs/jp/2.9.0/cordova/media/media.getCurrentPosition.md new file mode 100755 index 0000000000..d375734966 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.getCurrentPosition.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.getCurrentPosition +======================== + +オーディオファイル内の現在の再生位置を返します。 + + media.getCurrentPosition(mediaSuccess, [mediaError]); + +パラメーター +---------- + +- __mediaSuccess__: 現在再生位置とともに呼ばれるコールバック関数を表します +- __mediaError__: (オプション) エラー発生時に呼ばれるコールバック関数を表します + +概要 +----------- + +`media.getCurrentPosition` メソッドは `Media` オブジェクトのオーディオファイルの現在再生位置を返す非同期関数です。 `Media` オブジェクトの `position` パラメーターの値も更新します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + + // メディアの再生位置を一秒ごとに更新 + var mediaTimer = setInterval(function() { + // 再生位置を取得 + my_media.getCurrentPosition( + // 呼び出し成功 + function(position) { + if (position > -1) { + console.log((position) + " sec"); + } + }, + // 呼び出し失敗 + function(e) { + console.log("Error getting pos=" + e); + } + ); + }, 1000); + + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + diff --git a/docs/jp/2.9.0/cordova/media/media.getDuration.md b/docs/jp/2.9.0/cordova/media/media.getDuration.md new file mode 100755 index 0000000000..d43a68dc5d --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.getDuration.md @@ -0,0 +1,167 @@ +--- +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.getDuration +================= + +オーディオファイルの再生時間を返します。 + + media.getDuration(); + + +概要 +----------- + +`media.getDuration` メソッドは秒単位でオーディオファイルの再生時間を同期的に返します。再生時間が不明な場合は、-1 が返されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + + // 再生時間を取得 + var counter = 0; + var timerDur = setInterval(function() { + counter = counter + 100; + if (counter > 2000) { + clearInterval(timerDur); + } + var dur = my_media.getDuration(); + if (dur > 0) { + clearInterval(timerDur); + document.getElementById('audio_duration').innerHTML = (dur) + " sec"; + } + }, 100); + + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + diff --git a/docs/jp/2.9.0/cordova/media/media.md b/docs/jp/2.9.0/cordova/media/media.md new file mode 100755 index 0000000000..886b607e37 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.md @@ -0,0 +1,131 @@ +--- +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 +===== + +> `Media` オブジェクトは、デバイス上でのオーディオファイルの再生や録音などといった機能をサポートします。 + + var media = new Media(src, mediaSuccess, [mediaError], [mediaStatus]); + + +__注意__: 現在の実装はメディアキャプチャーに関する W3C の仕様を満たしていません。利便性のためだけに提供されています。将来的には最新の W3C の仕様に合わせるとともに、現在の API を廃止することも検討されています。 + +パラメーター +---------- + +- __src__: オーディオコンテンツを示す URI を表します _(DOMString)_ +- __mediaSuccess__: (オプション) `Media` オブジェクトが再生、録音、停止などのアクションを完了したときに呼ばれるコールバック関数を表します _(Function)_ +- __mediaError__: (オプション) エラー発生時に呼ばれるコールバック関数を表します _(Function)_ +- __mediaStatus__: (オプション) ステータスが変わったときに呼ばれるコールバック関数を表します _(Function)_ + +定数 +--------- + +以下の定数は `mediaStatus` コールバック関数への引数としてのみ使用されます。 + +- `Media.MEDIA_NONE` = 0; +- `Media.MEDIA_STARTING` = 1; +- `Media.MEDIA_RUNNING` = 2; +- `Media.MEDIA_PAUSED` = 3; +- `Media.MEDIA_STOPPED` = 4; + +メソッド +------- + +- `media.getCurrentPosition`: オーディオファイル内の現在の再生位置を返します +- `media.getDuration`: オーディオファイルの再生時間を返します +- `media.play`: オーディオファイルを再生または再開します +- `media.pause`: オーディオファイルを一時停止します +- `media.release`: OS のオーディオリソースを開放します +- `media.seekTo`: オーディオファイル中の再生位置を動かします +- `media.setVolume`: オーディオの再生音量を設定します +- `media.startRecord`: オーディオファイルの録音を開始します +- `media.stopRecord`: オーディオファイルの録音を停止します +- `media.stop`: オーディオファイルを停止します + +追加の読み取り専用パラメーター +--------------------- + +- __position__: 再生位置を秒単位で表します。 + - 再生中は自動的に値が更新されないので、 `getCurrentPosition` メソッドを呼び、値を更新します +- __duration__: メディアの再生時間を秒単位で表します + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7.5 +- Windows 8 + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest.xml + + + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +### iOS + +#### config.xml + + Plugins + + Media + CDVSound + + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) + +### Tizen + + パーミッションの設定は必要ありません。 + +### Windows Phone に関する注意点 + - 一度に一つのメディアファイルのみ再生できます。 + - アプリケーションが他のメディアとどのように関わるかには、厳しい制限があります。詳しくは http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh184838(v=vs.92).aspx を参照してください。 diff --git a/docs/jp/2.9.0/cordova/media/media.pause.md b/docs/jp/2.9.0/cordova/media/media.pause.md new file mode 100755 index 0000000000..de3f3cb728 --- /dev/null +++ b/docs/jp/2.9.0/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 +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオ再生 + // + 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); + } + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + diff --git a/docs/jp/2.9.0/cordova/media/media.play.md b/docs/jp/2.9.0/cordova/media/media.play.md new file mode 100755 index 0000000000..8bec51695f --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.play.md @@ -0,0 +1,191 @@ +--- +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 +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオ再生 + // + 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(); + } + + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + + +BlackBerry WebWorks に関する注意点 +---------- + +- BlackBerry は同時に再生できるオーディオの数が決まっています。 CDMA デバイスは1つのオーディオのみサポートしています。他のデバイスは2つまで同時再生をサポートしています。サポートされている数以上のオーディオファイルを再生することは、直前の再生オーディオを停止することに繋がります。 + +iOS に関する注意点 +--------- + +- __numberOfLoops__: このオプションを `play` メソッドに渡すことで、そのメディアファイルを何回再生するかを指定します。例: + + var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3") + myMedia.play({ numberOfLoops: 2 }) + +- __playAudioWhenScreenIsLocked__: このオプションを `play` メソッドに渡すことで、スクリーンがロックされた状態でもオーディオを再生するかどうかを指定します (設定しなかった場合、デフォルトは `true` です) 。もし `true` にセットされた場合は、ハードウェアのミュートボタンの設定は無視されます。例: + + var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3") + myMedia.play({ playAudioWhenScreenIsLocked : false }) + +- __order of file search__: ファイル名か単なるパスを渡した場合、 iOS はまず `www` ディレクトリ内を検索し、その後アプリケーションの `documents/tmp` ディレクトリ内を検索します。 + + var myMedia = new Media("audio/beer.mp3") + myMedia.play() // 最初に www/audio/beer.mp3 内でファイルを検索し、その後 /documents/tmp/audio/beer.mp3 を検索します diff --git a/docs/jp/2.9.0/cordova/media/media.release.md b/docs/jp/2.9.0/cordova/media/media.release.md new file mode 100755 index 0000000000..fe55f06b20 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.release.md @@ -0,0 +1,156 @@ +--- +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 にとって重要な関数です。 `Media` リソースが不要になった場合には、 `release` メソッドを使用してください。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + + my_media.play(); + my_media.stop(); + my_media.release(); + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + diff --git a/docs/jp/2.9.0/cordova/media/media.seekTo.md b/docs/jp/2.9.0/cordova/media/media.seekTo.md new file mode 100755 index 0000000000..9ed3d75362 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.seekTo.md @@ -0,0 +1,159 @@ +--- +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 +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + my_media.play(); + // 5秒後に、10秒の位置まで移動 + setTimeout(function() { + my_media.seekTo(10000); + }, 5000); + + +Full Example +------------ + + + + + メディアの使用例 + + + + + + 再生 + 停止 +

+ + + +BlackBerry WebWorks に関する注意点 +---------- + +- この API は BlackBerry OS 5 デバイスではサポートされていません。 diff --git a/docs/jp/2.9.0/cordova/media/media.setVolume.md b/docs/jp/2.9.0/cordova/media/media.setVolume.md new file mode 100755 index 0000000000..58d662741d --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.setVolume.md @@ -0,0 +1,178 @@ +--- +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.setVolume +=========== + +オーディオファイルの音量を設定します。 + + media.setVolume(volume); + +パラメーター +--------- + +- __volume__: 再生音量。 0.0 から 1.0 の間で設定します。 + +概要 +----------- + +`media.setVolume` メソッドはオーディオ再生中に音量を設定する非同期メソッドです。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS + +使用例 +------------- + + // オーディオ再生 + // + function playAudio(url) { + // Play the audio file at url + var my_media = new Media(url, + // 成功時コールバック関数 + function() { + console.log("playAudio():Audio Success"); + }, + // 失敗時コールバック関数 + function(err) { + console.log("playAudio():Audio Error: "+err); + }); + + // オーディオ再生 + my_media.play(); + + // 2秒後に音を消す + setTimeout(function() { + my_media.setVolume('0.0'); + }, 2000); + + // 5秒後に音量を最大にする + setTimeout(function() { + my_media.setVolume('1.0'); + }, 5000); + } + + +Full Example +------------ + + + + + Media Example + + + + + + Play Audio + Mute Audio + Unmute Audio + Stop Playing Audio +

+ + \ No newline at end of file diff --git a/docs/jp/2.9.0/cordova/media/media.startRecord.md b/docs/jp/2.9.0/cordova/media/media.startRecord.md new file mode 100755 index 0000000000..447340b0e3 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.startRecord.md @@ -0,0 +1,156 @@ +--- +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 +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオの録音 + // + 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(); + } + + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

オーディオを録音...

+

+ + + +Android に関する注意点 +---------- + +- Android デバイスはオーディオを Adaptive Multi-Rate フォーマットで録音します。ファイル名は `.amr` 拡張子で指定される必要があります。 + +BlackBerry WebWorks に関する注意点 +---------- + +- BlackBerry デバイスはオーディオを Adaptive Multi-Rate フォーマットで録音します。ファイル名は `.amr` 拡張子で指定される必要があります。 + +iOS に関する注意点 +---------- + +- iOS では `.wav` 形式でのみ録音できます。拡張子が正しくない場合、エラーとなります。 +- 絶対パス以外を渡した場合、録音内容はアプリケーションの `documents/tmp` に置かれます。この録音内容には `File` API で `LocalFileSystem.TEMPORARY` を使ってアクセスできます。サブディレクトリを指定する場合、録音時にそのディレクトリが存在していなければなりません。 +- documents URIを使用してファイルに録音でき、かつファイルを再生できます。 + + var myMedia = new Media("documents://beer.mp3") + +Tizen に関する注意点 +---------- + +- この API は Tizen デバイスではサポートされていません。 diff --git a/docs/jp/2.9.0/cordova/media/media.stop.md b/docs/jp/2.9.0/cordova/media/media.stop.md new file mode 100755 index 0000000000..e12e871565 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.stop.md @@ -0,0 +1,171 @@ +--- +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 +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオ再生 + // + 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); + } + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + diff --git a/docs/jp/2.9.0/cordova/media/media.stopRecord.md b/docs/jp/2.9.0/cordova/media/media.stopRecord.md new file mode 100755 index 0000000000..dbbcbfbaa8 --- /dev/null +++ b/docs/jp/2.9.0/cordova/media/media.stopRecord.md @@ -0,0 +1,143 @@ +--- +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 +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // オーディオの録音 + // + 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); + } + + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

オーディオを録音...

+

+ + + + +Tizen に関する注意点 +---------- + +- この API は Tizen デバイスではサポートされていません。 diff --git a/docs/jp/2.9.0/cordova/notification/notification.alert.md b/docs/jp/2.9.0/cordova/notification/notification.alert.md new file mode 100755 index 0000000000..bf2c1c9c6b --- /dev/null +++ b/docs/jp/2.9.0/cordova/notification/notification.alert.md @@ -0,0 +1,114 @@ +--- +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 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // Android / BlackBerry WebWorks (OS 5.0 以上) / iOS / Tizen + // + function alertDismissed() { + // 任意のコード + } + + navigator.notification.alert( + 'あなたの勝ちです!', // メッセージ + alertDismissed, // コールバック関数 + 'ゲームオーバー', // タイトル + '終了' // ボタン名 + ); + +詳細な使用例 +------------ + + + + + Notification の使用例 + + + + + +

通知を表示

+ + + +Windows Phone 7 に関する注意点 +------------- + +- ビルトインのブラウザ通知ダイアログ機能はありませんが、以下のように実装することで `alert()` をグローバルスコープで呼び出せます: + + window.alert = navigator.notification.alert; + +- 通知 (`alert`) と確認 (`confirm`) の呼び出しはノンブロッキングで、結果は非同期でのみ取得可能です。 diff --git a/docs/jp/2.9.0/cordova/notification/notification.beep.md b/docs/jp/2.9.0/cordova/notification/notification.beep.md new file mode 100755 index 0000000000..1901c0b02e --- /dev/null +++ b/docs/jp/2.9.0/cordova/notification/notification.beep.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. +--- + +notification.beep +================= + +デバイスが警告音を鳴らします。 + + navigator.notification.beep(times); + +- __times__: 警告音を鳴らす回数を表します _(Number)_ + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 + +使用例 +------------- + + // 警告音を2回鳴らす + navigator.notification.beep(2); + +詳細な使用例 +------------ + + + + + Notification の使用例 + + + + + +

通知を表示

+

警告音を鳴らす

+

バイブレーション

+ + + +Android に関する注意点 +-------------- + +- Android では、 _Settings/Sound & Display_ パネルで設定されたデフォルトの _Notification ringtone_ を鳴らします。 + +iOS に関する注意点 +------------- + +- 引数の警告音の回数を無視します。 +- iPhone はネイティブの beep API を持っていません。 + - Cordova は media API を使って、オーディオファイルを再生することで警告音を実装しています。 + - ユーザーは適切な警告音のファイルを用意する必要があります。 + - このファイルは30秒未満とし、 `www` のルートディレクトリ に `beep.wav` として保存してください。 + +Windows Phone 7 と 8 に関する注意点 +------------- + +- Cordova ライブラリは独自の警告音ファイルを含んでおり、それを使用しています。 + +Tizen に関する注意点 +------------- + + - Tizen は media API を使って、オーディオファイルを再生することで警告音を実装しています。 + - 警告音の再生時間は短い必要があります。また、そのオーディオファイルを `beep.wav` という名前でアプリケーションのルートディレクトリの `sounds` サブディレクトリに保存してください。 diff --git a/docs/jp/2.9.0/cordova/notification/notification.confirm.md b/docs/jp/2.9.0/cordova/notification/notification.confirm.md new file mode 100755 index 0000000000..0ffd451f37 --- /dev/null +++ b/docs/jp/2.9.0/cordova/notification/notification.confirm.md @@ -0,0 +1,125 @@ +--- +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) とともに呼び出されるコールバック関数を表します。このコールバック関数は、ボタンを押さずにダイアログが消えた場合には、 インデクスを 0 として呼び出されます。 _(Function)_ +- __title__: ダイアログのタイトルを表します _(String)_ (オプション, デフォルト: "Confirm") +- __buttonLabels__: ボタンのラベルを設定するためのカンマ区切りの文字列を表します _(String)_ (オプション, デフォルト: "OK,Cancel") + +概要 +----------- + +`notification.confirm` メソッドは、ブラウザの `confirm` 関数よりも広いカスタマイズ性を持ったネイティブダイアログボックスを表示します。 + +confirmCallback +--------------- + +`confirmCallback` はユーザーが確認ダイアログのいずれかのボタンが押したときに呼び出されます。 + +コールバックは、押されたボタンを表すインデックス `buttonIndex` _(Number)_ を引数にとります。このインデックスは、 `1`, `2`, `3` のように1始まりであることに注意してください。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iPhone +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +使用例 +------------- + + // 確認ダイアログの表示プロセスの開始 + function onConfirm(buttonIndex) { + alert('選択されたボタン ' + buttonIndex); + } + + // カスタム確認ダイアログを表示 + // + function showConfirm() { + navigator.notification.confirm( + 'あなたの勝ちです!', // メッセージ + onConfirm, // 選択されたボタン情報とともに呼ばれるコールバック関数 + 'ゲームオーバー', // タイトル + 'リスタート,終了' // ボタン + ); + } + +詳細な使用例 +------------ + + + + + Notification の使用例 + + + + + +

確認ダイアログを表示

+ + + +Windows Phone 7 と 8 に関する注意点 +---------------------- + +- `window.confirm` に対応するビルトインのブラウザ確認ダイアログ機能はありませんが、以下のように確認ダイアログを追加できます: + + window.confirm = navigator.notification.confirm; + +- 通知 (`alert`) と確認 (`confirm`) の呼び出しはノンブロッキングで、結果は非同期でのみ取得可能です。 diff --git a/docs/jp/2.9.0/cordova/notification/notification.md b/docs/jp/2.9.0/cordova/notification/notification.md new file mode 100755 index 0000000000..070349a3a9 --- /dev/null +++ b/docs/jp/2.9.0/cordova/notification/notification.md @@ -0,0 +1,69 @@ +--- +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.prompt` +- `notification.beep` +- `notification.vibrate` + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### app/AndroidManifest.xml + + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + +### iOS + +#### config.xml + + + +### Windows Phone + + パーミッションの設定は必要ありません。 + +### Tizen + + パーミッションの設定は必要ありません。 diff --git a/docs/jp/2.9.0/cordova/notification/notification.prompt.md b/docs/jp/2.9.0/cordova/notification/notification.prompt.md new file mode 100755 index 0000000000..2a9437aa01 --- /dev/null +++ b/docs/jp/2.9.0/cordova/notification/notification.prompt.md @@ -0,0 +1,121 @@ +--- +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.prompt +==================== + +カスタマイズ可能な入力ダイアログボックスを表示します。 + + navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText]) + +- __message__: ダイアログのメッセージ _(String)_ +- __promptCallback__: ボタンが押された際に呼び出されるコールバック関数 _(Function)_ +- __title__: ダイアログのタイトル _(String)_ (オプション、デフォルト値は `Prompt`) +- __buttonLabels__: 各ボタン名を要素とする配列 _(Array)_ (オプション、デフォルト値は `["OK","Cancel"]`) +- __defaultText__: デフォルトのテキストボックス入力値 _(String)_ (オプション、デフォルト値は "Default text") + +概要 +----------- + +`notification.prompt` メソッドは、ブラウザの `prompt` 関数よりも広いカスタマイズ性を持ったネイティブダイアログボックスを表示します。 + +promptCallback +--------------- + +ユーザーが入力ダイアログボックスのボタンを押した際に、 `promptCallback` は呼び出されます。このコールバック関数へ渡される `result` オブジェクトは以下のプロパティを持っています: + +- __buttonIndex__: 押されたボタンのインデクス _(Number)_ 。 このインデックスは、 `1`, `2`, `3` のように1始まりであることに注意してください。 +- __input1__: 入力ダイアログボックスに入力されたテキスト _(String)_ + +サポートされているプラットフォーム +------------------- + +- Android +- iOS + +使用例 +------------- + + // 入力ダイアログへの結果を処理する + function onPrompt(results) { + alert("You selected button number " + results.buttonIndex + " and entered " + results.input1); + } + + // カスタム入力ダイアログを表示す + // + function showPrompt() { + navigator.notification.prompt( + 'Please enter your name', // message + onPrompt, // callback to invoke + 'Registration', // title + ['Ok','Exit'], // buttonLabels + 'Jane Doe' // defaultText + ); + } + +詳細な使用例 +------------ + + + + + Notification Prompt Dialog Example + + + + + +

Show Prompt

+ + + +Android に関する注意点 +---------------------- + +- Android は最大 3 個までのボタンをサポートしています。それ以上のボタンを設定しても無視されます。 +- Android 3.0 以降、 Holo テーマを使っているデバイスではボタンの表示順が反対になります。 diff --git a/docs/jp/2.9.0/cordova/notification/notification.vibrate.md b/docs/jp/2.9.0/cordova/notification/notification.vibrate.md new file mode 100755 index 0000000000..b7b3ccbe84 --- /dev/null +++ b/docs/jp/2.9.0/cordova/notification/notification.vibrate.md @@ -0,0 +1,102 @@ +--- +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 以上) +- iOS +- Windows Phone 7 and 8 + +使用例 +------------- + + // 2.5秒間バイブレーションさせます + // + navigator.notification.vibrate(2500); + +詳細な使用例 +------------ + + + + + Notification の使用例 + + + + + +

通知を表示

+

警告音を鳴らす

+

バイブレーション

+ + + +iOS に関する注意点 +------------- + +- __time__: 引数のバイブレーションの長さを無視し、あらかじめ定められた時間バイブレーションします。 + + navigator.notification.vibrate(); + navigator.notification.vibrate(2500); // 2500は無視されます diff --git a/docs/jp/2.9.0/cordova/splashscreen/splashscreen.hide.md b/docs/jp/2.9.0/cordova/splashscreen/splashscreen.hide.md new file mode 100755 index 0000000000..b2987cc817 --- /dev/null +++ b/docs/jp/2.9.0/cordova/splashscreen/splashscreen.hide.md @@ -0,0 +1,78 @@ +--- +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. +--- + +splashscreen.hide +=============== + +スプラッシュスクリーンを非表示にします。 + + navigator.splashscreen.hide(); + +概要 +----------- + +`navigator.splashscreen.hide()` はアプリケーションのスプラッシュスクリーンを非表示にします。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS + +使用例 +------------- + + navigator.splashscreen.hide(); + +詳細な使用例 +------------ + + + + + スプラッシュスクリーン使用例 + + + + + +

Example

+ + + +iOS に関する注意点 +------------ + +config.xml で `AutoHideSplashScreen` を `false` に設定する必要があります。もしスプラッシュスクリーンを非表示にするのを 2 秒間遅らせたい場合は、 `deviceready` イベントハンドラー内で以下のように設定します: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); diff --git a/docs/jp/2.9.0/cordova/splashscreen/splashscreen.md b/docs/jp/2.9.0/cordova/splashscreen/splashscreen.md new file mode 100755 index 0000000000..3facd952a3 --- /dev/null +++ b/docs/jp/2.9.0/cordova/splashscreen/splashscreen.md @@ -0,0 +1,79 @@ +--- +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. +--- + +Splashscreen +========== + +> アプリケーションのスプラッシュスクリーンを開発者が表示/非表示できるようにします。 + + +メソッド +------- + +- splashscreen.show +- splashscreen.hide + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +### iOS + +#### config.xml + + + +Setup +----- + +### Android + +1. スプラッシュスクリーンの画像を Android プロジェクトの res/drawable ディレクトリーにコピーします。画像の各サイズは以下のとおりです: + + - xlarge (xhdpi): 少なくとも 960 x 720 + - large (hdpi): 少なくとも 640 x 480 + - medium (mdpi): 少なくとも 470 x 320 + - small (ldpi): 少なくとも 426 x 320 + + スプラッシュスクリーンには [9-patch 画像](https://developer.android.com/tools/help/draw9patch.html) を使用することをお勧めします。 + +2. DroidGap を継承したクラスの onCreate メソッドに、次の2行を追加します: + + super.setIntegerProperty("splashscreen", R.drawable.splash); + super.loadUrl("file:///android_asset/www/index.html", 10000); + + 最初の行ではスプラッシュスクリーンに表示する画像を設定しています。もし名前を `splash.png` 以外にしている場合は、この行を編集する必要があります。 + 次の行 'super.loadUrl' の第2引数はスプラッシュスクリーンのタイムアウトの値です。この例では、スプラッシュスクリーンは 10 秒間表示されます。もしスプラッシュスクリーンを `deviceready` イベントを取得した時に非表示にしたい場合は、 `navigator.splashscreen.hide()` メソッドを呼び出します。 + +### iOS + +スプラッシュスクリーンの画像を iOS プロジェクトの `Resources/splash` ディレクトリーにコピーします。サポートしたいデバイス向けの画像のみ追加するようにしてください (iPad または iPhone のスクリーンサイズ)。画像の各サイズは以下のとおりです: + + - Default-568h@2x~iphone.png (640x1136 pixels) + - Default-Landscape@2x~ipad.png (2048x1496 pixels) + - Default-Landscape~ipad.png (1024x748 pixels) + - Default-Portrait@2x~ipad.png (1536x2008 pixels) + - Default-Portrait~ipad.png (768x1004 pixels) + - Default@2x~iphone.png (640x960 pixels) + - Default~iphone.png (320x480 pixels) diff --git a/docs/jp/2.9.0/cordova/splashscreen/splashscreen.show.md b/docs/jp/2.9.0/cordova/splashscreen/splashscreen.show.md new file mode 100755 index 0000000000..ec0d1addbe --- /dev/null +++ b/docs/jp/2.9.0/cordova/splashscreen/splashscreen.show.md @@ -0,0 +1,69 @@ +--- +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. +--- + +splashscreen.show +=============== + +スプラッシュスクリーンを表示します。 + + navigator.splashscreen.show(); + +概要 +----------- + +`navigator.splashscreen.show()` はアプリケーションのスプラッシュスクリーンを表示します。 + +サポートされているプラットフォーム +------------------- + +- Android +- iOS + +使用例 +------------- + + navigator.splashscreen.show(); + +詳細な使用例 +------------ + + + + + スプラッシュスクリーン使用例 + + + + + +

Example

+ + diff --git a/docs/jp/2.9.0/cordova/storage/database/database.md b/docs/jp/2.9.0/cordova/storage/database/database.md new file mode 100755 index 0000000000..4d05f453bd --- /dev/null +++ b/docs/jp/2.9.0/cordova/storage/database/database.md @@ -0,0 +1,120 @@ +--- +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 +======= + +SQL データベースの操作に必要なメソッドを提供します。 + +メソッド +------- + +- __transaction__: データベースのトランザクションを実行します +- __changeVersion__: スクリプトがデータベースのバージョンを自動的に確認し、スキーマのアップデートと同時にバージョンを変更します + +詳細 +------- + +`Database` オブジェクトは `window.openDatabase()` メソッド呼び出し時に返されるオブジェクトです。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Tizen + +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"); + +詳細な使用例 +------------ + + + + + Storage の使用例 + + + + + +

Example

+

Database

+ + + diff --git a/docs/jp/2.9.0/cordova/storage/localstorage/localstorage.md b/docs/jp/2.9.0/cordova/storage/localstorage/localstorage.md new file mode 100755 index 0000000000..49bd2cfa6e --- /dev/null +++ b/docs/jp/2.9.0/cordova/storage/localstorage/localstorage.md @@ -0,0 +1,118 @@ +--- +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__: 全てのキーとアイテムを削除します + +詳細 +----------- + +`window.localStorage` インタフェースは W3C Web Storage インターフェースに基づいて実装されています。キーと値のペアでデータを永続的に保存できます。 `window.sessionStorage` は同じインターフェースを提供しますが、アプリが起動するたびにこの値はクリアされます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Tizen +- Windows Phone 7 and 8 + +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(); + +詳細な使用例 +------------ + + + + + Storage の使用例 + + + + + +

使用例

+

localStorage のサンプル

+ + + + +Windows Phone 7 に関する注意点 +------------- + +- ドット表記は Windows Phone では使用できません。 `window.localStorage` の `setItem` もしくは `getItem` メソッドを使用して下さい。 W3C の仕様で定義されている `window.localStorage.someKey` の方法は使用しないでください。 diff --git a/docs/jp/2.9.0/cordova/storage/parameters/display_name.md b/docs/jp/2.9.0/cordova/storage/parameters/display_name.md new file mode 100644 index 0000000000..f4a780f45c --- /dev/null +++ b/docs/jp/2.9.0/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 +================== + +実際に表示されるデータベース名です。 diff --git a/docs/jp/2.9.0/cordova/storage/parameters/name.md b/docs/jp/2.9.0/cordova/storage/parameters/name.md new file mode 100644 index 0000000000..069bcc2ef2 --- /dev/null +++ b/docs/jp/2.9.0/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 +============ + +データベース名です。 diff --git a/docs/jp/2.9.0/cordova/storage/parameters/size.md b/docs/jp/2.9.0/cordova/storage/parameters/size.md new file mode 100644 index 0000000000..7e726c358b --- /dev/null +++ b/docs/jp/2.9.0/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 +============== + +データベースのサイズです。バイト単位で表されます。 diff --git a/docs/jp/2.9.0/cordova/storage/parameters/version.md b/docs/jp/2.9.0/cordova/storage/parameters/version.md new file mode 100644 index 0000000000..a24b4e13cc --- /dev/null +++ b/docs/jp/2.9.0/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 +============= + +データベースのバージョンです。 diff --git a/docs/jp/2.9.0/cordova/storage/sqlerror/sqlerror.md b/docs/jp/2.9.0/cordova/storage/sqlerror/sqlerror.md new file mode 100755 index 0000000000..aee1cc72b8 --- /dev/null +++ b/docs/jp/2.9.0/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` オブジェクトです。 + diff --git a/docs/jp/2.9.0/cordova/storage/sqlresultset/sqlresultset.md b/docs/jp/2.9.0/cordova/storage/sqlresultset/sqlresultset.md new file mode 100755 index 0000000000..b0818f70bc --- /dev/null +++ b/docs/jp/2.9.0/cordova/storage/sqlresultset/sqlresultset.md @@ -0,0 +1,137 @@ +--- +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 つのプロパティーを持っています。 + +- `insertId` は SQL の insert 文が成功した行の番号を返します。もし SQL 文が insert 文では無かった場合、 `insertId` はセットされません。 +- `rowsAffected` は SQL の select 文に対しては常に 0 を返します。 insert もしくは update 文に対しては、修正された行数を返します。 +- `SQLResultSetList` は、 SQL の select 文によって返されたデータを保持します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Tizen + +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); + +詳細な使用例 +------------ + + + + + Storage の使用例 + + + + + +

使用例

+

データベース

+ + diff --git a/docs/jp/2.9.0/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md b/docs/jp/2.9.0/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md new file mode 100755 index 0000000000..f33521ebf1 --- /dev/null +++ b/docs/jp/2.9.0/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.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. +--- + +SQLResultSetRowList +======= + +SQL 問い合わせから返される行を保持した `SQLResultSet` のプロパティーのうちの1つです。 + +プロパティー +------- + +- __length__: SQL 問い合わせによって返される行の行数を表します + +メソッド +------- + +- __item__: 指定された行を JavaScript オブジェクトとして返します + +詳細 +------- + +`SQLResultSetRowList` は SQL の select 文によって返されるデータを保持しています。このオブジェクトは select 文によって返された行の数を表す `length` プロパティーを持っています。ある行のデータを取得するためには、行番号を指定した `item` メソッドを使用します。この `item` メソッドは JavaScript オブジェクトを返します。この JavaScript オブジェクトは select 文が実行されたデータベースのカラムをプロパティーとして持っています。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Tizen + +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 + + + Storage の使用例 + + + + + +

使用例

+

データベース

+ + diff --git a/docs/jp/2.9.0/cordova/storage/sqltransaction/sqltransaction.md b/docs/jp/2.9.0/cordova/storage/sqltransaction/sqltransaction.md new file mode 100755 index 0000000000..a58ada76f8 --- /dev/null +++ b/docs/jp/2.9.0/cordova/storage/sqltransaction/sqltransaction.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. +--- + +SQLTransaction +======= + +データベースに対して複数の SQL 文を実行するためのメソッドを提供します。 + +メソッド +------- + +- __executeSql__: SQL 文を実行します + +詳細 +------- + +`Database` オブジェクトの transaction メソッドを呼ぶとき、それに対応するコールバック関数が `SQLTransaction` オブジェクトと一緒に呼び出されます。 executeSql メソッドを複数回使用することで、データベーストランザクションを作成できます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Tizen + +Execute SQL の例 +------------------ + + 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); + } + + function successCB() { + alert("成功しました。"); + } + + var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000); + db.transaction(populateDB, errorCB, successCB); + +詳細な使用例 +------------ + + + + + Storage の使用例 + + + + + +

使用例

+

SQLトランザクション

+ + diff --git a/docs/jp/2.9.0/cordova/storage/storage.md b/docs/jp/2.9.0/cordova/storage/storage.md new file mode 100755 index 0000000000..6c91ba28ca --- /dev/null +++ b/docs/jp/2.9.0/cordova/storage/storage.md @@ -0,0 +1,73 @@ +--- +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. +--- + +Storage +========== + +> デバイスのストレージにアクセスする機能を提供します。 + +この API は [W3C Web SQL Database 仕様書](http://dev.w3.org/html5/webdatabase/) と [W3C Web Storage API 仕様書](http://dev.w3.org/html5/webstorage/) をベースとしています。いくつかのデバイスではすでにこの機能の実装を提供しています。これらについては、 Cordova の実装ではなくビルトインのサポートが実行されます。ストレージのサポートがされてないデバイスについては、 Cordova の実装によって W3C の仕様に沿った機能が提供されます。 + +メソッド +------- + +- openDatabase + +引数 +--------- + +- database_name +- database_version +- database_displayname +- database_size + +オブジェクト +------- + +- Database +- SQLTransaction +- SQLResultSet +- SQLResultSetRowList +- SQLError +- localStorage + +パーミッション +----------- + +### Android + +#### app/res/xml/config.xml + + + +#### www/config.xml + + + +### iOS + + パーミッションの設定は必要ありません。 + +### Windows Phone + + パーミッションの設定は必要ありません。 + +### Tizen + + パーミッションの設定は必要ありません。 diff --git a/docs/jp/2.9.0/cordova/storage/storage.opendatabase.md b/docs/jp/2.9.0/cordova/storage/storage.opendatabase.md new file mode 100755 index 0000000000..f437098fb3 --- /dev/null +++ b/docs/jp/2.9.0/cordova/storage/storage.opendatabase.md @@ -0,0 +1,72 @@ +--- +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. +--- + +openDatabase +=============== + +`Database` オブジェクトを新規作成します。 + + var dbShell = window.openDatabase(database_name, database_version, database_displayname, database_size); + +概要 +----------- + +このメソッドは SQLite のデータベースを新規作成し、 `Database` オブジェクトを返します。 `Database` オブジェクトは、データを操作するために使います。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Tizen + +使用例 +------------- + + var db = window.openDatabase("test", "1.0", "Test DB", 1000000); + +詳細な使用例 +------------ + + + + + Storage の使用例 + + + + + +

使用例

+

データベースを開く

+ + diff --git a/docs/jp/2.9.0/guide/command-line/index.md b/docs/jp/2.9.0/guide/command-line/index.md new file mode 100644 index 0000000000..1daf57ab03 --- /dev/null +++ b/docs/jp/2.9.0/guide/command-line/index.md @@ -0,0 +1,190 @@ +--- +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. +--- + +# コマンドライン使用ガイド + +クロスプラットフォームアプリケーションの開発を簡単にするために、 +Cordova はコマンドラインツールを提供しています。 +ビルド、クリーン、エミュレーターの起動などが一つのコマンドで可能です。 +このドキュメントは、入門ガイドの代替でもあります。 +入門ガイドがデフォルト IDE で開発を始めることをサポートするのに対し、 +コマンドライン使用ガイドではコマンドラインツールを使用して +shell ベースで Cordova プロジェクトを作成し、 +開発することを目的としています。 + +## サポートされているプラットフォーム + +* [iOS](#Command-Line%20Usage_ios) +* [Android](#Command-Line%20Usage_android) +* [BlackBerry](#Command-Line%20Usage_blackberry) + +## iOS + +iOS コマンドラインツールはシェルスクリプトで作られており、 +XCode のコマンドラインツール (`xcode-select` や `xcodebuild` など) に依存しています。 + +### プロジェクトの作成 + +以下のパラメーターとともに `create` コマンドを実行します: + +* 新しい Cordova iOS プロジェクトへのパス +* リバースドメインスタイルのパッケージ名 +* プロジェクト名 + + + + $ ./path/to/cordova-ios/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName + +### プロジェクトのビルド + + $ /path/to/my_new_cordova_project/cordova/debug + +### エミュレーターの起動 + + $ /path/to/my_new_cordova_project/cordova/emulate + +### ログ + + $ /path/to/my_new_cordova_project/cordova/log + + +## Android + +Android のコマンドラインツールはシェルスクリプト作られています。 +PATH に、 Android SDK の `tools` 及び `platform-tools` フォルダーが +必ずある必要があります。 + +### プロジェクトの作成 + +以下のパラメーターとともに `create` コマンドを実行します: + +* 新しい Cordova Android プロジェクトへのパス +* リバースドメインスタイルのパッケージ名 +* Main Activity 名 + + + + $ /path/to/cordova-android/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName + +**Windows** では + + $ /path/to/cordova-android/bin/create.bat /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName + +### プロジェクトのビルド + + $ /path/to/my_new_cordova_project/cordova/debug + +**Windows** では + + $ /path/to/my_new_cordova_project/cordova/debug.bat + +### エミュレーターの起動 + + $ /path/to/my_new_cordova_project/cordova/emulate + +**Windows** では + + $ /path/to/my_new_cordova_project/cordova/emulate.bat + +少なくとも一つの Android Virtual Device が作成済みであることを確認して下さい。もしない場合は、 `android` コマンドを使用して作成してください。 +もし複数の AVD がある場合には、コマンド実行後に AVD を選択してください。 + +### ログ + + $ /path/to/my_new_cordova_project/cordova/log + +**Windows** では + + $ /path/to/my_new_cordova_project/cordova/log.bat + +### クリーン + + $ /path/to/my_new_cordova_project/cordova/clean + +**Windows** では + + $ /path/to/my_new_cordova_project/cordova/clean.bat + +### クリーン、ビルド、デプロイ、起動 + + $ /path/to/my_new_cordova_project/cordova/BOOM + +**Windows** では + + $ /path/to/my_new_cordova_project/cordova/BOOM.bat + +エミュレーターが起動中またはデバイスが接続されていることを確認してください。 + + +## BlackBerry + +BlackBerry のコマンドラインツールはシェルスクリプト作られています。 + +### プロジェクトの作成 + +以下のパラメーターとともに `create` コマンドを実行します: + +* 新しい Cordova BlackBerry プロジェクトへのパス +* アプリケーション名 + + + + $ /path/to/cordova-blackberry-webworks/bin/create /path/to/my_new_cordova_project CordovaProjectName + +**Windows** では + + $ /path/to/cordova-blackberry-webworks/bin/create.bat /path/to/my_new_cordova_project CordovaProjectName + +### プロジェクトのビルド + +BlackBerry のプロジェクトでは、 Cordova プロジェクトフォルダーのルートにある +`project.properties` ファイルをカスタマイズすることを確認してください。 +これは、 BlackBerry の signing key のパスワード、 +BlackBerry WebWorks SDK の位置、 BlackBerry シミュレーター実行ファイルの +位置といった情報を与えるために必要です。 + + $ /path/to/my_new_cordova_project/cordova/debug + +**Windows** では + + $ /path/to/my_new_cordova_project/cordova/debug.bat + +### エミュレーターの起動 + +BlackBerry のプロジェクトでは、 Cordova プロジェクトフォルダーのルートにある +`project.properties` ファイルをカスタマイズすることを確認してください。 +これは、 BlackBerry の signing key のパスワード、 +BlackBerry WebWorks SDK の位置、 BlackBerry シミュレーター実行ファイルの +位置といった情報を与えるために必要です。 + + $ /path/to/my_new_cordova_project/cordova/emulate + +**Windows** では + + $ /path/to/my_new_cordova_project/cordova/emulate.bat + +### ログ + +残念ながら、デバイスから直接ログをストリーミングすることは現在サポート +されていません。しかし、 BlackBerry は ビルトインの Web Inspector を +BlackBerry OS 7.0 以上の Playbook と BlackBerry スマートフォンデバイスで +提供しています。また、デバイス上のアプリケーションログ +(`console.log` でのログも含む) へは、 +ホーム画面で ALT キーを長押しし、 "lglg" と打ち込むことにより +アクセスします。 diff --git a/docs/jp/2.9.0/guide/cordova-webview/android.md b/docs/jp/2.9.0/guide/cordova-webview/android.md new file mode 100644 index 0000000000..1904cc21b7 --- /dev/null +++ b/docs/jp/2.9.0/guide/cordova-webview/android.md @@ -0,0 +1,66 @@ +--- +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. +--- + +Embedding Cordova WebView on Android +==================================== + +Cordova 1.9 からは、`CordovaActivity` を用いて、 Cordova をネイティブ Android アプリケーションの中でコンポーネントとして使用できます。このコンポーネントは Android では `CordovaWebView` として知られています。 +1.9以降の新しい Cordova ベースのアプリケーションでは、昔の `DroidGap` アプローチが使用されているかどうかに関わらず、 +`CordovaWebView` をメインビューとして使用します。 + +必要なものは Android アプリケーションの開発時と同じです。 Android の開発環境について知識があることが期待されます。 +もし知識が十分にない場合は、このアプローチを使用する前に入門ガイドを参照して、 Cordova アプリケーションを作成することから初めてください。 +これは Android Cordova アプリケーションを作成するメインアプローチではありません。そのため、この手順は現在は手作業となります。将来、この方法を自動化することも考えています。 + +必要なもの +------------- + +1. **Cordova 1.9** またはそれ以降 +2. リビジョン15 以降の Android SDK + +Android プロジェクトでの CordovaWebView 使用ガイド +--------------------------------------------------- + +1. `bin/create` を使用し commons-codec-1.6.jar を取得 +2. `/framework` に `cd` し、 cordova jar をビルドするために `ant jar` を実行 + (これにより `cordova-x.x.x.jar` 形式で .jar ファイルを + `/framework` フォルダーに作成します) +3. cordova jar を Android プロジェクトの中の `/libs` ディレクトリにコピーします +4. アプリケーションの `/res/xml` 以下にある `main.xml` ファイルを、以下と同様になるよう編集します。 `layout_height`, `layout_width`, `id` はアプリケーションに合うように変更します + + + +5. アクティビティを、 `CordovaInterface` を実装 (implements) するように変更します。含まれているメソッドを実装することが推奨されています。 `/framework/src/org/apache/cordova/DroidGap.java` からメソッドをコピーしたいかもしれませんし、または自身のメソッドを実装したいかもしれません。以下は、インターフェースを使用したベーシックなアプリケーションのコードの一部です (ビューの id の参照は上のステップ4の `id` 属性で指定されたものと一致することに注意してください): + + public class CordovaViewTestActivity extends Activity implements CordovaInterface { + CordovaWebView cwv; + /* アクティビティが最初に作成されたときに呼び出されます。 */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + cwv = (CordovaWebView) findViewById(R.id.tutorialView); + cwv.loadUrl("file:///android_asset/www/index.html"); + } + +6. アプリケーションの HTML と JavaScript を Android プロジェクトの `/assets/www` ディレクトリにコピーします +7. `/framework/res/xml` から `cordova.xml` と `plugins.xml` を Android プロジェクトの `/res/xml` フォルダーにコピーします diff --git a/docs/jp/2.9.0/guide/cordova-webview/index.md b/docs/jp/2.9.0/guide/cordova-webview/index.md new file mode 100644 index 0000000000..f0cf8cfb34 --- /dev/null +++ b/docs/jp/2.9.0/guide/cordova-webview/index.md @@ -0,0 +1,27 @@ +--- +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. +--- + +WebView の埋め込み +================= + +> Cordova WebView をプロジェクトで実装します。 + +- Embedding Cordova WebView on Android +- Embedding Cordova WebView on iOS + diff --git a/docs/jp/2.9.0/guide/cordova-webview/ios.md b/docs/jp/2.9.0/guide/cordova-webview/ios.md new file mode 100644 index 0000000000..fe6c748cc8 --- /dev/null +++ b/docs/jp/2.9.0/guide/cordova-webview/ios.md @@ -0,0 +1,131 @@ +--- +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. +--- + +Embedding Cordova WebView on iOS +================================ + +Cordova 1.4 からは、 Cordova を iOS アプリケーションの中でコンポーネントとして使用できます。このコンポーネントのコードネームは "Cleaver" です。 + +Cordova 1.4 以降の Xcode テンプレートを用いて作られた新しい Cordova バースのアプリケーションは Cleaver を使用し、このテンプレートは Cleaver の参照実装と捉えられます。 + +Cordova 2.0.0 以降は、 Cleaver を実装したサブプロジェクトのみをサポートしています。 + +必要なもの +------------- + +1. **Cordova 2.1.0** またはそれ以降 +2. **Xcode 4.5** またはそれ以降 +3. `Cordova.plist` ファイル ([新しく作成した](guide_command-line_index.md.html#Command-Line%20Usage_ios) Cordova プロジェクトから) + + +Xcode プロジェクトへの Cleaver の追加 (CordovaLib サブプロジェクト) +------------------------------------------------------------- + +1. ハードディスクの**恒久的なフォルダー** (例: ~/Documents/Cordova) に **Cordova をダウンロードし解凍**します +2. Xcode が起動している場合、 **終了** します +3. **Terminal.app** を使用して、Cordova をダウンロードしたディレクトリまで **移動**します +4. `Cordova.plist` ファイルをディスクのプロジェクトフォルダー内に **コピー** します (上の **必要なもの** を参照してください) +5. `Cordova.plist` ファイルを Xcode の Project Navigator に **ドラッグアンドドロップ** します +6. **"Create groups for any added folders"** のラジオボタンを **選択** し、 **Finish** ボタンをクリックします +7. `CordovaLib.xcodeproj` ファイルを Xcode の Project Navigator に **ドラッグアンドドロップ** します (上の、 CordovaLib のサブディレクトリ、恒久的なフォルダーから) +8. Project Navigator で `CordovaLib.xcodeproj` を選択します +9. **File Inspector** を開くため、 **Option-Command-1** キーを押します +10. **Location** のドロップダウンメニューのため、 **File Inspector** から **"Relative to CORDOVALIB"** を選択します +11. Project Navigator の **Project アイコン** をクリックし、 **Target** を選択し、 **"Build Settings"** タブを選択します +12. **"Other Linker Flags"** の値に `-all_load` と `-Obj-C` を追加します +13. Project Navigator の **Project アイコン** をクリックし、 **Target** を選択し、 **"Build Phases"** タブを選択します +14. **"Link Binaries with Libraries"** を展開します +15. **"+" ボタン** をクリックし、以下の **framework** を追加します (オプションで、 Project Navigator の中でこれらを Frameworks グループに **移動** します): + + AddressBook.framework + AddressBookUI.framework + AudioToolbox.framework + AVFoundation.framework + CoreLocation.framework + MediaPlayer.framework + QuartzCore.framework + SystemConfiguration.framework + MobileCoreServices.framework + CoreMedia.framework + +16. **"Target Dependencies"** を展開します。 (もしこのラベルのボックスが複数ある場合は、一番上のものを選んでください) +17. **"+" ボタン** をクリックし、 `CordovaLib` ビルドプロダクトを追加します +18. **"Link Binaries with Libraries"** を展開します。 + (もしこのラベルのボックスが複数ある場合は、一番上のものを選んでください) +19. **"+" ボタン** をクリックし、 `libCordova.a` を追加します +20. Xcode 設定 **"Xcode Preferences -> Locations -> Derived Data -> Advanced…"** を **"Unique"** にセットします +21. Project Navigator の **Project アイコン** をクリックし、 **Target** を選択し、 **"Build Settings"** タブを選択します +22. **"Header Search Paths"** で検索をします。この設定に、以下の値を追加します (クォートを含む) + + "$(TARGET_BUILD_DIR)/usr/local/lib/include" + + "$(OBJROOT)/UninstalledProducts/include" + + "$(BUILT_PRODUCTS_DIR)" + + **Cordova 2.1.0** では、 CordovaLib は **Automatic Reference Counting (ARC)** を使用するようにアップグレードされました。 CordovaLib を使用するにあたって **ARC** にアップグレードする必要はありませんが、もしプロジェクトを **ARC** を使用するようにアップグレードしたい場合は、メニューから Xcode migration wizard : **Edit -> Refactor -> Convert to Objective-C ARC…** を使用して、 **libCordova.a を選択解除** し、ウィザードを完了してください。 + +コード中での CDVViewController の使用法 +------------------------------------ + +1. この **header** を追加します: + + #import + +2. **新しい** `CDVViewController` のインスタンスを作成し、どこかで保持します: + + CDVViewController* viewController = [CDVViewController new]; + +3. (_オプション_) `wwwFolderName` プロパティーをセットします (デフォルトは `"www"`): + + viewController.wwwFolderName = @"myfolder"; + +4. (_オプション_) `startPage` プロパティーをセットします (デフォルトは `"index.html"`): + + viewController.startPage = @"mystartpage.html"; + +5. (_オプション_) `useSplashScreen` プロパティーをセットします (デフォルトは `NO`): + + viewController.useSplashScreen = YES; + +6. **view frame** をセットします (常にこれを最後のプロパティーとしてセットします): + + viewController.view.frame = CGRectMake(0, 0, 320, 480); + +7. Cleaver を view に **追加** します: + + [myView addSubview:viewController.view]; + +HTML, CSS, JavaScript ファイルの追加 +------------------------------------------- + +1. **新しいフォルダー** を **ディスク上の** プロジェクト内に作成します。例として名前は `www` とします +2. **HTML, CSS, JavaScript ファイル** をこのフォルダーの中に入れます +3. このフォルダーを Xcode の Project Navigator に **ドラッグアンドドロップ** します +4. **"Create groups for any added folders"** のラジオボタンを **選択** します +5. `CDVViewController` をインスタンス化するとき、 **(1)** で作成したフォルダーに **適切な `wwwFolderName` と `startPage` プロパティーをセット** するか、デフォルト値を使用します (前のセクションを参照してください)。 + + /* + もし 'myfolder' という名前のフォルダーを作成し、 + startPage として 'mypage.html' を + 使用したい場合 + */ + viewController.wwwFolderName = @"myfolder"; + viewController.startPage = @"mypage.html" + diff --git a/docs/jp/2.9.0/guide/getting-started/android/index.md b/docs/jp/2.9.0/guide/getting-started/android/index.md new file mode 100644 index 0000000000..f60b1b19dc --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/android/index.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. +--- + +Getting Started with Android +============================ + +このガイドは、 Cordova のための開発環境セットアップ方法、またシンプルなアプリの動かし方を解説します。 + + +1. 必要なもの +--------------- + +- Eclipse 3.4以上 + + +2. SDK と Cordova のインストール +------------------------ + +- [Eclipse Classic](http://www.eclipse.org/downloads/) のダウンロードとインストール +- [Android SDK](http://developer.android.com/sdk/index.html) のダウンロードとインストール +- [ADT Plugin](http://developer.android.com/sdk/eclipse-adt.html#installing) のダウンロードとインストール +- [Cordova](http://incubator.apache.org/cordova/#download) の最新版をダウンロードし解凍します。これから Android ディレクトリと一緒に作業を進めます。 + + +3A. PATH 環境変数の設定 (Mac OS) +--------------------------------------- + +- ターミナルを開きます (デフォルトでは、 Applications/Utilites フォルダーにあります) +- 以下のコマンドを実行します + +`touch ~/.bash_profile; open ~/.bash_profile` + +- これにより、ファイルをあなたのデフォルトテキストエディタで開きます +- Android SDK platform-tools と tools ディレクトリにパスを通す必要があります。この例では、 "/Development/android-sdk-macosx" を SDK がインストールされているフォルダーとします。以下の行を追加します: + +`export PATH=${PATH}:/Development/android-sdk-macosx/platform-tools:/Development/android-sdk-macosx/tools` + +- ファイルを保存し、テキストエディタを終了します +- PATH を更新するために、 .bash_profile を実行します + +`source ~/.bash_profile` + +- これで、ターミナルを開く度に Android SDK へのパスが通っているようになります + +3B. PATH 環境変数の設定 (Windows) +--------------------------------------- + +- デスクトップから、マイコンピューターを右クリックし、プロパティーをクリックします +- 左側の列から、詳細設定をクリックします +- システムプロパティーのウィンドウで、環境変数ボタンをクリックします +- システム環境変数から、 PATH を選択します +- 編集ボタンをクリックします +- Android SDK platform-tools と tools ディレクトリにパスを通す必要があります。この例では、 "C:\Development\android-sdk-macosx" を SDK がインストールされているフォルダーとします。以下をテキストボックスに追加します: + +`;C:\Development\android-sdk-windows\platform-tools;C:\Development\android-sdk-windows\tools` + +- 編集を保存します。環境変数ダイアログを閉じます +- 追加で、 `%JAVA_HOME%\bin` も PATH に追加する必要があるかもしれません。この作業が必要かどうかを確認するには、コマンドプロンプトで `java` を入力してください。もしプログラムが見つからなかった場合は、 `%JAVA_HOME%\bin` を PATH に追加してください。場合によっては、 %JAVA_HOME% の環境変数ではなくフルパスを指定する必要があるかもしれません +- `%ANT_HOME%\bin` も PATH に追加する必要があるかもしれません。この作業が必要かどうかを確認するには、コマンドプロンプトで `ant` を入力してください。もしプログラムが見つからなかった場合は、 `%ANT_HOME%\bin` を PATH に追加してください。場合によっては、 %ANT_HOME% の環境変数ではなくフルパスを指定する必要があるかもしれません + + +4. 新規プロジェクトの作成 +--------------------- + +- ターミナルで、 Cordova の `android` サブフォルダーの中にある `bin` ディレクトリまで移動します +- `./create ` と入力し、 **"Enter"** を押します + + は新規 Cordova Android プロジェクトへのパスです + はパッケージ名です。例: com.YourCompany.YourAppName + はプロジェクト名です。例: YourApp (スペースを含まない) + +- Eclipse を起動し、メニューから **新規プロジェクト** を選択します + ![](img/guide/getting-started/android/eclipse_new_project.png) +- `` で使用したディレクトリを選択します +- Finish をクリックします + +もしプロジェクトがa red X indicatingを保つ場合には問題があるので、以下の追加の手順が必要です + +- プロジェクトフォルダーを右クリックします +- プロパティーダイアログで、ナビゲーションパネルから Android を選択します +- Project build target には、インストールしてある中での最新バージョンの Android API を選択します +- OK をクリックします +- プロジェクトメニューバーから Clean を選択します +- これでプロジェクトからエラーが無くなるはずです + +5A. エミュレーターへのデプロイ +----------------------- + +- プロジェクトを右クリックし、次を **実行 > Android Application** を選択 +- 適切な AVD を選択。 もしない場合は、作成する必要があります + +**注意: より早く動かすために、 Intel ベースのエミュレーターを使用します:** + +- Android SDK Manager を開きます + ![](img/guide/getting-started/android/eclipse_android_sdk_button.png) +- ひとつ以上の `Intel x86 Atom` システムイメージおよび `Intel Hardware Accelerated Execution Manager` (Extras 以下にあります) をインストールします +- Android SDK の中の `extras/intel/Hardware_Accelerated_Execution_Manager` にダウンロードされた Intel installer を実行します +- Target を Intel のイメージとした新しい AVD を作成します +- エミュレーターがスタートするとき、 HAX モジュールのロードに失敗したといったエラーメッセージが出力されないことを確認します + + +5B. デバイスへのデプロイ +-------------------- + +- デバイスの設定で USB デバッグが有効になっていること、またコンピュータに接続されていることを確認 (**設定 > アプリケーション > 開発**) +- プロジェクトを右クリックし、次を **実行 > Android Application** を選択 + diff --git a/docs/jp/2.9.0/guide/getting-started/bada/index.md b/docs/jp/2.9.0/guide/getting-started/bada/index.md new file mode 100644 index 0000000000..23743b3a5b --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/bada/index.md @@ -0,0 +1,93 @@ +--- +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. +--- + +Getting Started with Bada +========================= + +このガイドは、 Cordova のための開発環境セットアップ方法、またシンプルなアプリの動かし方を解説します。 Cordova は以前は PhoneGap と呼ばれていたため、いくつかのサイトは PhoneGap という名前をまだ使用しています。 + +1. 必要なもの +--------------- + +- Windows +- cordova-bada を使うためには、 bada 1.2 SDK が必要です (すでに Samsung のウェブサイトでは入手できません) + +2. SDK と Cordova のインストール +------------------------- + +- [Bada SDK](http://developer.bada.com) のダウンロードとインストール (Windows のみ) +- [Cordova](http://phonegap.com/download) の最新版をダウンロードし解凍します。 これから bada ディレクトリと一緒に作業を進めます。 + + +3. 新規プロジェクトの作成 +-------------------- +- Bada IDE で、 File -> Import project -> Bada C++ / Flash Project を選択します + - 注意: Bada 1.2 では "Bada Application Project" を選択します + + ![](img/guide/getting-started/bada/import_bada_project.png) + +- "Select root directory" がチェックされていることを確認し、 Browse ボタンをクリックします +- Cordova bada プロジェクトフォルダー (1.2にはbadaフォルダー、2.xにはbada-wacフォルダー) を選択します "Copy projects into workspace" がチェックされていることを確認します + + ![](img/guide/getting-started/bada/import_bada_project.png) + +- "Finish" をクリックします + + ![](img/guide/getting-started/bada/bada_project.png) + +4. Hello World の作成 +-------------- + +**Bada 2.x**: HTML/CSS/Javascript のコードは Res/ フォルダー直下にあります。 以下の2行が index.html の に含まれていることを確認します。 + + + + + +**Bada 1.2**: HTML/CSS/Javascript のコードは Res/ フォルダー直下にあります。 以下の行が index.html に含まれていることを確認します。 + + + +5A. シミュレーターへのデプロイ +----------------------- + +- **Bada 2.x**: プロジェクトで右クリックをし、 Run As -> bada Emulator Web Application を選択します + + ![](img/guide/getting-started/bada/bada_1_run.png) + +- **Bada 1.2**: プロジェクトで右クリックをし、 Build configurations -&g; Set Active -> Simulator-Debugを選択します + + ![](img/guide/getting-started/bada/bada_set_target.png) + +- プロジェクトで右クリックをし、 Run As -> bada Simulator Application を選択します。 アプリを更新するたびに、エミュレーターを閉じる必要があります。 + +5B. デバイスへのデプロイ +-------------------- + +- デバイスが適切に設定されていることを確認します + +**Bada 2.x**: プロジェクトで右クリックをし、 Run As -> bada Target Web Application を選択します + +**Bada 1.2**: +- プロジェクトで右クリックをし、 Build configurations -&g; Set Active -> Target-Debugを選択します +- プロジェクトで右クリックをし、 Run As -> bada Target Application を選択します アプリを更新するたびに、エミュレーターを閉じる必要があります。 + + +終了 +----- diff --git a/docs/jp/2.9.0/guide/getting-started/blackberry/index.md b/docs/jp/2.9.0/guide/getting-started/blackberry/index.md new file mode 100644 index 0000000000..008856f93d --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/blackberry/index.md @@ -0,0 +1,101 @@ +--- +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. +--- + +Getting Started with Blackberry +============================ + +Cordova for BlackBerry は [BlackBerry WebWorks framework](https://bdsc.webapps.blackberry.com/html5) を使用して作られています。 BlackBerry WebWorks ツールは Windows または Mac にて使用可能です。 WebWorks アプリケーションは OS 5.0以上の BlackBerry デバイスまたは BlackBerry PlayBook OS にのみデプロイ可能です。 + +1. 必要なもの +--------------- + +- Windows XP (32-bit) またはWindows 7 (32-bit and 64-bit) または Mac OSX 10.6.4以上 +- Java Development Kit (JDK) + - Windows: [Oracle JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html#jdk) (32-Bit Version) + - Mac OS X: Mac OS X 10.7より前については、 Java はデフォルトで提供されています。 OS X 10.7以上については、 [Java](http://support.apple.com/kb/DL1421) のインストールが必要です +- Apache Ant + - Windows: [Apache Ant](http://ant.apache.org/bindownload.cgi) + - Mac OS X: Apache Ant は Java と一緒にインストールされます + +2. SDK と Cordova のインストール +------------------------- + +- PlayBook の開発には [Adobe Air SDK](http://www.adobe.com/devnet/air/air-sdk-download.html) が必要です +- 1つ以上の WebWorks SDK をダウンロード、インストールします。 インストールしたディレクトリを覚えておいてください。 + - スマートフォンの開発: [BlackBerry WebWorks Smartphone SDK](https://bdsc.webapps.blackberry.com/html5/download/sdk) + - PlayBook の開発: [BlackBerry WebWorks Tablet OS SDK](https://bdsc.webapps.blackberry.com/html5/download/sdk) +- [Cordova](http://phonegap.com/download) の最新版をダウンロードし解凍します。 + +3. 新規プロジェクトの作成 +-------------------- + +- コマンドプロンプトまたはターミナルをひらいて、 Cordova をダウンロード、解凍したディレクトリまで移動します。 +- そのディレクトリには、 Cordova がサポートするプラットフォームごとにさらにディレクトリがあります。 blackberry のディレクトリに移動します。 +- blackberry のディレクトリには、 `sample` と `www` の2つのディレクトリがあります。 `sample` フォルダーには、完成した Cordova プロジェクトが入っています。 `sample` フォルダーをコンピュータ内の別の場所にコピーします。 +- コピーしたフォルダーに移動します。 +- project.properties ファイルをあなたの好きなエディタで開き、 `blackberry.bbwp.dir=` および/または `playbook.bbwp.dir=` の部分を編集します。 値には、先ほどインストールした WebWorks SDK の中の `bbwp` バイナリファイルの位置をセットします。 + +4. Hello World の作成 +-------------- + +サンプルプロジェクトのディレクトリ内でコマンドプロンプトまたはターミナルで `ant target build` とタイプすることで、サンプルプロジェクトをビルドします。ここで、 `target` は `blackberry` か `playbook` に置き換えてください。これは Cordova のサンプルプロジェクトで、普通の Hello World アプリではないことに注意してください。 www フォルダーにある index.html は多くの Cordova API の使用例を含みます。 + +5A. シミュレーターへのデプロイ +-------------------------------------- + +BlackBerry スマートフォンシミュレーターは Windows でのみ利用可能です。 PlayBook シミュレーターは VMWare Player (Windows) または VMWare Fusion (Mac OS X) を必要とします。 WebWorks SDK はデフォルトのシミュレーターを提供しています。追加のシミュレーターも [入手可能](http://us.blackberry.com/developers/resources/simulators.jsp) です。 + +- project.properties ファイルをお好きなエディタで開き、以下のプロパティーをカスタマイズします。 + - スマートフォン (オプション) + - `blackberry.sim.dir` : シミュレーターのあるディレクトリへのパスを表します。 Windows では、ファイルセパレーターの '\' は '\\\' でエスケープされている必要があります。 + - `blackberry.sim.bin` : 指定されたシミュレーターのディレクトリ内で、実行したいシミュレーターの名前を表します。 + - Playbook + - `playbook.sim.ip` : シミュレーターのセキュリティ設定でデベロッパーモードにした場合の、取得する IP アドレスを表します。 + - `playbook.sim.password` : シミュレーターのセキュリティ設定で設定できるシミュレータのパスワードを表します。 +- プロジェクトのディレクトリにいるときは、コマンドプロンプトまたはターミナルで `ant target load-simulator` とタイプしてください。 ここで、 `target` は `blackberry` か `playbook` に置き換えてください。 PlayBook では、シミュレーターのバーチャルイメージは既にスタートしている必要があることに注意してください。 +- アプリケーションは、シミュレーター内の All Applications セクションにインストールされます。 BlackBerry OS 5 ではアプリケーションは Download フォルダーにインストールされることに注意してください。 + +5B. デバイスへのデプロイ (Windows and Mac) +-------------------------------------- + +- デバイスへのデプロイは、 RIM から取得できる signing keys が必要です。 + - signing keys のリクエストのため、この [フォーム](https://bdsc.webapps.blackberry.com/html5/signingkey) に記入し提出してください。 + - signing keys を受け取ったら、それらをインストールします: + - [Setup Smartphone Signing keys](https://bdsc.webapps.blackberry.com/html5/documentation/ww_publishing/signing_setup_smartphone_apps_1920010_11.html) + - [Setup Tablet Signing keys](https://bdsc.webapps.blackberry.com/html5/documentation/ww_publishing/signing_setup_tablet_apps_1920009_11.html) +- サインされたアプリケーションを USB 接続されたスマートフォンデバイスにインストールするために、 [BlackBerry Desktop Sofware](http://us.blackberry.com/apps-software/desktop/) をインストールします。 +- project.properties ファイルをお好きなエディタで開き、以下のプロパティーをカスタマイズします: + - スマートフォン (オプション) + - `blackberry.sigtool.password` : signing keys が登録されたときに使われるパスワードを表します。 もし指定されていない場合は、プロンプトにより入力が促されます。 + - Playbook (必須) + - `playbook.sigtool.csk.password` : Signing key のパスワードを表します。 + - `playbook.sigtool.p12.password` : Signing key のパスワードを表します。 + - `playbook.device.ip` : デバイスのセキュリティ設定でデベロッパーモードにした場合の、取得する IP アドレスを表します。 + - `playbook.device.password` : デバイスのセキュリティ設定で設定できるデバイスのパスワードを表します。 +- プロジェクトのディレクトリにいるときは、コマンドプロンプトまたはターミナルで `ant target load-device` とタイプしてください。ここで、 `target` は `blackberry` か `playbook` に置き換えてください。 +- アプリケーションは、デバイス内の All Applications セクションにインストールされます。 BlackBerry OS 5 ではアプリケーションは Download フォルダーにインストールされることに注意してください。 + +追加の情報 +---------------------- + +以下の記事は、 BlackBerry WebWorks framework を使って Cordova アプリケーションを開発するときに役立ちます。 + +- [BlackBerry WebWorks Development Pitfalls](http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Common-BlackBerry-WebWorks-development-pitfalls-that-can-be/ta-p/624712) +- [Best practices for packaging WebWorks applications](https://bdsc.webapps.blackberry.com/html5/documentation/ww_developing/bestpractice_compiling_ww_apps_1873324_11.html) + diff --git a/docs/jp/2.9.0/guide/getting-started/index.md b/docs/jp/2.9.0/guide/getting-started/index.md new file mode 100644 index 0000000000..9717bffd6d --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/index.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. +--- + +入門ガイド +====================== + +- Getting Started with Android +- Getting Started with Blackberry +- Getting Started with iOS +- Getting Started with Symbian +- Getting Started with WebOS +- Getting Started with Windows Phone +- Getting Started with Windows 8 +- Getting Started with Bada +- Getting Started with Tizen diff --git a/docs/jp/2.9.0/guide/getting-started/ios/index.md b/docs/jp/2.9.0/guide/getting-started/ios/index.md new file mode 100644 index 0000000000..b71f156f30 --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/ios/index.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. +--- + +Getting Started with iOS +======================== + +このガイドは、 Apache Cordova のための開発環境セットアップ方法、また Apache Cordova のサンプルアプリの動かし方を解説します。 + +必要なもの +--------------- +- Xcode 4.5+ +- Xcode コマンドラインツール +- Intel ベースの Mac OS X Lion 以上 (10.7+) +- デバイスへのインストールに必要なもの: + - Apple iOS デバイス (iPhone, iPad, iPod Touch) + - iOS デベロッパー証明書 + +SDK と Apache Cordova のインストール +------------------------ + +- [Mac App Store](http://itunes.apple.com/us/app/xcode/id497799835?mt=12) または [Apple Developer Downloads](http://developer.apple.com/downloads) から **Xcode** をインストールします。 +- **Xcode コマンドラインツール** (**Xcode Preferences -> Downloads -> Components -> Command Line Tools -> Install**) をインストールします。 +- [Apache Cordova](http://phonegap.com/download) の最新版をダウンロードします。 + - ダウンロードしたものを解凍します + - Apache Corder iOS は `lib/ios` ディレクトリ以下にあります + +CordovaLib のインストール +------------------ + +1. Cordova を **ダウンロード** します +2. ダウンロードしたものを、ハードディスクの恒久的な場所に **解凍** します (例: ~/Documents/CordovaLib-2.X.X) +3. Step 3 はありません + +新規プロジェクトの作成 +-------------------- + +- **Terminal.app** を起動します +- (上の **CordovaLib のインストール** セクションで解凍した恒久的な場所にある) **bin** フォルダーを Dock にある **Terminal.app** のアイコンにドラッグします。これにより、新しいターミナルのウィンドウが開きます +- `./create ` を入力し、 **"Enter"** を押します + + は新しい Cordova iOS プロジェクトへのパスを表します (もし既に存在する場合は、空である必要があります) + はリバースドメインスタイルのパッケージ名を表します + はプロジェクト名を表します + + ![](img/guide/getting-started/ios/bin_create_project.png) + + +- たった今作成した新しいプロジェクトフォルダーを **見つけます** +- フォルダーの中の .xcodeproj を **起動します** + +**注意:** +Cordova 2.2 から、プロジェクトが Cordova インストール内の CordovaLib のコピーへ依存していたのに代わり、 +プロジェクトが CordovaLib のコピーをプロジェクト内に持つようになりました。 + +もしプロジェクトが Cordova インストール内の CordovaLib に直接依存するようにしたい場合は、 +`./create --shared` が使用できます。または、プロジェクトを作成した後で +`./update_cordova_subproject path/to/you/project` とすることで、参照を変更できます。 + +シミュレーターへのデプロイ +----------------------- + +- ツールバーにあるドロップダウンメニューから **Target** を **"HelloWorld"** (あなたのプロジェクト名) に変更します +- ツールバーにあるドロップダウンメニューから **Active SDK** を **iOS [version] Simulator** に変更します + + ![](img/guide/getting-started/ios/active_scheme_simulator.png) + +- プロジェクトウィンドウのツールバーにある _Run_ ボタンをクリックします + +デバイスへのデプロイ +-------------------- + +- **Resources** グループの中にある `HelloWorld-Info.plist` を開きます +- **BundleIdentifier** を Apple から提供された Identifer 、または自分の Identifer に変更します + - もし開発者ライセンスを持っている場合は、 [Assistant] (http://developer.apple.com/iphone/manage/overview/index.action) よりアプリを登録できます +- ツールバーにあるドロップダウンメニューから **Target** を **"HelloWorld"** (あなたのプロジェクト名) に変更します +- ツールバーにあるドロップダウンメニューから **Active SDK** を **[あなたのDevice名]** に変更します + - デバイスを USB で接続する必要があります + + ![](img/guide/getting-started/ios/active_scheme_device.png) + +- プロジェクトウィンドウのツールバーにある _Run_ ボタンをクリックします + +結果 +---------------- +- 緑色の点滅した **"device is ready"** のメッセージを伴った画面が見えるはずです + + ![](img/guide/getting-started/ios/HelloWorldStandard.png) + +Xcode の問題 +---------------- +もしヘッダーが無いなどに関連した編集での問題がある場合、ビルドプロダクトは **同じビルドディレクトリでビルドする** 必要があります。**"Xcode Preferences -> Locations -> Derived Data -> Advanced…"** の設定を **"Unique"** に変更する必要があるかもしれません。これは Xcode をインストールした直後のデフォルト設定ですが、もし古いバージョンからアップグレードした場合は昔の設定が残っており、その場合はアップデートする必要があります。 + + + +アプリを作成 +-------------- + +これで Xcode プロジェクトのセットアップが完了し、シミュレーターまたはデバイスでビルドし動かすことが出来ます。 +アプリを書くために、 Xcode を使用する必要はありません。 +あなたの好きなテキストエディターを使い、 Xcode 、またはプロジェクトフォルダ (**cordova** サブフォルダー) 内で [コマンドラインツール](guide_command-line_index.md.html) でリビルド作業を行えます。 +Xcode は自動的に `www` ディレクトリ内にあるファイルの変化を検出します。 + +コマンドラインツールの問題 +---------------- +もし **"Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path."** というエラーを見る場合、 Developer フォルダーを設定するために以下を実行してください: + + sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer diff --git a/docs/jp/2.9.0/guide/getting-started/symbian/index.md b/docs/jp/2.9.0/guide/getting-started/symbian/index.md new file mode 100644 index 0000000000..9d63f407c1 --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/symbian/index.md @@ -0,0 +1,78 @@ +--- +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. +--- + +Getting Started with Symbian +============================ + +このガイドは、 Cordova のための開発環境セットアップ方法、またシンプルなアプリの動かし方を解説します。 Cordova は以前は PhoneGap と呼ばれていたため、いくつかのサイトは PhoneGap という名前をまだ使用しています。 + +ビデオチュートリアル: +---------------- + +- [Cordova Installer - Xcode 4 Template](http://www.youtube.com/v/R9zktJUN7AI?autoplay=1) + + +1. 必要なもの +--------------- + +- Windows, OS X, または Linux + +他に [QT for Symbian](http://wiki.phonegap.com/w/page/16494811/PhoneGap-Symbian-%28Qt%29) や [Symbian with Sony Ericsson](http://wiki.phonegap.com/w/page/16494782/Getting-Started-with-PhoneGap-Symbian-(WRT-on-Sony-Ericsson)) といったガイドもあります。 + + +2. SDK と Cordova のインストール +------------------------- + +- [cygwin](http://www.cygwin.com/setup.exe) をダウンロードし、インストールします (Windows のみ) 。デフォルトでは選択されていませんが、 "make" を選択してください +- [Cordova](http://phonegap.com/download) の最新版をダウンロードし解凍します。これから Android ディレクトリと一緒に作業を進めます + + +3. 新規プロジェクトの作成 +-------------------- + +- cygwin で、 Cordova を解凍したディレクトリまで移動し、 Symbian ディレクトリに移動します + + +4. Hello World の作成 +-------------- + +- phonegap/symbian/framework/www にある index.html を好きなエディタで開きます +- `body` タグの中にある `"Build your phonegap app here! Dude!"` を削除し、 `

Hello World

` を追加します +- cygwin または terminal で、 make を実行します。これにより、 phonegap-symbian.wrt と app.wgz が作られます + + +5A. シミュレーターへのデプロイ +----------------------- + +- Mac もしくは Linux には、 [Aptana Studio](http://www.aptana.org/products/studio2/download) と [Nokia WRT Plug-in for Aptana Studio](http://www.forum.nokia.com/info/sw.nokia.com/id/00d62bd8-4214-4c86-b608-5f11b94dad54/Nokia_WRT_Plug_in_for_Aptana_Studio.html) をインストールする必要があります。これは、ブラウザベースの JavaScript エミュレーターを持っています +- Windows は、S60 エミュレーターを持つ [S60 SDK](http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/S60_All_in_One_SDKs.html) をダウンロードします +- エミュレーターに phonegap-symbian.wrt と app.wgz をロードします + + +5B. デバイスへのデプロイ +-------------------- + +- phonegap-symbian.wrt と app.wgz を bluetooth または email を使ってデバイスにロードします + + +終了 +----- + +さらに詳しいガイドは [ここ](http://wiki.phonegap.com/w/page/16494780/Getting-Started-with-Phonegap-Nokia-WRT) で確認できます。 + diff --git a/docs/jp/2.9.0/guide/getting-started/tizen/index.md b/docs/jp/2.9.0/guide/getting-started/tizen/index.md new file mode 100644 index 0000000000..c682eeaae0 --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/tizen/index.md @@ -0,0 +1,108 @@ +--- +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. +--- + +Getting Started with Tizen +========================= + +このガイドは、 Cordova のための開発環境セットアップ方法、またシンプルなアプリの動かし方を解説します。 Cordova は以前は PhoneGap と呼ばれていたため、いくつかのサイトは PhoneGap という名前をまだ使用しています。 + +1. 必要なもの +--------------- + +- Linux Ubuntu 10.04/10.10/11.04/11.10 32-bit, Windows XP SP3/7 32-bit. + +2. SDK と Cordova のインストール +------------------------- + +- [Tizen SDK](https://developer.tizen.org/sdk) のダウンロードとインストール +- [Cordova](http://phonegap.com/download) の最新版をダウンロードし解凍します。これから tizen ディレクトリと一緒に作業を進めます +- (オプション) Tizen の Cordova テンプレートプロジェクトをインストール: copy the `/templates` ディレクトリの中身を Tizen Eclipse IDE の web templates ディレクトリにコピーします (例: `/home/my_username/tizen-sdk/IDE/Templates/web`) + +3. 新規プロジェクトの作成 +-------------------- + +- **方法 #1: Cordova Tizen プロジェクトサンプルのインポート** + - Tizen Eclipse IDE を起動します + - **File** -> **Import** -> **Tizen Web Project** を選択します + + ![](img/guide/getting-started/tizen/import_project.png) + + - **Next** をクリックします + - **Select root directory** がチェックされていることを確認します + - **Copy projects into workspace** がチェックされていることを確認します + - **Browse** をクリックします + - Cordova Tizen の "samples" プロジェクトディレクトリのうちの一つ (例: `/cordova-basic`) を Browse し、選択します + + ![](img/guide/getting-started/tizen/import_widget.png) + + - **Finish** をクリックします + + ![](img/guide/getting-started/tizen/project_explorer.png) + + - これで、プロジェクトはインポートされ **Project Explorer** ビューに表示されます + +- **方法 #2: Tizen Eclipse IDE の Cordova Tizen プロジェクトテンプレートの使用** + - Tizen Eclipse IDE を起動します + - **File** -> **New** -> **Tizen Web Project** を選択します + - 項目 **User Template** と **User defined** を選択します + - Tizen Cordova template のうちの一つ (e.g: **CordovaBasicTemplate**) を選択します + - **Project name** とその **Location** を入力します + + ![](img/guide/getting-started/tizen/project_template.png) + + - **Finish** をクリックします + + ![](img/guide/getting-started/tizen/project_explorer.png) + + - これで、プロジェクトは作成され **Project Explorer** ビューに表示されます + +4. Hello World の作成 +-------------- +- プロジェクトのビルド: + + - **Project Explorer** ビューの中のプロジェクトを **右クリック** して **Build Project** を選択します + + ![](img/guide/getting-started/tizen/build_project.png) + + - プロジェクトのルートディレクトリに、ウィジェットパッケージが生成されているはずです (例: `cordova-basic.wgt`) + + - **注意** Tizen Cordova プロジェクトで提供されているサンプルは、基本的な hello world アプリケーションではありません。それらは、 Battery Cordova API のシンプルな使用例です。 + + +5A. シミュレーターへのデプロイ +----------------------- + +- **Project Explorer** ビューの中のプロジェクトを **右クリック** して **Run As** と **Tizen Web Simulator Application** を選択します + + ![](img/guide/getting-started/tizen/runas_web_sim_app.png) + +5B. デバイス/エミュレーターのデプロイ +-------------------- + +- デバイスが正常に起動/接続/設定されていることを確認 ("Date and Time" 設定は正しく設定されている必要があります) します +- **Connection Explorer** ビューでアプリケーションのデプロイ先を選択します (**Window** Menu -> **Show View** -> **Connection Explorer** を選択) + + ![](img/guide/getting-started/tizen/connection_explorer.png) + +- **Project Explorer** ビューの中のプロジェクトを **右クリック** して **Run As** と **Tizen Web Application** を選択します + + ![](img/guide/getting-started/tizen/runas_web_app.png) + +終了 +----- diff --git a/docs/jp/2.9.0/guide/getting-started/webos/index.md b/docs/jp/2.9.0/guide/getting-started/webos/index.md new file mode 100644 index 0000000000..4b1a9864a3 --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/webos/index.md @@ -0,0 +1,78 @@ +--- +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. +--- + +Getting Started with WebOS +========================== + +このガイドは、 Cordova のための開発環境セットアップ方法、またシンプルなアプリの動かし方を解説します。 Cordova は以前は PhoneGap と呼ばれていたため、いくつかのサイトは PhoneGap という名前をまだ使用しています。 + +ビデオチュートリアル: +---------------- + +- [Cordova and HP Palm webOS quick start video](http://www.youtube.com/v/XEnAUbDRZfw?autoplay=1) +- [How to convert iPhone app to a Palm](http://www.youtube.com/v/wWoJfQw79XI?autoplay=1) + + +1. 必要なもの +--------------- + +- Windows, OS X, または Linux + + +2. SDK と Cordova のインストール +---------------------------- + +- [Virtual Box](http://www.virtualbox.org/) のダウンロードとインストール +- [WebOS SDK](http://developer.palm.com/index.php?option=com_content&view=article&layout=page&id=1788&Itemid=321/) のダウンロードとインストール +- [cygwin SDK](http://developer.palm.com/index.php?option=com_content&view=article&layout=page&id=1788&Itemid=321) のダウンロードとインストール (Windows のみ) 。デフォルトでは選択されていませんが、 "make" を選択してください +- [Cordova](http://phonegap.com/download) の最新版をダウンロードし解凍します。 これから webOS ディレクトリと一緒に作業を進めます。 +- [Mac App Store](http://itunes.apple.com/ca/app/xcode/id497799835?mt=12) のダウンロードとインストール (OSC のみ) +- Command Line Tools for XCode のダウンロードとインストール (OSX のみ) 。 XCode の Preferences -> Downloads -> Components から、 Command Line Tools の install をクリックすることでインストールできます + + +3. 新規プロジェクトの作成 +-------------------- + +- ターミナルまたは cygwin を開き、 Cordova を解凍したフォルダーまで移動します。 webOS ディレクトリに移動します。 + +4. Hello World の作成 +-------------- + +phonegap/webOS/framework/www の中の index.html を好きなエディタで開きます。 body タグの後に `

Hello World

` を追加します + + +5A. シミュレーターへのデプロイ +----------------------- + +- アプリケーションフォルダーまたはスタートメニューからPlam エミュレーターを起動します +- webOS ディレクトリ内で、ターミナルまたは cygwin で make を実行します + + +5B. デバイスへのデプロイ +-------------------- + +- デバイスが [デベロッパーモードになっており、また接続されている](http://developer.palm.com/index.php?option=com_content&view=article&id=1552&Itemid=59#dev_mode) ことを確認します +- webOS ディレクトリ内で、ターミナルまたは cygwin で make を実行します + + +終了 +----- + +さらに詳しいガイドは [ここ](http://wiki.phonegap.com/w/page/16494781/Getting-Started-with-PhoneGap-webOS) で確認できます。 + diff --git a/docs/jp/2.9.0/guide/getting-started/windows-8/index.md b/docs/jp/2.9.0/guide/getting-started/windows-8/index.md new file mode 100644 index 0000000000..31b2d58a2c --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/windows-8/index.md @@ -0,0 +1,104 @@ +--- +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. +--- + +Getting Started with Windows 8 +================================== + +このガイドは、 Cordova のための開発環境セットアップ方法、またシンプルなアプリの動かし方を解説します。 Cordova は以前は PhoneGap と呼ばれていたため、いくつかのサイトは PhoneGap という名前をまだ使用しています。 + +Windows 8 と Windows RT での開発中で、 Microsoft は "Metro スタイルアプリ" という呼び名を廃止予定です。 MSDN 上では、これらのタイプのアプリは "Windows ストアアプリ" と呼んでいます。このガイドでは、この名前を使用します。また、ガイド中で Windows 8 の記述がある部分は、常に Windows 8 と Windows RT の両方を指すとして考えてください。 + +1. 必要なもの +--------------- + +- Windows 8 + +- Visual Studio 2012 Professional 以上、または Visual Studio 2012 Express for Windows 8 + +[ここ](http://www.windowsstore.com/) の手順に沿って Windows ストアにアプリを登録してください。 + +2. SDK と Cordova のインストール +---------------------------- + +- お好きなエディションをセットアップしてください。すべての有料エディション (Professional 等) で Windows ストアアプリを作成できます。 [Express エディション](http://www.microsoft.com/visualstudio/jpn/products/visual-studio-express-products) を使用して Windows ストアアプリを作成するには、 **Express for Windows 8** が必要になります。 +- [Cordova](http://phonegap.com/download) の最新版をダウンロードし解凍します。 これから **lib\windows-8** サブフォルダーと一緒に作業を進めます。 + +3. 新規プロジェクトの作成 +-------------------- + +あなたは既に Windows ストアアプリにて利用可能な "HTML/JavaScript track" を使用して Windows 8 アプリを作ることができます。 Cordova の Windows ストアアプリでの目的は、他の Cordova プラットフォームで使用しているものと同じ API を Windows ストアアプリでも使用できるようにすることです。 + +- Visual Studio 2012 を開き、 **New Project** を選択します。 +- ツリーから **Installed - Template - Other Languages - JavaScript - Windows Store** を選択し、プロジェクトリストから **Blank App** を選択します。お好きなプロジェクト名を入力してください。このガイドでは **CordovaWin8Foo** を使用します。 + + ![](img/guide/getting-started/windows-8/wsnewproject.png) + +- Microsoft はウェブサイトのデフォルトページに、大抵の開発者が **index.html** を使用するのに対し、 **default.html** を使用し続けています。 (加えて、他のプラットフォームでも大抵 **index.html** がデフォルトページの名前として使われているでしょう。) これを修正するために、 Solution Explorer で **default.html** ファイルを **index.html** へリネームします。そして、 **package.appxmanifest** ファイルをダブルクリックし、 **Start page** の値を **index.html** に変更します。 + + ![](img/guide/getting-started/windows-8/wschangemanifest.png) + +- **cordova.js** をプロジェクトに含めるには、 Solution Explorer で **js** フォルダーを右クリックして **Add - New Item** を選択します。 **lib\windows-8** フォルダーにある **cordova.js** ファイルを指定します。 + +- **index.html** のコードを編集します。 **cordova.js** への参照を追加します。手動でもできますし、 Solution Explorer 内のファイルをドラッグすることでも追加できます。 + +### 参照の追加... + + + + + + + + + + + + +- 次に、 Cordova が動いていることを確認するためのコードを追加します。 + +### 'deviceready' ハンドラーの追加... + +

Content goes here

+ + + + + + +4. プロジェクトのテスト +------------------------------- + +- プロジェクトを Visual Studio から実行します。メッセージボックスが現れるのが確認できるでしょう。 + + ![](img/guide/getting-started/windows-8/wsalert.png) + +終了 +----- + +以上です。これで Windows ストアアプリを Cordova で作成する準備ができました。 + diff --git a/docs/jp/2.9.0/guide/getting-started/windows-phone/index.md b/docs/jp/2.9.0/guide/getting-started/windows-phone/index.md new file mode 100644 index 0000000000..575d364a5a --- /dev/null +++ b/docs/jp/2.9.0/guide/getting-started/windows-phone/index.md @@ -0,0 +1,116 @@ +--- +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. +--- + +Getting Started with Windows Phone +================================== + +このガイドは、 Cordova のための開発環境セットアップ方法、またシンプルなアプリの動かし方を解説します。 Cordova は以前は PhoneGap と呼ばれていたため、いくつかのサイトは PhoneGap という名前をまだ使用しています。 + +ビデオチュートリアル: +---------------- + +- [Cordova and Windows Phone quick setup video](http://www.youtube.com/v/wO9xdRcNHIM?autoplay=1) +- [Cordova and Windows Phone deep dive](http://www.youtube.com/v/BJFX1GRUXj8?autoplay=1) + + +1. 必要なもの +--------------- + +- Windows 7 または Windows Vista with SP2 + +注意: VM での動作は問題があります。もし Mac を使用している場合は、 bootcamp パーティションを Windows 7 または Vista でセットアップする必要があります。 + +デバイスへのインストールとマーケットプレイスへの登録のために、以下が必要です: + +- [App Hub member](http://create.msdn.com/en-US/home/membership) になる + + +2. SDK と Cordova のインストール +---------------------------- + +- [Windows Phone SDK](http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570/) のダウンロードとインストール +- [Cordova](http://phonegap.com/download) の最新版をダウンロードし解凍します。 これから lib\windows-phone\ サブフォルダーと一緒に作業を進めます。 +- CordovaStarter-x.x.x.zip のファイルを次のフォルダーにコピーします: \My Documents\Visual Studio 2010\Templates\ProjectTemplates\ +(もしテンプレートファイルが存在しない場合、これをビルドする必要があります。以下の 2.1 を参照してください) +もし VisualStudio をインストールしたばかりの場合は、このフォルダーを作成するために一度起動する必要があります。 +"Visual C#" の "Silverlight for Windows Phone" サブフォルダーの代わりにこのプロジェクトを追加することも出来ます。これは、新しいプロジェクトを作るときにプロジェクトテンプレートがどこに表れるかに影響するだけです。また、このフォルダーを作成する必要があるかもしれません。 + + +2.1 テンプレートのビルド +----------------------------- +(このステップは必要ないかもしれません。もし lib\windows-phone がすでに CordovaStarter-x.x.x.zip ファイルを含んでいる場合は、このステップをスキップしてください) +- Visual Studio Express for Windows Phone にある lib\windows-phone\templates\standalone\CordovaSolution.sln を開きます +- ファイルメニューから 'Export Template...' を選びます +- テンプレートタイプ 'Project template' を選びます +- エクスポートするテンプレート名を指定します。例: CordovaStarter-2.1.0 は CordovaStarter-2.1.0.zip となります +- 概要、アイコン画像、プレビュー画像などを必要に応じて追加します。これは、 Visual Studio の 'New Project' ダイアログで表示される内容になります +- 注意: もし ('Automatically import the template ... ') を選択した場合、ステップ2 にある .zip ファイルのコピーは必要ありません +- 'Finish' をクリックします + + + + +3. 新規プロジェクトの作成 +-------------------- + +- Visual Studio Express for Windows Phone を開き、 **New Project** を選択します。 +- **CordovaStarter** を選択します。 (テンプレートの説明の中に、バージョン番号が表示されます) + - 注意: もし見つからない場合は、 'Visual C#' を選択してみてください。 +- プロジェクト名を指定し、 OK をクリックします。 + + ![](img/guide/getting-started/windows-phone/wpnewproj.png) + + +4. プロジェクト構成の確認 +------------------------------- + +- 'www' フォルダーは Cordova の html/js/css ファイルとアプリのその他のリソースを含みます。 +- このフォルダーに追加した全てのコンテンツは Visual Studio プロジェクトの一部である必要があり、コンテンツとしてセットされている必要があります。 + + ![](img/guide/getting-started/windows-phone/wp7projectstructure.png) + + +5. ビルドとエミュレーターへのデプロイ +------------------------------- + +- **Windows Phone Emulator** が上部のドロップダウンメニューにて選択されていることを確認します。 +- Windows Phone Emulator が選択されたドロップダウンメニューの隣にある緑の **play ボタン** をクリックするか、 F5 を押下しデバッグを開始します。 + + ![](img/guide/getting-started/windows-phone/wprun.png) + ![](img/guide/getting-started/windows-phone/wpfirstrun.png) + + +6. デバイスのためにプロジェクトをビルド +------------------------------------ + +デバイスでアプリをテストするためには、デバイスは登録されていなければなりません。 [ここ][register-url] をクリックし、 Windows Phone へのデプロイとテストに関するドキュメントを読んでください。 + +- デバイスが接続され、スクリーンがアンロックなことを確認します +- Visual Studio で、上部のドロップダウンメニューから 'Windows Phone Device' を選択します +- ドロップダウンメニューの隣にある緑の **play ボタン** をクリックするか、 F5 を押下しデバッグを開始します + + ![](img/guide/getting-started/windows-phone/wpd.png) + + +終了 +----- + +さらに詳しいガイドは [ここ](http://wiki.phonegap.com/w/page/48672055/Getting%20Started%20with%20PhoneGap%20Windows%20Phone%207) で確認できます。 + +[register-url]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402565(v=vs.105).aspx diff --git a/docs/jp/2.9.0/guide/plugin-development/android/index.md b/docs/jp/2.9.0/guide/plugin-development/android/index.md new file mode 100644 index 0000000000..c2f165cf5f --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/android/index.md @@ -0,0 +1,188 @@ +--- +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. +--- + +# Developing a Plugin on Android + +プラグインの開発には、 Cordova-Android のアーキテクチャの理解が必要です。 +Cordova-Android は Android WebView とそれに付属するコールバックから構成されます。 +これらのプラグインは config.xml ファイル内にクラスマッピングとして表されています。 + +プラグインは `CordovaPlugin` クラスを継承した少なくとも1つの Java クラスによって構成されます。 +プラグインは `CordovaPlugin` の中の `execute` メソッドのうち1つを必ずオーバーライドしなければなりません。 +加えて、プラグイン作成のベストプラクティスとして、プラグインは pause と resume イベントをサポートし、またプラグイン間のメッセージのやりとりもサポートしているべきです。 +実行に時間がかかったり、バックグラウンドで動く (例: media の再生) もの、リスナーや内部状態を持つプラグインは `onReset()` メソッドが実装されているべきです。このメソッドは `WebView` が新しいページに遷移、もしくはリフレッシュした時、つまり JavaScript がリロードされた時に実行されます。 + +## プラグインクラスのマッピング + +プラグインの JavaScript 部分は常に `cordova.exec` メソッドを以下のように使います: + + exec(, , , , []); + +これは WebView から Android ネイティブ側へのリクエストを整理し、 +おおよそ要約すると `service` クラスで `action` メソッドを、 +`args` 配列で渡された引数と一緒に呼び出すということになります。 + +プラグインを Java ファイルで提供するしろ JAR でするにしろ、プラグインは必ず Cordova-Anroid アプリケーションの `res/xml` フォルダーにある `config.xml` ファイルに追加されていなければなりません。 + + + +サービス名 (name) は JavaScript の `exec` の中で定義したものと一致している必要があり、値 (value) は Java クラスへのネームスペースを含んだフルパスになります。これがないと、プラグインはコンパイルはされますが、 +Cordova からアクセスできない状態となります。 + +## Android Java プラグインの作成 + +私たちはプラグインリクエストをネイティブ側に送る JavaScript を作成しました。 +また、正しく `config.xml` ファイルでマッピングされた Android Java プラグインもあります。 +では、最終的に Android Java プラグインのクラスがどのようになるのか見ていきましょう。 + +JavaScript の `exec` 関数によってプラグインに割り当てられたものは、 +プラグインのクラスの `execute` メソッドに渡されます。大半の `execute` +の実装は以下のようになります: + + @Override + public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { + if ("beep".equals(action)) { + this.beep(args.getLong(0)); + callbackContext.success(); + return true; + } + return false; // "MethodNotFound" エラーのため false を返す + } + +`action` パラメーターの値を見て、クラス内の +(プライベート) メソッドに割り振っていきます。 +また、任意でいくつかのパラメーターをそのメソッドに渡します。 + +例外をキャッチしエラーを返すとき、 JavaScript へ返すエラーが Java で発生した例外に可能なかぎり近づけることは、明瞭さのためにも重要です。 + +### スレッド + +WebView の中の JavaScript は UI スレッド上で実行 *されません*。 +WebCore スレッド上で動いています。 `execute` メソッドもまた WebCore スレッド上で実行されます。 + +もし UI と何か処理をしたい場合は、以下のようにします: + + @Override + public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException { + if ("beep".equals(action)) { + final long duration = args.getLong(0); + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + ... + callbackContext.success(); // スレッドセーフ + } + }); + return true; + } + return false; + } + +もし UI スレッド上で動かす必要がなく、しかし WebCore スレッドをブロックしたくない場合は以下のようにします: + + @Override + public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException { + if ("beep".equals(action)) { + final long duration = args.getLong(0); + cordova.getThreadPool().execute(new Runnable() { + public void run() { + ... + callbackContext.success(); // スレッドセーフ + } + }); + return true; + } + return false; + } + +### Android プラグインの Echo プラグイン + +次を config.xml に追加します: + + + +そして、次を Cordova-Android アプリケーションの中の +`src/org/apache/cordova/plugin/Echo.java` に追加します: + + + package org.apache.cordova.CordovaPlugin; + + import org.apache.cordova.api.Plugin; + import org.apache.cordova.api.PluginResult; + import org.json.JSONArray; + import org.json.JSONException; + import org.json.JSONObject; + + /** + * このクラスは JavaScript から呼び出された文字列をecho します。 + */ + public class Echo extends CordovaPlugin { + @Override + public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { + if (action.equals("echo")) { + String message = args.getString(0);. + this.echo(message); + return true; + } + return false; + } + + private void echo(String message, CallbackContext callbackContext) { + if (message != null && message.length() > 0) {. + callbackContext.success(message); + } else { + callbackContext.error("Expected one non-empty string argument."); + } + } + } + +コードを見ていきましょう。一番上には、必要なすべての Cordova に関する +`import` 文が並んでいます。クラスは `CordovaPlugin` を継承しています。 +exec() からメッセージを受け取るために、 execute() メソッドをオーバーライドします。 +メソッドは、最初に `action` を見ていきます。このプラグインは1つ +のアクション `echo` のみをサポートしています。ほかのアクションは、 false を返します。 +これは、タイプが `INVALID_ACTION` のエラーとなります - これは JavaScript +側でエラーコールバックへの呼び出しに変換されます。次に、 `args` に対して +`getString` メソッドを使い、パラメーター配列から0番目のパラメーターを取得 +することにより、 echo する文字列を取り出します。ここで、少しパラメーターに +対してチェックを行います: `null` チェックや文字列の長さが0でないかどうかなど +です。もしそうであった場合は、 callbackContext.error() を呼びます (これはもう +ご存知の通り JavaScript 側でエラーコールバックを呼び出します)。 +もしこれらのチェックをパスしたら、 callbackContext.success() を呼び出し、 +パラメーターとして渡された `message` 文字列を渡します。これが、 +JavaScript 側で成功コールバック関数に変換されます。 +また、 `message` パラメーターを JavaScript の成功コールバック関数に +パラメーターとして渡します。 + +## プラグインのデバッグ + +Eclipse は Android プロジェクトのデバッグに使用でき、 Java のソースファイルがプロジェクトに含まれている場合は、プラグインもデバッグできます。最新バージョンの Android Dev Tools のみ JAR にソースコードを付与でき、これは今回はフルでサポートされていません。 + +## よくある落とし穴 + +* プラグインは `CordovaInterface` オブジェクトへのアクセス権を持っています。このオブジェクトはアプリケーションで走っている Android の `Activity` へのアクセス権を持っています。この `Activity` は新しい Android `Intent` を起動するために必要な `Context` です。 +`CordovaInterface` は、結果として `Activity` を開始すること、また `Intent` がアプリケーションに戻ってきたときにコールバックをセットすることをプラグインに許可します。 +`Intent` システムは Android のプロセス間の連携に使われるため、これは非常に重要です。 +* プラグインは `Context` への直接アクセス権を以前のように持っていません。以前の `ctx` はもう廃止され、 2.0 リリースの6ヶ月後に削除されます。 `Context` にあった `ctx` が存在するすべてのメソッド、 `getContext()` と `getActivity()` は必要な正しいオブジェクトを返すことが可能です。 + +## ソースコードを活用する + +プラグインを作成の準備としてもっとも良い方法のうちの一つは、 +[既に存在するプラグインを参考にすること](https://github.com/apache/incubator-cordova-android/tree/master/framework/src/org/apache/cordova) です。 + +また、 [CordovaPlugin.java](https://github.com/apache/incubator-cordova-android/blob/master/framework/src/org/apache/cordova/api/CordovaPlugin.java) のコメントもひと通り読むべきでしょう。 diff --git a/docs/jp/2.9.0/guide/plugin-development/bada/index.md b/docs/jp/2.9.0/guide/plugin-development/bada/index.md new file mode 100644 index 0000000000..2732582f91 --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/bada/index.md @@ -0,0 +1,74 @@ +--- +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. +--- + +Developing a Plugin on Bada +=========================== + +プラグインは Bada 2.0 以上のみサポートしています。 Bada 1.2 はサポートしていません。 + +Bada の実装はすべて JavaScript の実装です。そのため、カスタムプラグインを追加することは、プラグインコードによって CordovaJS を更新することになります。以下は、シンプルな _Hello World_ プラグインを追加するステップです: + +1. CordovaJS リポジトリーを clone します + + git clone https://git-wip-us.apache.org/repos/asf/incubuator-cordova-js.git + +2. __lib/bada/plugin/bada/__ 以下に新しい JavaScript ファイルを作成し、 _HelloWorld.js_ と名前をつけます。以下の内容を追加します: + + function HelloWorld() { + } + + HelloWorld.prototype.printHello = function(success, fail, arg) { + alert(Osp.Core.StringHelper('Hello %1', arg[0])); + } + + module.exports = new HelloWorld(); + +3. __lib/bada/platform.js__ の objects プロパティーの下に、新しく作ったプラグインへのリンクを追加します: + + objects: { + ... + HelloWorld: { + 'cordova/plugin/bada/HelloWorld' + }, + ... + } + ... +4. __lib/bada/exec.js__ のプラグインリストを、作ったプラグインを含むように更新します + + var plugins = { + ... + "HelloWorld": require('cordova/plugin/bada/HelloWorld') + }; +5. これで、好きなようにユーザー向けの JavaScript を書くことができます。しかし、プラグインを実行するためには、以下のメソッドを呼び出す必要があることを忘れないで下さい + + exec(succes, fail, 'HelloWorld', 'printHello', ['Jackson!']); + + success はプラグインが正常に終了したときに実行される成功コールバック関数です + fail はプラグインが正常に終了しなかったときに実行されるエラーコールバック関数です + 'HelloWorld' はあなたのプラグインの名前です + 'printHello' はあなたのプラグインのアクション名です + 最後のパラメーターは、プラグインへの引数です + +6. 以下のコマンドを実行し、新しい共通 JavaScript を生成します (npm モジュールの jake がインストールされていることを確認して下さい) + + jake + +7. 新しく生成された __pkg/cordova.bada.js__ を、 Bada プロジェクトの __Res/js__ 以下にコピーします + +6. 以上です!これで、あなたは新しい Bada プラグインを追加することができ、現在は Cordova Bada でサポートされていないたくさんの機能を実装できるようになりました。 diff --git a/docs/jp/2.9.0/guide/plugin-development/blackberry/index.md b/docs/jp/2.9.0/guide/plugin-development/blackberry/index.md new file mode 100644 index 0000000000..11f4481fef --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/blackberry/index.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. +--- + +Developing a Plugin on BlackBerry +================================= + +## Blackberry での Echo プラグインの作り方 + +このガイドでは、 BlackBerry での Echo プラグインの作り方について説明します。 +もし上位のガイドである JavaScript パートのプラグインについてのガイドを読んでいない場合は、それを最初に読むことをおすすめします。 +加えて、 [Cordova Blackberry repo](https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-blackberry-webworks.git;a=summary) をダウンロードしてください。 + +Cordova-BlackBerry プロジェクトは Torch, Bold, Playbook といった BlackBerry デバイスへのデプロイを可能にします。 +通常の携帯端末タイプの BlackBerry (例, Torch と Bold) とタブレットタイプの Playbook の間には、デプロイ方法に差があります。 +この2つのコードはベースが違うため、1つを開発しているときは、もう1つのためにコードを複製してあげる必要があります。 +そのため、このガイドでは携帯端末にフォーカスし、タブレットにはフォーカスしません。 +将来的には、両方のプラットフォームをカバーする予定です。 + + +前のガイドからの続きで、 Echo プラグインは基本的にユーザーが `window.echo` +関数で与えたメッセージを返します。 + +Echo 関数: + + window.echo = function(str, callback) { + cordova.exec(callback, function(err) { + callback('Nothing to echo.'); + }, "Echo", "echo", [str]); + }; + +## plugins.xml の修正 + +このファイルはプロジェクトの中の www フォルダーにあり、 Cordova プロジェクトが使用しているすべてのプラグインへの参照を含みます。 +新しい参照を追加して、 cordova.exec が呼ばれたときに、 Cordova が `cordova.exec` の "Echo" 引数を +これから書くネイティブコードの Echo クラスにマッピングすることが分かるようにします。 + + + ... + + ... + + +## Echo.java の追加 + +もし value 属性の構造にお気づきなら、 Echo プラグインへの定義されたパスが見えるでしょう。 +Cordova BlackBerry Webworks のリポジトリーのルートフォルダーで、 framework と呼ばれるフォルダーを探してください。 +このフォルダーは BlackBerry 上で動くすべてのソースコードを含んでいます。 +このフォルダー以下の `framework/ext/src/org/apache/cordova` にフォルダーに辿りつくまで cd し続けます。 +この時すべてのプラグインフォルダーが見えるでしょう。また、それぞれのフォルダーの中身はプラグインのソースコードとなっています。 +ここで、フォルダー echo を `framework/ext/src/org/apache/cordova/echo` に作成し、 +`Echo.java` をこの中の `framework/ext/src/org/apache/cordova/echo/Echo.java` の位置に新規追加します。 + +## Echo.java の実装 + +プラグインの実装の基本的なアイデアは、 Plugin クラスを継承するクラスを作成し、 +PluginResult クラスを返す execute と呼ばれるメソッドを作成することです。 +cordova.exec へのすべての呼び出しは、クラス内で実行したいアクションと引数を渡します。 +この場合、 "echo" がクラス "Echo" 内で実行したいアクションで、 [str] が渡している引数です。 + + package org.apache.cordova.echo; + + import org.apache.cordova.api.Plugin; + import org.apache.cordova.api.PluginResult; + import org.apache.cordova.json4j.JSONArray; + import org.apache.cordova.json4j.JSONException; + import org.apache.cordova.json4j.JSONObject; + /** + * BlackBerry でのプラグインの作り方デモのためのシンプルなプラグイン + * ユーザーがプラグインを呼び出したときのメッセージをそのまま返します + */ + public final class Echo extends Plugin { + + public static final String echo = "echo"; + + public PluginResult execute(String action, JSONArray args, String callbackId) { + PluginResult result = new PluginResult(PluginResult.Status.INVALID_ACTION, "Echo: Invalid action:" + action); + if(action.equals(echo)){ + try { + String theMsg = args.getString(0); + if(theMsg!= null || theMsg.length()>0){ + result = new PluginResult(PluginResult.Status.OK, theMsg); + }else{ + result = new PluginResult(PluginResult.Status.ERROR, "Nothing to echo."); + } + } catch (JSONException e) { + result = new PluginResult(PluginResult.Status.JSON_EXCEPTION, e.getMessage()); + } + } + + return result; + } + + } + +上のコードを見てみると、 execute メソッドの中で、最初にどんなアクションが来たかを調べているのが分かります。 +この Echo プラグインは1つのアクション "echo" のみを持つので、それのみをチェックします。 +もしプラグインに複数のアクションがあった場合は、 if 文を追加していき、これらをチェックしていきます。 + + +次に、 args パラメーターによって与えられた引数からメッセージを取得します。 +`String theMsg = args.getString(0);` とすることで、シンプルに一番最初の引数を取得することができます。 + +いくつかのエラーチェックをし、もしメッセージが大丈夫そうなら、 ok ステータス (PluginResult.Status.OK) とメッセージ (theMsg) を持つ +新しい PluginResult インスタンスを作ります。 +その後、 JavaScript に渡し、成功コールバック関数を呼び出す result を返します。 +もし何かエラーが起きた場合、 PluginResult.Status.ERROR, PluginResult.Status.JSON_EXCEPTION, PluginResult.Status.INVALID_ACTION といったような何種類かのステータス例外を返すことが出来ます。 +もしこのタイプの例外が返されたとき、 JavaScript 側ではエラーコールバックが +呼び出されます。 + +## www フォルダーの .jar の更新 + +あなたのプロジェクト内で Echo.java の追加分が更新される必要があります。 .jar ファイルをビルドするためには、 BlackBerry Webworks リポジトリーのルートディレクトリに cd します。 +次の ant コマンドを使用します: + + ant update -Dproject.path="~/path_to_my_project" + +これは build/ext フォルダーの中の新しい .jar ファイルをビルドします。 +`build/ext/cordova.jar` ファイルを プロジェクトの www/ext フォルダーにコピーします。 + +もしすべてが上手くいったら、 BlackBerry で Echo プラグインが使用できるようになっているはずです。 diff --git a/docs/jp/2.9.0/guide/plugin-development/index.md b/docs/jp/2.9.0/guide/plugin-development/index.md new file mode 100644 index 0000000000..81da8dbb37 --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/index.md @@ -0,0 +1,112 @@ +--- +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. +--- + +# プラグイン開発ガイド + +Cordava プラグインは Cordova アプリケーション Webview と Cordava +アプリケーションが走っているネイティブプラットフォームの機能的な +橋渡しをします。プラグインはすべてのプラットフォームで使われる +1つの JavaScript インターフェースに集約され、そのプラグイン +インターフェースに従ったプラットフォーム独自のネイティブ実装が +それぞれなされます。すべてのコア Cordova API はこのアーキテクチャ +を用いて実装されています。 + +このガイドはシンプルな Echo プラグインを書くために必要なステップを +紹介していきます。 Echo プラグインは JavaScript から文字列を受け取り、 +それをサポートされているプラットフォームのネイティブ環境に渡します。 +このネイティブコードは同じ文字列を、プラグインの JavaScript の +コールバックに含んで返します。 + +このガイドから、より複雑なプラグインを書くために必要な概観や詳細が +得られるはずです。 + +## JavaScript + +すべてのプラグインの最初の一歩は JavaScript です。開発者が Cordova を +使う理由は、 Objective-C でも Java でも C# でもなく、 JavaScript を使って +コードが書けるからです。プラグインにとって JavaScript インターフェースは +まさしく顔であり、もっとも重要な部分であると言えるでしょう。 + +あなたはプラグインの JavaScript を好きなように構成できます。ただ一つ、 +Cordova JavaScript とネイティブ環境との間のコミュニケーションのために +`cordova.exec` 関数を _使う必要があります_ 。以下が例です: + + cordova.exec(function(winParam) {}, function(error) {}, "service", + "action", ["firstArgument", "secondArgument", 42, + false]); + +以下がパラメーターの詳細説明です: + +1. `function(winParam) {}` - 成功コールバック関数です。 `exec` の実行が + 正常に完了したとき、この関数が呼び出されます + (任意で返されたパラメーターと一緒に呼び出されます) +2. `function(error) {}` - エラーコールバック関数です。もし操作が正常に + 完了しなかったとき、この関数が呼び出されます + (任意で返されたパラメーターと一緒に呼び出されます) +3. `"service"` - ネイティブ側で呼び出されるサービス名です。これは + ネイティブクラスにマッピングされます。詳しくは、以下のネイティブ + ガイドで説明しています +4. `"action"` - 呼び出されるアクション名です。 `exec` からの呼び出しを + 受けるネイティブクラスで取り出され、プラットフォームに依存して、 + クラスのメソッドにマッピングされます。詳しくは、以下のネイティブ + ガイドで説明しています +5. `[/* arguments */]` - ネイティブ環境に渡される引数です + + +### Echo プラグイン JavaScript の例 + + window.echo = function(str, callback) { + cordova.exec(callback, function(err) { + callback('Nothing to echo.'); + }, "Echo", "echo", [str]); + }; + +詳しく見ていきましょう。プラグインを `window` に `echo` 関数として +付与しています。プラグインのユーザーは以下のように使用します: + + + window.echo("echome", function(echoValue) { + alert(echoValue == "echome"); // should alert true. + }); + +はじめに、 `exec` 関数の後ろ3つの引数について見ていきましょう。 +私たちは、 `Echo` "サービス" を呼び出し、 `echo` "アクション" を +リクエストし、そして `window.echo` 関数の最初のパラメーターである +文字列を含んだ配列を引数として渡しています。 + +`exec` に渡される成功コールバック関数は `window.echo` が受取る +コールバック関数を単純に参照しています。エラーコールバックについては +もう少し手を加えています: もしネイティブ側でエラーコールバックを呼び出した +場合は、単純に成功コールバックを呼び出し、 "デフォルト" 文字列を渡します。 + +## ネイティブ + +プラグインの JavaScript の定義が終わったら、それに少なくとも1つの +ネイティブ実装を付け加える必要があります。以下は Cordova がサポート +しているそれぞれのプラットフォームに特化したガイドになります。 +以下のガイドでは引き続き、このガイドで作り始めた Echo プラグインを +作成していきます。 + +- Developing a Plugin on Android +- Developing a Plugin on Bada +- Developing a Plugin on BlackBerry +- Developing a Plugin on iOS +- Developing a Plugin on webOS +- Developing a Plugin on Windows Phone +- Developing a Plugin on Tizen diff --git a/docs/jp/2.9.0/guide/plugin-development/ios/index.md b/docs/jp/2.9.0/guide/plugin-development/ios/index.md new file mode 100644 index 0000000000..1bc1bb5516 --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/ios/index.md @@ -0,0 +1,173 @@ +--- +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. +--- + +# Developing a Plugin on iOS + +プラグインは `CDVPlugin` クラスを継承した Objective-C のクラスです。 + +各プラグインクラスは Cordova.plist ファイルの Plugins キーを使用し登録されている必要があります。 + +## プラグインクラスのマッピング + +プラグインの JavaScript 部分は常に `cordova.exec` メソッドを以下のように使います: + + exec(, , , , []); + +これは UIWebView から iOS ネイティブ側へのリクエストを整理し、おおよそ要約すると `service` クラスで `action` メソッドを、 `args` 配列で渡された引数と一緒に呼び出すということになります。 + +実行に時間がかかったり、バックグラウンドで動く (例: media の再生) もの、リスナーや内部状態を持つプラグインは `onReset()` メソッドが実装され、これらの動作を停止またはリセットすべきです。このメソッドは `UIWebView` が新しいページに遷移、もしくはリフレッシュした時、つまり JavaScript がリロードされた時に実行されます。 + +このプラグインは、 Cordova-iOS アプリケーションのプロジェクトフォルダーの中の `Cordova.plist` ファイルの `Plugins` キー (辞書) に追加される必要があります。 + + service_name + PluginClassName + +`service_name` のキーは JavaScript の `exec` の中で使用しているものと一致している必要があり、値はプラグインの Objective-C クラスの名前になります。これがないと、プラグインはコンパイルされますが、 Cordova からアクセスできない状態となります。 + +## iOS Cordova Plugin の作成 + +私たちはプラグインリクエストをネイティブ側に送る JavaScript を作成しました。また、正しく `Cordova.plist` ファイルでマッピングされた iOS Objective-C プラグインもあります。では、最終的に iOS Objective-C プラグインのクラスがどのようになるのか見ていきましょう。 + +JavaScript の `exec` 関数によってプラグインに割り当てられたものは、プラグインクラスの対応する `action` メソッドに渡されます。プラグインメソッドのシグネチャは次のようになります: + + - (void)myMethod:(CDVInvokedUrlCommand*)command + { + CDVPluginResult* pluginResult = nil; + NSString* myarg = [command.arguments objectAtIndex:0]; + + if (myarg != nil) { + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + } else { + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Arg was null"]; + } + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + } + +1. [CDVInvokedUrlCommand.h](https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVInvokedUrlCommand.h) +2. [CDVPluginResult.h](https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVPluginResult.h) + + +## プラグインシグネチャ + +**Cordova 2.1.0** からサポートされた **新しいシグネチャ** は次のとおりです: + + - (void)myMethod:(CDVInvokedUrlCommand*)command; + +**古い (非推奨)** シグネチャはつぎのとおりです: + + - (void)myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; + +基本的に、オプション辞書は新しいシグネチャでは削除されており、 callbackId は引数配列の 0 番目の要素ではなく、別のプロパティーとなっています。 + +## iOS プラグインの Echo プラグイン + +`Cordova.plist` ファイルの `Plugins` キー (辞書) に以下を追加します: + + Echo + Echo + +次のファイル (`Echo.h` と `Echo.m`) を Cordova-iOS アプリケーションフォルダーの中の +プラグインフォルダーに追加します: + + /********* Echo.h Cordova Plugin Header *******/ + + #import + + @interface Echo : CDVPlugin + + - (void)echo:(CDVInvokedUrlCommand*)command; + + @end + + /********* Echo.m Cordova Plugin Implementation *******/ + + #import "Echo.h" + #import + + @implementation Echo + + - (void)echo:(CDVInvokedUrlCommand*)command + { + CDVPluginResult* pluginResult = nil; + NSString* echo = [command.arguments objectAtIndex:0]; + + if (echo != nil && [echo length] > 0) { + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo]; + } else { + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; + } + + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + } + + @end + + +コードを見ていきましょう。一番上には、必要なすべての Cordova に関する import 文が並んでいます。クラスは `CDVPlugin` を継承しています - これはとても重要です。 + +このプラグインは 1 つのアクション `echo` のみをサポートしています。最初に、 `objectAtIndex` メソッドを `args` に使って引数配列 0 番目の要素である echo 用文字列を取得します。次に、 `objectAtIndex` メソッドを使って、引数配列の1番目の要素である echo 用文字列を取得します。ここで、少しパラメーターに対してチェックを行います: `nil` チェックや文字列の長さが0でないかどうかなどです。 + +もしそうであった場合は、ステータスが `ERROR` の `PluginResult` を返します。もしこれらのチェックをパスしたら、ステータスが `OK` の `PluginResult` を返し、パラメーターとして受け取った `echo` 文字列を渡します。 + +最後に、 `self.commandDelegate` に結果を返します。これは、 JavaScript 側で成功またはエラーコールバック関数を実行するような JavaScript を実行します。もし成功コールバックが呼ばれた場合は、 `echo` パラメーターをパラメーターとして渡します。 + +## スレッド + +たとえ UIWebView が dedicated thread 上で実行されるとしても、プラグインメソッドは UI スレッドで実行されます。もしプラグインが尋常じゃない数のプロセスが必要、または処理をブロックする必要がある場合は、バックグラウンドスレッドを使用するべきです。使用例は次のとおりです: + + - (void)myPluginMethod:(CDVInvokedUrlCommand*)command + { + // Check command.arguments here. + [self.commandDelegate runInBackground:^{ + NSString* payload = nil; + // Some blocking logic... + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:payload]; + // The sendPluginResult method is thread-safe. + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + }]; + } + + +## 一歩進んだプラグインの機能 + +他にも、オーバーライド出来るメソッドについては以下を参照してください: + +1. [CDVPlugin.h](https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.h) +2. [CDVPlugin.m](https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.m) + +例えば、 pausa, resume, app terminate, handleOpenURL events といったような機能を実装できます。 + +## プラグインのデバッグ + +Objective-C 側でデバッグするには、 Xcode のビルトインのデバッガーを使用します。 JavaScript 側では、 iOS 5.0 では [Apache Cordova Project の Weinre](https://github.com/apache/incubator-cordova-weinre) または [サードパーティ製の iWebInspector](http://www.iwebinspector.com/) を使用できます。 + +iOS 6 では、 Safari 6.0 を使用して簡単に iOS 6 シミュレーター上で動いているアプリをデバッグできます。 + +## よくある落とし穴 + +* Cordova.plist にプラグインマッピングを追加することを忘れないでください - もし忘れている場合は、 Xcode のコンソールログにエラーが表示されます +* 接続するすべてのホストを [ホワイトリスト](guide_whitelist_index.md.html#Domain%20Whitelist%20Guide) に追加することを忘れないで下さい - もし忘れている場合は、 Xcode のコンソールログにエラーが表示されます + +## 非推奨のプラグインシグネチャに関する注意点 + +**古い (非推奨)** シグネチャはつぎのとおりです: + + - (void) myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; + +Objective-C プラグインメソッドの `options` パラメーターは非推奨であり、使われるべきではありません。レガシー的な理由で、 `args` 配列の最後の JavaScript オブジェクト要素は、 Objective-C 側メソッドの `options` 辞書に渡されます。どんな JavaScript オブジェクトでも `args` 配列の最後の要素として渡されるべきであり、もし配列の途中の要素に JavaScript オブジェクトがあると、それ以降の Objective-C 側の配列のインデックスがでたらめになることに十分注意してください。 options 辞書はただ1つの JavaScript オブジェクトのみをサポートしており、また配列の一番最後の要素のみネイティブメソッドに渡されます。このようにエラーを起こしやすいので、 `options` は非推奨となっています。 diff --git a/docs/jp/2.9.0/guide/plugin-development/tizen/index.md b/docs/jp/2.9.0/guide/plugin-development/tizen/index.md new file mode 100644 index 0000000000..c210a2632b --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/tizen/index.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. +--- + +Developing a Plugin on Tizen +============================ + +プラグインは Tizen プラットフォームでは現在サポートされていません。 diff --git a/docs/jp/2.9.0/guide/plugin-development/webos/index.md b/docs/jp/2.9.0/guide/plugin-development/webos/index.md new file mode 100644 index 0000000000..e341f4ffec --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/webos/index.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. +--- + +Developing a Plugin on webOS +============================ + +プラグインは webOS プラットフォームでは現在サポートされていません。 diff --git a/docs/jp/2.9.0/guide/plugin-development/windows-phone/index.md b/docs/jp/2.9.0/guide/plugin-development/windows-phone/index.md new file mode 100644 index 0000000000..8c79c8fb3b --- /dev/null +++ b/docs/jp/2.9.0/guide/plugin-development/windows-phone/index.md @@ -0,0 +1,192 @@ +--- +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. +--- + +Developing a Plugin on Windows Phone +==================================== + +Windows Phone プラグインの開発には、 Cordova のアーキテクチャの理解が必要です。 +Cordova-WP7 は Javascript コードをホストし、 +ネイティブの API 呼び出しを管理する WebBrowser から構成されています。 +C# には継承可能な BaseCommand (`WP7CordovaClassLib.Cordova.Commands.BaseCommand`) クラスがあり、 +このクラスは開発者のために大半の基本的な機能を保持しています。 + +1. プロジェクトを選択し、右クリックから 'Add -> New Item ...' を選びます + - どこに追加するかはあなたの自由ですが、できれば 'Plugins' フォルダーに追加してください +2. 'Class' を選択し `Echo.cs` と名前をつけます + - このクラスの名前は `cordova.exec(win, fail, "Echo", ...)` で呼び出す名前と完全に一致している必要があります +3. ベースクラスをインクルードします + + using WP7CordovaClassLib.Cordova; + using WP7CordovaClassLib.Cordova.Commands; + using WP7CordovaClassLib.Cordova.JSON; + +4. BaseCommand クラスを継承します + + public class Echo : BaseCommand + { + // ... + } + +5. JS から呼び出し可能なメソッドを追加します + + public class Echo : BaseCommand + { + public void echo(string options) + { + // 全ての JS から呼び出されるメソッドはこのシグネチャを持つ必要があります + // publicで, void を返し, string の引数が 1 つ + } + } + +ネームスペース +---------- + +コマンドのデフォルトのネームスペースは: + + namespace Cordova.Extension.Commands + { + // ... + } + +もし別のネームスペースを使用したい場合は、 `cordova.exec` の呼び出しの際にネームスペースが省略されていないクラス名を指定する必要があります。 +例えば、もし以下のように C# のクラスを定義した場合は: + + namespace com.mydomain.cordovaExtensions + { + public class Echo : BaseCommand + { + // ... + } + } + +JS では、 exec を以下のように呼び出します: + + codova.exec(win, fail, "com.mydomain.cordovaExtensions.Echo", ...); + +C# での引数の読み取り +---------------------------------- + +プラグインメソッドから受け取った値は文字列ですが、 +JavaScript のコードを見ると、実は文字列の配列を渡そうとしていた、ということがあります。 +JS での `cordova.exec` の呼び出し部分をみると、 `[str]` を渡していることがわかります: + + cordova.exec(win, fail, "Echo", "echo", ["input string"]); + +ここで `Echo.echo` メソッドに渡された文字列を検証すると、 +値は実際には次であることがわかります: + + "[\"input string\"]" + +全ての Javascript の exec 引数は、 C# に渡される前に JSON エンコードされます。 + +もしこれを期待している値にしたい場合は、デコードする必要があります。 +シンプルに JSON のデシリアライゼーションを使います。 + + string optVal = JsonHelper.Deserialize(options)[0]; + // optVal は "input string" となります + +C# から JS へ結果を渡す +----------------------------- + +ベースクラスの BaseCommand はデータを JS のコールバックハンドラーに渡すためのメソッドを提供しています。 +追加情報が必要なく、単にコマンドが成功したことを通知するためには、 +シンプルに以下を呼びます: + + DispatchCommandResult(); // 空のプラグイン結果とともに、成功したとみなされコールバックします + +データを返すには、異なる形式の `DispatchCommandResult` を呼ぶ必要があります: + + DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "すべて計画通りにいきました。これは成功ハンドラーに渡される結果データです。")); + +構造化されたデータを JS に渡すには、 JSON 形式にエンコードされている必要があります: +To pass structured object data back to JS, it should be encoded as a JSON string: + + DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "{result:\"うまくいきました!\"}")); + +エラーが発生したことを通知する場合には、 `DispatchCommandResult` を `PluginResult` を伴って呼ぶことができます: + + DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Echo はエラーが発生したと伝えています")); + +プラグインの C# メソッドでのシリアライゼーションエラーの対処 +-------------------------------------------------------- + +引数を解析するときに、万が一不正な入力があった場合のためにも try/catch ブロックを +使用するとよいでしょう。以下は、 Cordova の C# コードで使われている方法です: + + string optVal = null; + + try + { + optVal = JsonHelper.Deserialize(options)[0]; + } + catch(Exception) + { + // 例外をキャッチし、 null 値と例外を一緒に対処します + } + + if (optVal == null) + { + DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); + } + else + { + // ... 任意のコードを続けます + } + +一歩進んだプラグインの機能 +----------------------------- + +オーバーライドできるその他の機能については以下を参照してください: + +1. [BaseCommand.cs](https://github.com/apache/incubator-cordova-wp7/blob/master/templates/standalone/cordovalib/Commands/BaseCommand.cs) + +例えば、 'pause' や 'resume' といったアプリケーションイベントもオーバーライドできます。 + +### プラグインのデバッグ + +C# 側でデバッグするには、 Visual Studio のデバッガーを使用します。クラスの任意の箇所に +ブレークポイントを設置してください。 + +Windows Phone での Javascript のデバッグは少し難しいです。 `console.log` を使用して +プラグインの状態を出力するなどの方法をとる必要があるでしょう。 + +よくある落とし穴 +--------------- + +- JavaScript 実装時に、プラグインに渡す引数を決める際には十分に注意してください。 + 大半のデバイスは cordova.exec に渡される引数は配列であると期待していますが、 + もし配列の中に異なる形式のオブジェクトが含まれる場合は、 + デシリアライズが非常に困難、もしくは不可能となってしまいます。 + + cordova.exec(win, fail, "ServiceName", "MethodName", ["これは文字列です", 54, {literal:'trouble'}]); + + - これは、以下のようなデコードが非常に困難な文字列を C# 側で受け取ることを意味します: + + "[\"これは文字列です\", 54, { literal:'trouble' }]" + + - exec を呼び出す前に、全てのパラメーターを文字列に変換することを考慮してください: + + cordova.exec(win, fail, "ServiceName", "MethodName", ["これは文字列です", "54", "{literal:'trouble'}"]) ; + + string[] optValues = JsonHelper.Deserialize(options); + +- exec を呼び出す前に JavaScript コード内でパラメーターのチェックをすることを心がけましょう。 + これは JS のコードをプラグインの異なるネイティブ実装間で + 再利用しやすくするという利点もあります。 + diff --git a/docs/jp/2.9.0/guide/project-settings/index.md b/docs/jp/2.9.0/guide/project-settings/index.md new file mode 100644 index 0000000000..343b2f7481 --- /dev/null +++ b/docs/jp/2.9.0/guide/project-settings/index.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. +--- + +プロジェクトの設定 +================ + +- Project Settings for iOS diff --git a/docs/jp/2.9.0/guide/project-settings/ios/index.md b/docs/jp/2.9.0/guide/project-settings/ios/index.md new file mode 100644 index 0000000000..331e3d2a81 --- /dev/null +++ b/docs/jp/2.9.0/guide/project-settings/ios/index.md @@ -0,0 +1,53 @@ + + +Project Settings for iOS +======================== + +**Cordova.plist 設定ファイル** は Cordova の多くの設定を管理します。これはアプリケーション全体の設定であり、 CDVViewController インスタンス毎の設定ではありません。 + +1. CDVViewController で使用出来る **プラグイン** のリスト (Plugins 辞書 - キーは JavaScript で servicename として使用されているもの、値はプラグインのための Objective-C のクラス (CDVPlugin のサブクラス)) +2. Cordova が接続できるホスト (スキーマやパスなしで、ホスト名または IP アドレスのみ) の **ホワイトリスト** (ExternalHosts 配列に設定 - ワイルドカード使用可能) +3. **その他** 色々な設定 (既存のアプリを壊さないようにデフォルトは設定されています) + + a. **UIWebViewBounce (boolean, デフォルト YES)** - もし WebView をバウンスさせたくない場合は NO を設定します + + b. **TopActivityIndicator (string, デフォルト 'gray')** - ステータスバーにあるインジケーターの色を指定します。有効な値は "whiteLarge" と "white" と"gray" です + + c. **EnableLocation (boolean, デフォルト NO)** - YES に設定することで、 Geolocation プラグインをアプリ起動時から初期化します (位置情報がより正確になります) + + d. **EnableViewportScale (boolean, デフォルト NO)** - YES に設定することで、メタタグでの viewport のスケーリングを防ぎます + + e. **AutoHideSplashScreen (boolean, デフォルト YES)** - NO に設定した場合、 JavaScript API によっていつスプラッシュスクリーンが非表示になるかを管理します + + f. **ShowSplashScreenSpinner (boolean, デフォルト YES)** - NO に設定した場合、スプラッシュスクリーンのスピナーを非表示にします + + g. **MediaPlaybackRequiresUserAction (boolean, デフォルト NO)** - YES に設定することで、 HTML5 ビデオの自動再生を禁止します + + h. **AllowInlineMediaPlayback (boolean, デフォルト NO)** - YES に設定することで、インラインの HTML5 メディアの再生を許可します。また、 HTML 内の video 要素は webkit-playsinline 属性を含む必要があります + + i. **OpenAllWhitelistURLsInWebView (boolean, デフォルト NO)** - YES に設定することで、メインの WebView 内ですべてのホワイトリストの URL を開きます + + j. **BackupWebStorage (string, デフォルト 'cloud')** - 有効な値は 'none' と 'cloud' と 'local' です。 Set to 'cloud' と設定することで、 web storage data の iCloud でのバックアップを許可します。 'local' はローカルバックアップ (iTunes との同期によるバックアップ) のみ許可します。 'none' は web storage のいかなるバックアップも許可しません。 + + k. **KeyboardDisplayRequiresUserAction (boolean, デフォルト YES)** - NO に設定することで、 JavaScript の focus() が呼び出されてフォーム要素がフォーカスされた時、キーボードが開くようにします + + l. **SuppressesIncrementalRendering (boolean, デフォルト NO)** - YES に設定することで、レンダリングの前にすべての新しい view コンテンツがロードされるのを待ちます diff --git a/docs/jp/2.9.0/guide/upgrading/android/index.md b/docs/jp/2.9.0/guide/upgrading/android/index.md new file mode 100644 index 0000000000..db7272d949 --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/android/index.md @@ -0,0 +1,182 @@ +--- +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. +--- + +Upgrading Cordova Android +========================= + + +これは、 Cordova を古いバージョンから新しいバージョンにアップグレードする必要がある人のためのドキュメントです。 + +## 2.1.0 から 2.2.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-2.1.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-2.2.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-2.2.0.js をプロジェクトにコピーします +5. HTML を、新しい cordova-2.2.0.js を使って更新します +6. res/xml/config.xml を framework/res/xml/config.xml と同じとなるようにコピーします + + +## 2.0.0 から 2.1.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-2.0.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-2.1.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-2.1.0.js をプロジェクトにコピーします +5. HTML を、新しい cordova-2.1.0.js を使って更新します +6. res/xml/config.xml を framework/res/xml/config.xml と同じとなるようにコピーします + + +## 1.9.0 から 2.0.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-1.9.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-2.0.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-2.0.0.js をプロジェクトにコピーします +5. HTML を、新しい cordova-2.0.0.js を使って更新します +6. res/xml/config.xml を framework/res/xml/config.xml と同じとなるようにコピーします + +### 2.0.0 リリースに関する注意点 +config.xml は cordova.xml と plugins.xml に置き換わるものです。この新しい config.xml は前の2つのコンビネーションです。 +しかしながら古いファイルは廃止予定であり、現在はまだ動きますが、将来的のリリースでは動かなくなります。 + +## 1.8.1 から 1.9.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-1.8.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-1.9.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-1.9.0.js をプロジェクトにコピーします +5. HTML を、新しい cordova-1.9.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します + +### 1.9.0 リリースに関する注意点 + +- サードパーティーのプラグインは動く場合と、動かない場合があります。これは、 CordovaWebView がリリースされたためです。これらのプラグインはコンテキスト取得の際に、 getContext() または getActivity() を使用して CordovaInterface から取得する必要があります。 +もし Android アプリケーション開発を熟知していない場合は、プラグインの開発者に連絡を取り、彼らのバグトラッキングシステムにタスクとして登録するよう伝えてください。 + +## 1.8.0 から 1.8.1 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-1.8.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-1.8.1.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-1.8.1.js をプロジェクトにコピーします +5. HTML を、新しい cordova-1.8.1.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します + + +## 1.7.0 から 1.8.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-1.7.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-1.8.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-1.8.0.js をプロジェクトにコピーします +5. HTML を、新しい cordova-1.8.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します + + +## 1.6.1 から 1.7.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-1.6.1.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-1.7.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-1.7.0.js をプロジェクトにコピーします +5. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します + + +## 1.6.0 から 1.6.1 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-1.6.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-1.6.1.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-1.6.1.js をプロジェクトにコピーします +5. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します + +## 1.5.0 から 1.6.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから cordova-1.5.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-1.6.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-1.6.0.js をプロジェクトにコピーします +5. HTML を、新しい cordova-1.6.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します +7. res/xml/phonegap.xml を、 framework/res/xml/cordova.xml と同じになるように res/xml/cordova.xml に置き換えます + +## 1.4.0 から 1.5.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから phonegap-1.4.0.jar を削除します +2. プロジェクトの libs ディレクトリに cordova-1.5.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい cordova-1.5.0.js をプロジェクトにコピーします +5. HTML を、新しい cordova-1.5.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します +7. res/xml/phonegap.xml を、 framework/res/xml/cordova.xml と同じになるように res/xml/cordova.xml に置き換えます + +## 1.3.0 から 1.4.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから phonegap-1.3.0.jar を削除します +2. プロジェクトの libs ディレクトリに phonegap-1.4.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい phonegap-1.4.0.js をプロジェクトにコピーします +5. HTML を、新しい phonegap-1.4.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します +7. res/xml/phonegap.xml を framework/res/xml/phonegap.xml と同じになるように更新します + + +## 1.2.0 から 1.3.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから phonegap-1.2.0.jar を削除します +2. プロジェクトの libs ディレクトリに phonegap-1.3.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい phonegap-1.3.0.js をプロジェクトにコピーします +5. HTML を、新しい phonegap-1.3.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します +7. res/xml/phonegap.xml を framework/res/xml/phonegap.xml と同じになるように更新します + + +## 1.1.0 から 1.2.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから phonegap-1.1.0.jar を削除します +2. プロジェクトの libs ディレクトリに phonegap-1.2.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい phonegap-1.2.0.js をプロジェクトにコピーします +5. HTML を、新しい phonegap-1.2.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します +7. res/xml/phonegap.xml を framework/res/xml/phonegap.xml と同じになるように更新します + + +## 1.0.0 から 1.1.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから phonegap-1.0.0.jar を削除します +2. プロジェクトの libs ディレクトリに phonegap-1.1.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい phonegap-1.1.0.js をプロジェクトにコピーします +5. HTML を、新しい phonegap-1.1.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します + + +## 0.9.6 から 1.0.0 へのアップグレード ## + +1. プロジェクトの libs ディレクトリから phonegap-0.9.6.jar を削除します +2. プロジェクトの libs ディレクトリに phonegap-1.0.0.jar を追加します +3. もし Eclipse を使用している場合は、プロジェクトをリフレッシュし clean を実行します +4. 新しい phonegap-1.0.0.js をプロジェクトにコピーします +5. HTML を、新しい phonegap-1.0.0.js を使って更新します +6. res/xml/plugins.xml を framework/res/xml/plugins.xml と同じとなるように更新します + + diff --git a/docs/jp/2.9.0/guide/upgrading/bada/index.md b/docs/jp/2.9.0/guide/upgrading/bada/index.md new file mode 100644 index 0000000000..0aa5a9bbcb --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/bada/index.md @@ -0,0 +1,48 @@ +--- +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. +--- + +Upgrading Cordova Bada +====================== + +これは、 Cordova を古いバージョンから新しいバージョンにアップグレードする +必要がある人のためのドキュメントです。 + +## 1.9.0 から 2.0.0 へのアップグレード ## + +1. 新しい JavaScript ファイルを使って `Res/js/cordova.js` を更新します + +## 1.8.x から 1.9.0 へのアップグレード ## + +1. 新しい JavaScript ファイルを使って `Res/js/cordova.js` を更新します + +## 1.7.0 から 1.8.x へのアップグレード ## + +1. cordova.bada.js ファイルを Res/js ディレクトリから削除します +2. 新しい cordova.js ファイルを Res/js ディレクトリに追加します +3. Res/index.html を、 cordova.js ではなく cordova.bada.js を参照するように更新します + +この行を次から: + + +次に変更します: + + + +Cordova 1.8 では、 Bada 1.2 は既にサポートされていません。 +このリポジトリは今後も使用したい方のためにアーカイブとして存続します。このため、これにはいくつかの廃止された API が含まれます。 diff --git a/docs/jp/2.9.0/guide/upgrading/blackberry/index.md b/docs/jp/2.9.0/guide/upgrading/blackberry/index.md new file mode 100644 index 0000000000..96b3506678 --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/blackberry/index.md @@ -0,0 +1,117 @@ +--- +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. +--- + +Upgrading Cordova BlackBerry +============================ + +これは、 Cordova を古いバージョンから新しいバージョンにアップグレードする必要がある人のためのドキュメントです。 + +## 1.9.0 から 2.0.0 へのアップグレード ## + +www フォルダーのアップデート: + +1. アプリの `www/` フォルダーを開きます +2. `ext/` フォルダーにある .jar ファイルを削除し更新します +3. `ext-air/` フォルダーの内容を更新します +4. 新しい `cordova-2.0.0.js` をプロジェクトにコピーします + - playbook の場合は `playbook/` フォルダーの中の .js ファイルを更新します +5. HTML を、新しい `cordova-2.0.0.js` を使って更新します +6. `www/plugins.xml` ファイルを更新します。2つのプラグインの + ネームスペース/サービスのラベルが変更されています。 + 古い Capture 及び Contact プラグインを次から: + + + + + 次に変更します: + + + + + +サンプルフォルダーのアップデート (例, ant ツールを使ったアップデート): + +1. `sample/lib/` フォルダーを開きます +2. `cordova.1.9.0/ext/` フォルダーにある .jar ファイルを更新します +3. `cordova.1.9.0/ext-air/` フォルダーの内容を更新します +4. `cordova.1.9.0/javascript/` フォルダーにある .js ファイルを更新します +5. `sample/lib/` フォルダーを開き、 `cordova.1.9.0/` フォルダーの名前を `cordova.2.0.0/` に変更します +6. `www/` フォルダーを新しい Cordova でアップデートするため、 `ant blackberry build` または `ant playbook build` とタイプします +7. `www/` フォルダーを開き、新しい `cordova-2.0.0.js` を使って HTML を更新します +8. `www/` フォルダーを開き `plugins.xml` ファイルを更新します。2つのプラグインの + ネームスペース/サービスのラベルが変更されています。 + 古い Capture 及び Contact プラグインを次から: + + + + + 次に変更します: + + + + + + + +- 1.8.0 にアップグレードするには、 1.7.0 からアップグレードしてください + +## 1.7.0 から 1.8.0 へのアップグレード ## + +www フォルダーのアップデート: + +1. アプリの `www/` フォルダーを開きます +2. `ext/` フォルダーにある .jar ファイルを削除し更新します +3. `ext-air/` フォルダーの内容を更新します +4. 新しい `cordova-1.8.0.js` をプロジェクトにコピーします + - playbook の場合は `playbook/` フォルダーの中の .js ファイルを更新します +5. 新しい `cordova-1.8.0.js` を使って HTML を更新します +6. `www/plugins.xml` ファイルを更新します。2つのプラグインの + ネームスペース/サービスのラベルが変更されています。 + 古い Capture 及び Contact プラグインを次から: + + + + + 次に変更します: + + + + + +サンプルフォルダーのアップデート (例, ant ツールを使ったアップデート): + +1. `sample/lib/` フォルダーを開きます +2. `cordova.1.7.0/ext/` フォルダーにある .jar ファイルを更新します +3. `cordova.1.7.0/ext-air/` フォルダーの内容を更新します +4. `cordova.1.7.0/javascript/` フォルダーにある .js ファイルを更新します +5. `sample/lib/` フォルダーを開き、 `cordova.1.7.0/` フォルダーを `cordova.1.8.0/` へリネームします +6. `www/` フォルダーを新しい Cordova でアップデートするため、 `ant blackberry build` または `ant playbook build` とタイプします +7. `www/` フォルダーを開き、HTML を、新しい `cordova-1.8.0.js` を使って更新します +8. `www/` フォルダーを開き `plugins.xml` ファイルを更新します。2つのプラグインの + ネームスペース/サービスのラベルが変更されています。 + 古い Capture 及び Contact プラグインを次から: + + + + + 次に変更します: + + + + diff --git a/docs/jp/2.9.0/guide/upgrading/index.md b/docs/jp/2.9.0/guide/upgrading/index.md new file mode 100644 index 0000000000..910940185a --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/index.md @@ -0,0 +1,32 @@ +--- +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. +--- + +アップグレードガイド +================ + +> アプリケーションを最新の Apache Cordova にアップグレードする方法を解説します。 + +- Upgrading Cordova Android +- Upgrading Cordova BlackBerry +- Upgrading Cordova iOS +- Upgrading Cordova Symbian +- Upgrading Cordova webOS +- Upgrading Cordova Windows Phone +- Upgrading Cordova Bada +- Upgrading Cordova Tizen diff --git a/docs/jp/2.9.0/guide/upgrading/ios/index.md b/docs/jp/2.9.0/guide/upgrading/ios/index.md new file mode 100644 index 0000000000..ac0c297da8 --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/ios/index.md @@ -0,0 +1,310 @@ +--- +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. +--- + +Upgrading Cordova iOS +===================== + +**Xcode 4.5 が必須** であることに注意してください。 Apple App Store に提出するためには、最新バージョンの iOS SDK (iOS 6) を使用する必要があります。 iOS 6 は Xcode 4.5 を必要とします。 + +## 2.1.0 から 2.2.0 へのアップグレード ## + +1. ハードディスクの**恒久的なフォルダー** (例: ~/Documents/Cordova-2.2.0) に **Cordova 2.2.0 をダウンロードし解凍**します +2. Xcode が起動している場合、 **終了** します +3. **Terminal.app** を使用して、Cordova をダウンロードしたディレクトリまで **移動**します +4. コマンドラインツールから [**新規プロジェクトを作成**](guide_command-line_index.md.html#Command-Line%20Usage_ios) します - この新規プロジェクトからアセットを持っていきます +5. 新規プロジェクトから **www/cordova-2.2.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-2.1.0.js** ファイルを削除します +6. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-2.2.0.js** ファイルを参照するように **更新** します +7. **MainViewController.m** を新規プロジェクトから更新 (または、もしファイルを変更してなかった場合は置換) します: + - 追加されたもの -> viewWillAppear +8. **"cordova"** フォルダーを新しいプロジェクトから既存プロジェクトのルートフォルダーにコピーします **(2.2.0 では、 'emulate' スクリプトのアップデートがあります)** +9. 次に、 CordovaLib のサブプロジェクトの参照を更新します。 Cordova 2.1.0 から、 CordovaLib がどこに存在するかを示す CORDOVALIB という Xcode の変数は使用しなくなり、絶対ファイル参照となりました。 + 1. **Terminal.app** を起動します + 2. **ステップ 1** で Cordova をインストールした位置の、 **bin** サブフォルダーに移動します + 3. 以下のスクリプトを走らせます。パラメーターは、プロジェクトの **.xcodeproj** ファイルへのパスです + + `update_cordova_subproject path/to/your/project/xcodeproj` + +**注意** 2.2.0 では、 **bin/create** スクリプトが プロジェクトの CordovaLib サブプロジェクト内にコピーされるようになります。同じようなセットアップを保持するためにも、正しい CordovaLib をプロジェクトのフォルダーにコピーして、 CordovaLib サブプロジェクトの位置情報 (プロジェクトに関係) を Xcode File Inspector で更新してください。 + +## 2.0.0 から 2.1.0 へのアップグレード ## + +**Cordova 2.1.0** では、 CordovaLib は **Automatic Reference Counting (ARC)** を使用するようにアップグレードされました。 CordovaLib を使用するにあたって **ARC** にアップグレードする必要はありませんが、もしプロジェクトを **ARC** を使用するようにアップグレードしたい場合は、メニューから Xcode migration wizard : **Edit -> Refactor -> Convert to Objective-C ARC…** を使用して、 **libCordova.a を選択解除** し、ウィザードを完了してください。 + +1. ハードディスクの**恒久的なフォルダー** (例: ~/Documents/Cordova-2.1.0) に **Cordova 2.1.0 をダウンロードし解凍**します +2. Xcode が起動している場合、 **終了** します +3. **Terminal.app** を使用して、Cordova をダウンロードしたディレクトリまで **移動**します +4. コマンドラインツールから [**新規プロジェクトを作成**](guide_command-line_index.md.html#Command-Line%20Usage_ios) します - この新規プロジェクトからアセットを持っていきます +5. 新規プロジェクトから **www/cordova-2.1.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-2.0.0.js** ファイルを削除します +6. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-2.1.0.js** ファイルを参照するように **更新** します +7. **AppDelegate.m** を新規プロジェクトから更新 (または、もしファイルを変更してなかった場合は置換) します: + - 編集されたもの -> application:didFinishLaunchingWithOptions: + - 追加されたもの -> application:supportedInterfaceOrientationsForWindow: +8. **MainViewController.m** を新規プロジェクトから更新 (または、もしファイルを変更してなかった場合は置換) します: + - 追加されたもの -> viewWillAppear +9. **"cordova"** フォルダーを新しいプロジェクトから既存プロジェクトのルートフォルダーにコピーします **(2.1.0 では、スペースを含むパスをサポートするようになりました)** +10. **プロジェクト** から **VERSION** ファイルの参照を削除します (CordovaLib にあるものでは**ありません**) +11. 次に、 CordovaLib のサブプロジェクトの参照を更新します。 Cordova 2.1.0 から、 CordovaLib がどこに存在するかを示す CORDOVALIB という Xcode の変数は使用しなくなり、絶対ファイル参照となりました。 + 1. **Terminal.app** を起動します + 2. **ステップ 1** で Cordova をインストールした位置の、 **bin** サブフォルダーに移動します + 3. 以下のスクリプトを走らせます。パラメーターは、プロジェクトの **.xcodeproj** ファイルへのパスです + + `update_cordova_subproject path/to/your/project/xcodeproj` + +## 1.9.0 から 2.0.0 へのアップグレード ## + +1. Cordova 2.0.0 を **インストール** します +2. コマンドラインツールから [**新規プロジェクトを作成**](guide_command-line_index.md.html#Command-Line%20Usage_ios) します - この新規プロジェクトからアセットを持っていきます +3. 新規プロジェクトから **www/cordova-2.0.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-1.9.0.js** ファイルを削除します +4. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-2.0.0.js** ファイルを参照するように **更新** します +5. 新規プロジェクトから **"cordova"** フォルダーを、 root フォルダーにコピーします (もしコマンドラインツールを使用したい場合) +6. **Cordova.plist** ファイル (**Supporting Files** グループの下) の中の **Plugins** 以下に新しいエントリーを **追加** します - キーは **Device** で値は **CDVDevice** です +7. **Cordova.framework** を削除します +8. **Supporting Files** グループから **verify.sh** を削除します +9. Project Navigator の **Project アイコン** をクリックし、 **Target** を選択し、 **"Build Settings"** タブを選択します +10. **"Preprocessor Macros"** を検索し、すべての **"CORDOVA_FRAMEWORK=1"** の値を削除します +11. ハードドライブのホームディレクトリの下の **Documents** フォルダーにインストールされた **CordovaLib** フォルダーを開きます +12. **CordovaLib** フォルダーの中にある **CordovaLib.xcodeproj** ファイルを見つけ、ファイルをプロジェクトに **ドラッグアンドドロップ** します - このフォルダは **サブプロジェクト** として表示されるはずです +13. プロジェクトを **ビルド** します。いくつかの **#import** ディレクティブに関する **エラー** が検出されるはずです +14. **#import に関するエラー** に対しては、すべての **引用符ベースの** import 文を、次から: + + #import "CDV.h" + + 次の **山括弧ベース** のスタイルに変更します: + + #import + + そして、 **#ifdef** で囲まれたすべての Cordova に関する import を削除します。これらはもう必要ありません (import は **統合** されました) +15. プロジェクトを再び **ビルド** します。ここでは、 **#import** エラーが検出されないはずです +16. Project Navigator の **Project アイコン** をクリックし、 **Target** を選択し、 **"Build Phases"** タブを選択します +17. **"Target Dependencies"** phase を展開し、 **"+"** ボタンを選択します +18. **"CordovaLib"** target を選択し、 **"Add"** ボタンを選択します +19. 一番上の **"Link Binary with Libraries"** phase (既に多くの framework が入っているはずです) を展開し、 **"+"** ボタンを選択します +20. **libCordova.a** static library を選択し、 **"Add"** ボタンを選択します +21. **"Ran Script"** phase を削除します +22. Project Navigator の **Project アイコン** をクリックし、 **Target** を選択し、 **"Build Settings"** タブを選択します +23. **"Other Linker Flags"** を探し、 **-all_load** と **-Obj-C** を値に追加します +24. **"CordovaLib" sub-project** を展開します +25. **"VERSION"** ファイルを見つけ、メインプロジェクトにドラッグします (ここではコピーではなくリンクを作成します) +26. **"Create groups for any added folders"** ラジオボタンを選択し、 **"Finish"** ボタンを選択します +27. 前のステップでドラッグした **"VERSION"** ファイルを選択します +28. **File Inspector** を開くため、 **Option-Command-1** キーを押します (または、メニューから **View -> Utilities -> Show File Inspector**) +29. **Location** のドロップダウンメニューのため、 **File Inspector** から **"Relative to CORDOVALIB"** を選択します +30. プロジェクトを **ビルド** します。 **問題なく** コンパイルされるはずです +31. **Scheme** ドロップダウンから **プロジェクトを選択** し、 **"iPhone 5.1 Simulator"** を選択します +32. **Run** ボタンを選択します + +**注意1:** +もしプロジェクトがシミュレーターで期待通りに **動かない** 場合は、 **Xcode のコンソールログ** にある **すべてのエラーに注意して** 原因を探ってください。 + +**注意2:** +**統合した #import ヘッダー** が機能するために、ビルドプロダクトは **同じビルドディレクトリでビルドする** 必要があります。 **"Xcode Preferences -> Locations -> Derived Data -> Advanced…"** の設定を **"Unique"** に変更する必要があるかもしれません。 + +## 1.8.x から 1.9.0 へのアップグレード ## + +1. Cordova 1.9.0 を **インストール** します +2. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持っていきます +3. 新規プロジェクトから **www/cordova-1.9.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-1.8.x.js** ファイルを削除します +4. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-1.9.0.js** ファイルを参照するように **更新** します + +**注意:** + +1.9.0 は、 Cordova.plist で新しい boolean の **"BackupWebStorage"** 設定値をサポートします。デフォルトでは、これは有効に設定されています。 "false" と設定することで無効にすることができます (特に iOS 6 のため) 。詳しくは [Release Notes - Safari and UIKit Section](https://developer.apple.com/library/prerelease/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html) を参照してください + + +## 1.7.0 から 1.8.x へのアップグレード ## + +1. Cordova 1.8.0 を **インストール** します +2. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持っていきます +3. 新規プロジェクトから **www/cordova-1.8.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-1.7.x.js** ファイルを削除します +4. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-1.8.0.js** ファイルを参照するように **更新** します + +もし **Capture API** を使う場合は、新しい **iPad retina-display** アセットが必要です: + +1. 新規プロジェクトから **Resources/Capture.bundle** を既存プロジェクトの **Resources/Capture.bundle** に上書きコピーします +2. 既存プロジェクトで、 Xcode の Project Navigator の中の **Capture.bundle** を選択し、 **Delete** キーを押します。ポップアップダイアログで、 **Remove Reference** を選択します +3. ステップ1から新しい **Capture.bundle** を Xcode の Project Navigator 上にドラッグし、 **Create groups for any added folders** ラジオボタンを選択します + +## 1.6.x から 1.7.0 へのアップグレード ## + +1. Cordova 1.7.0 を **インストール** します +2. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持っていきます +3. 新規プロジェクトから **www/cordova-1.7.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-1.6.0.js** ファイルを削除します +4. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-1.7.0.js** ファイルを参照するように **更新** します + +## 1.5.0 から 1.6.x へのアップグレード ## + +1. Cordova 1.6.1 を **インストール** します +2. プロジェクト内の **AppDelegate.m**, **AppDelegate.h**, **MainViewController.m**, **MainViewController.h**, **Cordova.plist** の **バックアップを作成します** +3. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持って行きます +4. 以下のファイルを **新しい** プロジェクトから1.5.0ベースのプロジェクトのフォルダーにコピーし、古いファイルは **置き換え** ます (上のステップ2でファイルを **バックアップ** します): + + AppDelegate.h + AppDelegate.m + MainViewController.h + MainViewController.m + Cordova.plist +5. すべての新しい **MainViewController** と **AppDelegate** ファイルを Xcode プロジェクトに **追加** します +6. 新規プロジェクトから **www/cordova-1.6.1.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-1.5.0.js** ファイルを削除します +7. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-1.6.1.js** ファイルを参照するように **更新** します +8. 新しい **Cordova.plist** ファイルをプロジェクトに **追加** します - これは、 Android や Blackberry のものと一致するような、統一した Cordova JavaScript ファイル (cordova-js) にするよう、コアプラグインサービス名を変更するためです +9. **バックアップした Cordova.plist** にあった各設定, **Plugins**, **ExternalHosts** を新しい **Cordova.plist** に **統合** します +10. **バックアップした AppDelegate.h 及び AppDelegate.m** にあったプロジェクト固有のコードを新しい AppDelegate ファイルに **統合** します。 **AppDelegate.m** の中の **UIWebViewDelegate** または **CDVCommandDelegate** にあったコードは MainViewController.m に移動します (詳しくはファイル中のコメントアウトされた箇所を参照してください) +11. **バックアップした MainViewController.h 及び MainViewController.m** にあったプロジェクト固有のコードを新しい MainViewController ファイルに **統合** します +12. Project Navigator の **Project アイコン** をクリックし、 **Project** を選択し、 **"Build Settings"** タブを選択します +13. 検索フィールドに **"Compiler for C/C++/Objective-C"** と入力します +14. **"Apple LLVM Compiler 3.1"** を選択します + + +## 1.4.x から 1.5.0 へのアップグレード ## + +1. Cordova 1.5.0 を **インストール** します +2. **新規プロジェクトを作成し** 一度実行します - この新規プロジェクトからアセットを持って行きます +3. 新規プロジェクトから **www/cordova-1.5.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/cordova-1.5.x.js** ファイルを削除します +4. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **cordova-1.5.0.js** ファイルを参照するように **更新** します +5. Project Navigator から **"PhoneGap.framework"** を探し、選択します +6. **Delete** キーを押して、 Project Navigator の中の **"PhoneGap.framework"** の参照を削除します +7. **Option-Command-A** キーを押します。ファイルをプロジェクトに追加するためのドロップダウン画面 (**"Add Files.." 画面**) が開きます。 **"Created groups for any added folders"** のラジオボタンが選択されていることを確認します +8. **Shift-Command-G** キーを押します。フォルダー移動のための別のドロップダウン画面 (**"Go to the folder:" 画面**) が開きます +9. **"/Users/Shared/Cordova/Frameworks/Cordova.framework"** と入力し、 **"Go"** ボタンをクリックします +10. **"Add Files.." 画面** で **"Add"** ボタンをクリックします +11. Project Navigator で **"Cordova.framework" を選択** します +12. **File Inspector** を開くため、 **Option-Command-1** キーを押します +13. **Location** のドロップダウンメニューのため、 **File Inspector** から **"Absolute Path"** を選択します +14. **Option-Command-A** キーを押します。ファイルをプロジェクトに追加するためのドロップダウン画面 (**"Add Files.." 画面**) が開きます。 **"Created groups for any added folders"** のラジオボタンが選択されていることを確認します +15. **Shift-Command-G** キーを押します。フォルダー移動のための別のドロップダウン画面 (**"Go to the folder:" 画面**) が開きます +16. **"~/Documents/CordovaLib/Classes/deprecated"** と入力し、 **"Go"** ボタンをクリックします +17. **"Add Files.." 画面** で **"Add"** ボタンをクリックします +18. **AppDelegate.h, AppDelegate.m, MainViewController.h** ファイルの **#ifdef PHONEGAP_FRAMEWORK** の部分を以下に置き換えます: + + #import "CDVDeprecated.h" +19. Project Navigator の **Project アイコン** をクリックし、 **Target** を選択し、 **"Build Settings"** タブを選択します +20. **"Framework Search Paths"** を探します +21. 値を **"/Users/Shared/Cordova/Frameworks"** に置き換えます +22. **"Preprocessor Macros"** を探します +23. 最初の (複合の) 値を **"CORDOVA_FRAMEWORK=YES"** に置き換えます +24. **"Build Phases"** タブを選択します +25. **"Run Script"** を展開します +26. すべての **PhoneGap** を **Cordova** に置き換えます +27. Project Navigator から **"PhoneGap.plist"** を探し、ファイル名をクリックしてファイル名が編集可能な状態にします +28. ファイル名の **"PhoneGap.plist"** を **"Cordova.plist"** に変更します +29. **"Cordova.plist"** を右クリックし、**"Open As" --> "Source Code"** を選択します +30. **Option-Command-F** キーを押し、 Source ウィンドウ左上のドロップダウンから **"Replace"** を選択します +31. 検索文字に **com.phonegap** 、置換文字に **org.apache.cordova** を入力します。 **"Replace All"** ボタンをクリックします +32. 検索文字に **PG** 、置換文字に **CDV** を入力します。 **"Replace All"** ボタンをクリックします +33. **Command-B** キーを押してビルドします。まだいくつかの非推奨コードが残っていますが、これらは取り除くことができます (**CDVDeprecated.h** を参照してください。ソースコードの中のクラスを、 PG* から CDV* に変更するなどが方法として挙げられます) + +## 1.4.0 から 1.4.1 へのアップグレード ## + +1. Cordova 1.4.1 を **インストール** します +2. **MainViewController.m** の **バックアップを作成します** +3. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持って行きます +4. **MainViewController.m** を **新しい** プロジェクトから1.4.0ベースのプロジェクトのフォルダーにコピーし、古いファイルは **置き換え** ます (上のステップ2でファイルを **バックアップ** します) +5. **MainViewController.m** を Xcode プロジェクトに **追加** します +6. **バックアップした MainViewController.m** にあったプロジェクト固有のコードを新しいファイルに **統合** します +7. phonegap-X.X.X.js ファイルは任意で更新してください。 JavaScript の中身は、1.4.0と1.4.1で違いがありません + +## 1.3.0 から 1.4.0 へのアップグレード ## + +1. Cordova 1.4.0 を **インストール** します +2. **AppDelegate.m** と **AppDelegate.h** の **バックアップを作成します** +3. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持って行きます +4. 以下のファイルを **新しい** プロジェクトから1.3.0ベースのプロジェクトのフォルダーにコピーし、古いファイルは **置き換え** ます (上のステップ2でファイルを **バックアップ** します): + + AppDelegate.h + AppDelegate.m + MainViewController.h + MainViewController.m + MainViewController.xib +5. すべての新しい **MainViewController** ファイルを Xcode プロジェクトに **追加** します +6. 新規プロジェクトから **www/phonegap-1.4.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/phonegap-1.3.0.js** ファイルを削除します +7. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **phonegap-1.4.0.js** ファイルを参照するように **更新** します +8. **PhoneGap.plist** ファイルの **Plugins** の下に新しい要素を **追加** します - キーは **com.phonegap.battery** で値は **PGBattery** です +9. **バックアップした AppDelegate.h 及び AppDelegate.m** にあったプロジェクト固有のコードを新しい AppDelegate ファイルに **統合** します + +## 1.2.0 から 1.3.0 へのアップグレード ## + +1. Cordova 1.3.0 を **インストール** します +2. **AppDelegate.m** と **AppDelegate.h** の **バックアップを作成します** +3. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持って行きます +4. 以下のファイルを **新しい** プロジェクトから1.2.0ベースのプロジェクトのフォルダーにコピーし、古いファイルは **置き換え** ます (上のステップ2でファイルを **バックアップ** します): + + AppDelegate.h + AppDelegate.m + MainViewController.h + MainViewController.m + MainViewController.xib +5. すべての新しい **MainViewController** ファイルを Xcode プロジェクトに **追加** します +6. 新規プロジェクトから **www/phonegap-1.3.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/phonegap-1.2.0.js** ファイルを削除します +7. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **phonegap-1.3.0.js** ファイルを参照するように **更新** します +8. **PhoneGap.plist** ファイルの **Plugins** の下に新しい要素を **追加** します - キーは **com.phonegap.battery** で値は **PGBattery** です +9. **バックアップした AppDelegate.h 及び AppDelegate.m** にあったプロジェクト固有のコードを新しい AppDelegate ファイルに **統合** します + +## 1.1.0 から 1.2.0 へのアップグレード ## + +1. Cordova 1.2.0 を **インストール** します +2. **AppDelegate.m** と **AppDelegate.h** の **バックアップを作成します** +3. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持って行きます +4. 以下のファイルを **新しい** プロジェクトから1.1.0ベースのプロジェクトのフォルダーにコピーし、古いファイルは **置き換え** ます (上のステップ2でファイルを **バックアップ** します): + + AppDelegate.h + AppDelegate.m + MainViewController.h + MainViewController.m + MainViewController.xib +5. すべての新しい **MainViewController** ファイルを Xcode プロジェクトに **追加** します +6. 新規プロジェクトから **www/phonegap-1.2.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/phonegap-1.1.0.js** ファイルを削除します +7. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **phonegap-1.2.0.js** ファイルを参照するように **更新** します +8. **PhoneGap.plist** ファイルの **Plugins** の下に新しい要素を **追加** します - キーは **com.phonegap.battery** で値は **PGBattery** です +9. **バックアップした AppDelegate.h 及び AppDelegate.m** にあったプロジェクト固有のコードを新しい AppDelegate ファイルに **統合** します + +## 1.0.0 から 1.1.0 へのアップグレード ## + +1. Cordova 1.1.0 を **インストール** します +2. **AppDelegate.m** と **AppDelegate.h** の **バックアップを作成します** +3. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持って行きます +4. 以下のファイルを **新しい** プロジェクトから1.1.0ベースのプロジェクトのフォルダーにコピーし、古いファイルは **置き換え** ます (上のステップ2でファイルを **バックアップ** します): + + AppDelegate.h + AppDelegate.m + MainViewController.h + MainViewController.m + MainViewController.xib +5. すべての新しい **MainViewController** ファイルを Xcode プロジェクトに **追加** します +6. 新規プロジェクトから **www/phonegap-1.2.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/phonegap-1.1.0.js** ファイルを削除します +7. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **phonegap-1.2.0.js** ファイルを参照するように **更新** します +8. **PhoneGap.plist** ファイルの **Plugins** の下に新しい要素を **追加** します - キーは **com.phonegap.battery** で値は **PGBattery** です +9. **バックアップした AppDelegate.h 及び AppDelegate.m** にあったプロジェクト固有のコードを新しい AppDelegate ファイルに **統合** します + +## 0.9.6 から 1.0.0 へのアップグレード ## + +1. Cordova 1.0.0 を **インストール** します +2. **AppDelegate.m** と **AppDelegate.h** の **バックアップを作成します** +3. **新規プロジェクトを作成します** - この新規プロジェクトからアセットを持って行きます +4. 以下のファイルを **新しい** プロジェクトから0.9.6ベースのプロジェクトのフォルダーにコピーし、古いファイルは **置き換え** ます (上のステップ2でファイルを **バックアップ** します): + + AppDelegate.h + AppDelegate.m + MainViewController.h + MainViewController.m + MainViewController.xib +5. すべての新しい **MainViewController** ファイルを Xcode プロジェクトに **追加** します +6. 新規プロジェクトから **www/phonegap-1.0.0.js** ファイルを **www** フォルダーに **コピー** し、 **www/phonegap-0.9.6.js** ファイルを削除します +7. **www/index.html** ファイル (また、他に Cordova script を参照しているファイル) の Cordova script 参照部分を、新しい **phonegap-1.0.0.js** ファイルを参照するように **更新** します +8. **PhoneGap.plist** ファイルの **Plugins** の下に新しい要素を **追加** します - キーは **com.phonegap.battery** で値は **PGBattery** です +9. **バックアップした AppDelegate.h 及び AppDelegate.m** にあったプロジェクト固有のコードを新しい AppDelegate ファイルに **統合** します diff --git a/docs/jp/2.9.0/guide/upgrading/symbian/index.md b/docs/jp/2.9.0/guide/upgrading/symbian/index.md new file mode 100644 index 0000000000..77c3d0e719 --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/symbian/index.md @@ -0,0 +1,21 @@ +--- +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. +--- + +Upgrading Cordova Symbian +========================= diff --git a/docs/jp/2.9.0/guide/upgrading/tizen/index.md b/docs/jp/2.9.0/guide/upgrading/tizen/index.md new file mode 100644 index 0000000000..bea849544e --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/tizen/index.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. +--- + +Upgrading Cordova Tizen +====================== + +これは、 Cordova を古いバージョンから新しいバージョンにアップグレードする必要が>ある人のためのドキュメントです。 diff --git a/docs/jp/2.9.0/guide/upgrading/webos/index.md b/docs/jp/2.9.0/guide/upgrading/webos/index.md new file mode 100644 index 0000000000..4e0914dcf8 --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/webos/index.md @@ -0,0 +1,38 @@ +--- +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. +--- + +Upgrading Cordova webOS +======================= + +これは、 Cordova を古いバージョンから新しいバージョンにアップグレードする必要がある人のためのドキュメントです。 + +## 2.0.0 から 2.1.0 へのアップグレード ## + +1. cordova-2.0.0.js をプロジェクトから削除します + +2. index.html から次の行を更新します: + + 次から: + + + 次に変更します: + + +3. makefile を実行し、新しいバージョンの cordova-2.1.0.js ファイルを生成します + diff --git a/docs/jp/2.9.0/guide/upgrading/windows-phone/index.md b/docs/jp/2.9.0/guide/upgrading/windows-phone/index.md new file mode 100644 index 0000000000..35af5aacb2 --- /dev/null +++ b/docs/jp/2.9.0/guide/upgrading/windows-phone/index.md @@ -0,0 +1,147 @@ +--- +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. +--- + +Upgrading Cordova Windows Phone +=============================== + +これは、 Cordova を古いバージョンから新しいバージョンにアップグレードする必要がある人のためのドキュメントです。 + +## 1.9.0 から 2.0.0 へのアップグレード ## + +Apache Cordova 2.0.0 では WP7 プロジェクト構成に対してかなりの変更が加えられたので、アップグレードは他とは少し違います。厳密に言うとアップグレードではなく、新規プロジェクトを作成し、既存のソースファイルをコピーするといったような手順になります。 + +### Visual Studio の Solution Explorer ウィンドウ内: +1. 新しい Apache Cordova WP7 2.0 プロジェクトを作成します +2. 'www' フォルダーの中身を新しいプロジェクトにコピーします。ここで、中身が VS のプロジェクトに追加されていることを確認して下さい +3. 新しい cordova-2.0.0.js を使って HTML を更新します +4. スプラッシュスクリーンやアイコン画像をコピーまたは上書きします +5. プラグインフォルダーからすべてのプラグインを新しいプロジェクトにコピーします。ここで、プラグインが VS のプロジェクトに追加されていることを確認してください +6. ビルドし、テストします + + +## 1.8.0 から 1.9.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.9.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.9.0.js を使って HTML を更新します + + +## 1.7.0 から 1.8.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.8.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.8.0.js を使って HTML を更新します + +## 1.6.0 から 1.7.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.7.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.7.0.js を使って HTML を更新します + +## 1.6.0 から 1.6.1 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.6.1.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.6.1.js を使って HTML を更新します + +## 1.5.0 から 1.6.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.6.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.6.0.js を使って HTML を更新します + +## 1.4.0 から 1.5.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.5.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.5.0.js を使って HTML を更新します + +## 1.3.0 から 1.4.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.4.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.4.0.js を使って HTML を更新します + +## 1.2.0 から 1.3.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.3.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.3.0.js を使って HTML を更新します + +## 1.1.0 から 1.2.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.2.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.2.0.js を使って HTML を更新します + +## 1.0.0 から 1.1.0 へのアップグレード ## + +### Visual Studio の Solution Explorer ウィンドウ内: +1. プロジェクトから GapLib/WP7CordovaClassLib.dll ファイルを削除します +2. References フォルダー内の WP7CordovaClassLib への参照を削除します +3. References を右クリックし、 'Add Reference' を選択します +4. 新しいバージョンの 'WP7CordovaClassLib.dll' ファイルを追加します + - 注意: DLL のバージョンは、 reference を右クリックし Properties を選択することにより確認出来ます +5. 新しい cordova-1.1.0.js をプロジェクトにコピーします (Content としてマークされていることを確認してください) +6. 新しい cordova-1.1.0.js を使って HTML を更新します diff --git a/docs/jp/2.9.0/guide/whitelist/index.md b/docs/jp/2.9.0/guide/whitelist/index.md new file mode 100644 index 0000000000..15aee5f6ea --- /dev/null +++ b/docs/jp/2.9.0/guide/whitelist/index.md @@ -0,0 +1,191 @@ +--- +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. +--- + +ドメインホワイトリストガイド +===================== + +概要 +-------- + +Apache Cordova のドメインホワイトリストは、 `http://google.com` などの外部ドメインへのアクセスを制御するセキュリティモデルです。デフォルトのセキュリティポリシーは全てのネットワークアクセスをブロックします。アプリケーション開発者は、特定のネットワークのドメインやサブドメインへのアクセスを宣言して許可できます。 + +仕様 +------------- + +ドメインホワイトリストは [W3C Widget Access][1] の仕様に基づいています。 Widget Access 仕様の中で、 `` 要素はネットワークドメインへのアクセス許可を指定するために使われています。将来、 Apache Cordova はホワイトリスト実装のプラットフォームの W3C Widget Access 仕様書。しかしながら、現在は各プラットフォームは各々のドメインホワイトリストを実装する必要があります。 + +シンタックス +------ + +[google.com][2] へのアクセス: + + http://google.com + +[google.com][3] へのセキュアアクセス (`https://`): + + https://google.com + +[maps.google.com][4] サブドメインへのアクセス: + + http://maps.google.com + +[google.com][2] のすべてのサブドメインへのアクセス (例: [mail.google.com][5] 及び [docs.google.com][6]): + + http://*.google.com + +すべてのドメインへのアクセス (例: [google.com][2] 及び [developer.mozilla.org][7]): + + * + +Android +------- + +### 詳細 + +ホワイトリストのルールは `res/xml/config.xml` で見つけることができ、 `` 要素によって宣言できます。 + +Android はホワイトリストのシンタックスをフルサポートしています。 + +### シンタックス + +[google.com][2] へのアクセス: + + + +Bada +---- + +ドメインホワイトリストは Bada ではサポートされていません。デフォルトとして、全てのドメインにアクセス可能です。 + +BlackBerry +---------- + +### 詳細 + +ホワイトリストのルールは `www/config.xml` で見つけることができ、 `` 要素によって宣言できます。 + +詳細については、 [BlackBerry WebWorks Access Element documentation][8] を参照してください。 + +### シンタックス + +[google.com][2] へのアクセス: + + + +[maps.google.com][4] へのアクセス: + + + +[google.com][2] のすべてのサブドメインへのアクセス: + + + +`file://` プロトコルを含むすべてのドメインへのアクセス: + + + +iOS +--- + +### 詳細 + +1. `Cordova.plist` を開きます + - Xcode 内では `AppName/Supporting Files/Cordova.plist` で見つけられます + - ディレクトリ内では `AppName/Cordova.plist` で見つけられます +2. `ExternalHosts` キー配下に新しい文字列を追加します + - XML の直接編集を避けるため、 Xcode を使用することを勧めます + + +### シンタックス + +[google.com][2] のアクセス及び [google.com][3] へのセキュアアクセス (`https://`): + + google.com + +[maps.google.com][4] サブドメインへのアクセス: + + maps.google.com + +[google.com][2] のすべてのサブドメインへのアクセス (例: [mail.google.com][5] 及び [docs.google.com][6]): + + *.google.com + +すべてのドメインへのアクセス (例: [google.com][2] 及び [developer.mozilla.org][7]): + + * + +iOS のワイルドカード (`*`) は [W3C Widget Access][1] の仕様より柔軟です。 + +すべてのサブドメインへ及び TLD (`.com`, `.net` など) へのアクセス: + + *.google.* + +Symbian +------- + + +ドメインホワイトリストは Symbian ではサポートされていません。デフォルトとして、全てのドメインにアクセス可能です。 + +webOS +----- + +ドメインホワイトリストは webOS ではサポートされていません。デフォルトとして、全てのドメインにアクセス可能です。 + +Windows Phone +------------- + +ドメインホワイトリストは Windows Phone ではサポートされていません。デフォルトとして、全てのドメインにアクセス可能です。 + +Tizen +---------- + +### 詳細 + +ドメインホワイトリストのルールはアプリケーションのルートディレクトリにある `config.xml` で見つけることができます。 +これらは、 `` 要素によって宣言されています。 +詳細については、 [Tizen Accessing External Network Resources documentation][9] を参照してください。 + + +### シンタックス + +[google.com][2] のアクセス: + + + +[google.com][3] へのセキュアアクセス (`https://`): + + + +[google.com][2] のすべてのサブドメインへのアクセス: + + + +`file://` プロトコルを含むすべてのドメインへのアクセス: + + + +[1]: http://www.w3.org/TR/widgets-access/ +[2]: http://google.com +[3]: https://google.com +[4]: http://maps.google.com +[5]: http://mail.google.com +[6]: http://docs.google.com +[7]: http://developer.mozilla.org +[8]: https://developer.blackberry.com/html5/documentation/ww_developing/Access_element_834677_11.html +[9]: https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_4#8814682_CreatingaProject-AccessingExternalNetworkResources diff --git a/docs/jp/2.9.0/index.md b/docs/jp/2.9.0/index.md new file mode 100644 index 0000000000..4f7958d811 --- /dev/null +++ b/docs/jp/2.9.0/index.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. +--- + +
+

API リファレンス

+
    +
  • +

    Accelerometer

    + デバイスの加速度センサー情報を取得します。 +
  • +
  • +

    Camera

    + カメラを通じて写真を取得します。 +
  • +
  • +

    Capture

    + デバイスのメディアキャプチャー機能を通じてメディアファイルを取得します。 +
  • +
  • +

    Compass

    + コンパス方向を取得します。 +
  • +
  • +

    Connection

    + ネットワークの状態および携帯電話ネットワークの情報を取得します。 +
  • +
  • +

    Contacts

    + 連絡先データベース情報を操作します。 +
  • +
  • +

    Device

    + デバイス特有の情報を取得します。 +
  • +
  • +

    Events

    + JavaScript を通じてネイティブイベントを操作します。 +
  • +
  • +

    File

    + JavaScript を通じてネイティブファイルシステムを操作します。 +
  • +
  • +

    Geolocation

    + 位置情報を取得します。 +
  • +
  • +

    Globalization

    + ロケール固有のオブジェクトの表現を可能にします。 +
  • +
  • +

    Media

    + オーディオの録音と再生を行います。 +
  • +
  • +

    Notification

    + 視覚、聴覚、触覚を用いたデバイス通知機能を提供します。 +
  • +
  • +

    Splashscreen

    + アプリケーションのスプラッシュスクリーンを表示・非表示します。 +
  • +
  • +

    Storage

    + デバイスのネイティブストレージを操作します。 +
  • +
+

Guides

+
    +
  • +

    入門ガイド

    + SDK をセットアップして、最初の Cordova アプリケーションを作ります。 +
  • +
  • +

    コマンドライン使用ガイド

    + コマンドラインからアプリケーションの作成、ビルド、デプロイ、デバッグを行います。 +
  • +
  • +

    アップグレードガイド

    + アプリケーションを最新の Cordova にアップグレードします。 +
  • +
  • +

    プロジェクトの設定

    + アプリケーションの設定をカスタマイズします。 +
  • +
  • +

    プラグイン開発ガイド

    + 最初の Cordova プラグインを作ります。 +
  • +
  • +

    ドメインホワイトリストガイド

    + アプリケーションに外部ドメインへのアクセス権を与えます。 +
  • +
  • +

    WebView の埋め込み

    + Cordova WebView をプロジェクトで実装します。 +
  • +
  • +

    索引

    + Cordova ドキュメントの索引を見ます。 +
  • +
+
From 2b902af572f10cce4b330fbdfcf8a3e42c410c73 Mon Sep 17 00:00:00 2001 From: Watabe Date: Mon, 10 Mar 2014 13:26:34 +0900 Subject: [PATCH 2/5] git-mv some folders --- .../3.3.0/cordova/accelerometer/acceleration/acceleration.md | 0 .../3.3.0/cordova/accelerometer/accelerometer.clearWatch.md | 0 .../cordova/accelerometer/accelerometer.getCurrentAcceleration.md | 0 docs/{en => jp}/3.3.0/cordova/accelerometer/accelerometer.md | 0 .../cordova/accelerometer/accelerometer.watchAcceleration.md | 0 .../3.3.0/cordova/accelerometer/parameters/accelerometerError.md | 0 .../cordova/accelerometer/parameters/accelerometerOptions.md | 0 .../cordova/accelerometer/parameters/accelerometerSuccess.md | 0 docs/{en => jp}/3.3.0/cordova/camera/camera.cleanup.md | 0 docs/{en => jp}/3.3.0/cordova/camera/camera.getPicture.md | 0 docs/{en => jp}/3.3.0/cordova/camera/camera.md | 0 .../3.3.0/cordova/camera/parameter/CameraPopoverHandle.md | 0 .../3.3.0/cordova/camera/parameter/CameraPopoverOptions.md | 0 docs/{en => jp}/3.3.0/cordova/camera/parameter/cameraError.md | 0 docs/{en => jp}/3.3.0/cordova/camera/parameter/cameraOptions.md | 0 docs/{en => jp}/3.3.0/cordova/camera/parameter/cameraSuccess.md | 0 docs/{en => jp}/3.3.0/cordova/compass/compass.clearWatch.md | 0 docs/{en => jp}/3.3.0/cordova/compass/compass.clearWatchFilter.md | 0 .../{en => jp}/3.3.0/cordova/compass/compass.getCurrentHeading.md | 0 docs/{en => jp}/3.3.0/cordova/compass/compass.md | 0 docs/{en => jp}/3.3.0/cordova/compass/compass.watchHeading.md | 0 .../3.3.0/cordova/compass/compass.watchHeadingFilter.md | 0 .../{en => jp}/3.3.0/cordova/compass/compassError/compassError.md | 0 docs/{en => jp}/3.3.0/cordova/compass/parameters/compassError.md | 0 .../{en => jp}/3.3.0/cordova/compass/parameters/compassHeading.md | 0 .../{en => jp}/3.3.0/cordova/compass/parameters/compassOptions.md | 0 .../{en => jp}/3.3.0/cordova/compass/parameters/compassSuccess.md | 0 docs/{en => jp}/3.3.0/cordova/connection/connection.md | 0 docs/{en => jp}/3.3.0/cordova/connection/connection.type.md | 0 docs/{en => jp}/3.3.0/cordova/contacts/Contact/contact.md | 0 .../3.3.0/cordova/contacts/ContactAddress/contactaddress.md | 0 .../3.3.0/cordova/contacts/ContactError/contactError.md | 0 .../3.3.0/cordova/contacts/ContactField/contactfield.md | 0 .../cordova/contacts/ContactFindOptions/contactfindoptions.md | 0 docs/{en => jp}/3.3.0/cordova/contacts/ContactName/contactname.md | 0 .../cordova/contacts/ContactOrganization/contactorganization.md | 0 docs/{en => jp}/3.3.0/cordova/contacts/contacts.create.md | 0 docs/{en => jp}/3.3.0/cordova/contacts/contacts.find.md | 0 docs/{en => jp}/3.3.0/cordova/contacts/contacts.md | 0 docs/{en => jp}/3.3.0/cordova/contacts/parameters/contactError.md | 0 .../{en => jp}/3.3.0/cordova/contacts/parameters/contactFields.md | 0 .../3.3.0/cordova/contacts/parameters/contactFindOptions.md | 0 .../3.3.0/cordova/contacts/parameters/contactSuccess.md | 0 docs/{en => jp}/3.3.0/cordova/device/device.cordova.md | 0 docs/{en => jp}/3.3.0/cordova/device/device.md | 0 docs/{en => jp}/3.3.0/cordova/device/device.model.md | 0 docs/{en => jp}/3.3.0/cordova/device/device.name.md | 0 docs/{en => jp}/3.3.0/cordova/device/device.platform.md | 0 docs/{en => jp}/3.3.0/cordova/device/device.uuid.md | 0 docs/{en => jp}/3.3.0/cordova/device/device.version.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.backbutton.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.batterycritical.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.batterylow.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.batterystatus.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.deviceready.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.endcallbutton.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.menubutton.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.offline.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.online.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.pause.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.resume.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.searchbutton.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.startcallbutton.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.volumedownbutton.md | 0 docs/{en => jp}/3.3.0/cordova/events/events.volumeupbutton.md | 0 .../3.3.0/cordova/file/directoryentry/directoryentry.md | 0 .../3.3.0/cordova/file/directoryreader/directoryreader.md | 0 docs/{en => jp}/3.3.0/cordova/file/file.md | 0 docs/{en => jp}/3.3.0/cordova/file/fileentry/fileentry.md | 0 docs/{en => jp}/3.3.0/cordova/file/fileerror/fileerror.md | 0 docs/{en => jp}/3.3.0/cordova/file/fileobj/fileobj.md | 0 docs/{en => jp}/3.3.0/cordova/file/filereader/filereader.md | 0 docs/{en => jp}/3.3.0/cordova/file/filesystem/filesystem.md | 0 docs/{en => jp}/3.3.0/cordova/file/filetransfer/filetransfer.md | 0 .../3.3.0/cordova/file/filetransfererror/filetransfererror.md | 0 .../3.3.0/cordova/file/fileuploadoptions/fileuploadoptions.md | 0 .../3.3.0/cordova/file/fileuploadresult/fileuploadresult.md | 0 docs/{en => jp}/3.3.0/cordova/file/filewriter/filewriter.md | 0 docs/{en => jp}/3.3.0/cordova/file/flags/flags.md | 0 .../3.3.0/cordova/file/localfilesystem/localfilesystem.md | 0 docs/{en => jp}/3.3.0/cordova/file/metadata/metadata.md | 0 .../3.3.0/cordova/geolocation/Coordinates/coordinates.md | 0 docs/{en => jp}/3.3.0/cordova/geolocation/Position/position.md | 0 .../3.3.0/cordova/geolocation/PositionError/positionError.md | 0 .../3.3.0/cordova/geolocation/geolocation.clearWatch.md | 0 .../3.3.0/cordova/geolocation/geolocation.getCurrentPosition.md | 0 docs/{en => jp}/3.3.0/cordova/geolocation/geolocation.md | 0 .../3.3.0/cordova/geolocation/geolocation.watchPosition.md | 0 .../3.3.0/cordova/geolocation/parameters/geolocation.options.md | 0 .../3.3.0/cordova/geolocation/parameters/geolocationError.md | 0 .../3.3.0/cordova/geolocation/parameters/geolocationSuccess.md | 0 .../globalization/GlobalizationError/globalizationerror.md | 0 .../3.3.0/cordova/globalization/globalization.dateToString.md | 0 .../cordova/globalization/globalization.getCurrencyPattern.md | 0 .../3.3.0/cordova/globalization/globalization.getDateNames.md | 0 .../3.3.0/cordova/globalization/globalization.getDatePattern.md | 0 .../cordova/globalization/globalization.getFirstDayOfWeek.md | 0 .../3.3.0/cordova/globalization/globalization.getLocaleName.md | 0 .../3.3.0/cordova/globalization/globalization.getNumberPattern.md | 0 .../cordova/globalization/globalization.getPreferredLanguage.md | 0 .../cordova/globalization/globalization.isDayLightSavingsTime.md | 0 docs/{en => jp}/3.3.0/cordova/globalization/globalization.md | 0 .../3.3.0/cordova/globalization/globalization.numberToString.md | 0 .../3.3.0/cordova/globalization/globalization.stringToDate.md | 0 .../3.3.0/cordova/globalization/globalization.stringToNumber.md | 0 docs/{en => jp}/3.3.0/cordova/inappbrowser/inappbrowser.md | 0 docs/{en => jp}/3.3.0/cordova/inappbrowser/window.open.md | 0 docs/{en => jp}/3.3.0/cordova/media/MediaError/mediaError.md | 0 docs/{en => jp}/3.3.0/cordova/media/Parameters/mediaError.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/CaptureCB.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/CaptureError.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/CaptureErrorCB.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/ConfigurationData.md | 0 .../3.3.0/cordova/media/capture/MediaFile.getFormatData.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/MediaFile.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/MediaFileData.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/capture.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/captureAudio.md | 0 .../{en => jp}/3.3.0/cordova/media/capture/captureAudioOptions.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/captureImage.md | 0 .../{en => jp}/3.3.0/cordova/media/capture/captureImageOptions.md | 0 docs/{en => jp}/3.3.0/cordova/media/capture/captureVideo.md | 0 .../{en => jp}/3.3.0/cordova/media/capture/captureVideoOptions.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.getCurrentPosition.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.getDuration.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.pause.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.play.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.release.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.seekTo.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.setVolume.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.startRecord.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.stop.md | 0 docs/{en => jp}/3.3.0/cordova/media/media.stopRecord.md | 0 docs/{en => jp}/3.3.0/cordova/notification/notification.alert.md | 0 docs/{en => jp}/3.3.0/cordova/notification/notification.beep.md | 0 .../{en => jp}/3.3.0/cordova/notification/notification.confirm.md | 0 docs/{en => jp}/3.3.0/cordova/notification/notification.md | 0 docs/{en => jp}/3.3.0/cordova/notification/notification.prompt.md | 0 .../{en => jp}/3.3.0/cordova/notification/notification.vibrate.md | 0 docs/{en => jp}/3.3.0/cordova/splashscreen/splashscreen.hide.md | 0 docs/{en => jp}/3.3.0/cordova/splashscreen/splashscreen.md | 0 docs/{en => jp}/3.3.0/cordova/splashscreen/splashscreen.show.md | 0 docs/{en => jp}/3.3.0/cordova/storage/storage.md | 0 docs/{en => jp}/3.3.0/guide/appdev/privacy/index.md | 0 docs/{en => jp}/3.3.0/guide/appdev/whitelist/index.md | 0 docs/{en => jp}/3.3.0/guide/cli/index.md | 0 docs/{en => jp}/3.3.0/guide/hybrid/plugins/index.md | 0 docs/{en => jp}/3.3.0/guide/hybrid/webviews/index.md | 0 docs/{en => jp}/3.3.0/guide/overview/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/config.md | 0 docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/plugin.md | 0 docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/webview.md | 0 docs/{en => jp}/3.3.0/guide/platforms/android/config.md | 0 docs/{en => jp}/3.3.0/guide/platforms/android/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/android/plugin.md | 0 docs/{en => jp}/3.3.0/guide/platforms/android/tools.md | 0 docs/{en => jp}/3.3.0/guide/platforms/android/upgrading.md | 0 docs/{en => jp}/3.3.0/guide/platforms/android/webview.md | 0 docs/{en => jp}/3.3.0/guide/platforms/blackberry10/config.md | 0 docs/{en => jp}/3.3.0/guide/platforms/blackberry10/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/blackberry10/plugin.md | 0 docs/{en => jp}/3.3.0/guide/platforms/blackberry10/tools.md | 0 docs/{en => jp}/3.3.0/guide/platforms/blackberry10/upgrading.md | 0 docs/{en => jp}/3.3.0/guide/platforms/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/ios/config.md | 0 docs/{en => jp}/3.3.0/guide/platforms/ios/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/ios/plugin.md | 0 docs/{en => jp}/3.3.0/guide/platforms/ios/tools.md | 0 docs/{en => jp}/3.3.0/guide/platforms/ios/upgrading.md | 0 docs/{en => jp}/3.3.0/guide/platforms/ios/webview.md | 0 docs/{en => jp}/3.3.0/guide/platforms/tizen/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/ubuntu/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/win8/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/win8/tools.md | 0 docs/{en => jp}/3.3.0/guide/platforms/win8/upgrading.md | 0 docs/{en => jp}/3.3.0/guide/platforms/wp7/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/wp8/index.md | 0 docs/{en => jp}/3.3.0/guide/platforms/wp8/plugin.md | 0 docs/{en => jp}/3.3.0/guide/platforms/wp8/tools.md | 0 docs/{en => jp}/3.3.0/guide/platforms/wp8/upgrading.md | 0 docs/{en => jp}/3.3.0/guide/support/index.md | 0 184 files changed, 0 insertions(+), 0 deletions(-) rename docs/{en => jp}/3.3.0/cordova/accelerometer/acceleration/acceleration.md (100%) rename docs/{en => jp}/3.3.0/cordova/accelerometer/accelerometer.clearWatch.md (100%) rename docs/{en => jp}/3.3.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md (100%) rename docs/{en => jp}/3.3.0/cordova/accelerometer/accelerometer.md (100%) rename docs/{en => jp}/3.3.0/cordova/accelerometer/accelerometer.watchAcceleration.md (100%) rename docs/{en => jp}/3.3.0/cordova/accelerometer/parameters/accelerometerError.md (100%) rename docs/{en => jp}/3.3.0/cordova/accelerometer/parameters/accelerometerOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/accelerometer/parameters/accelerometerSuccess.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/camera.cleanup.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/camera.getPicture.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/camera.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/parameter/CameraPopoverHandle.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/parameter/CameraPopoverOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/parameter/cameraError.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/parameter/cameraOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/camera/parameter/cameraSuccess.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/compass.clearWatch.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/compass.clearWatchFilter.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/compass.getCurrentHeading.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/compass.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/compass.watchHeading.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/compass.watchHeadingFilter.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/compassError/compassError.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/parameters/compassError.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/parameters/compassHeading.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/parameters/compassOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/compass/parameters/compassSuccess.md (100%) rename docs/{en => jp}/3.3.0/cordova/connection/connection.md (100%) rename docs/{en => jp}/3.3.0/cordova/connection/connection.type.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/Contact/contact.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/ContactAddress/contactaddress.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/ContactError/contactError.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/ContactField/contactfield.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/ContactFindOptions/contactfindoptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/ContactName/contactname.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/ContactOrganization/contactorganization.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/contacts.create.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/contacts.find.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/contacts.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/parameters/contactError.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/parameters/contactFields.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/parameters/contactFindOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/contacts/parameters/contactSuccess.md (100%) rename docs/{en => jp}/3.3.0/cordova/device/device.cordova.md (100%) rename docs/{en => jp}/3.3.0/cordova/device/device.md (100%) rename docs/{en => jp}/3.3.0/cordova/device/device.model.md (100%) rename docs/{en => jp}/3.3.0/cordova/device/device.name.md (100%) rename docs/{en => jp}/3.3.0/cordova/device/device.platform.md (100%) rename docs/{en => jp}/3.3.0/cordova/device/device.uuid.md (100%) rename docs/{en => jp}/3.3.0/cordova/device/device.version.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.backbutton.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.batterycritical.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.batterylow.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.batterystatus.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.deviceready.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.endcallbutton.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.menubutton.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.offline.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.online.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.pause.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.resume.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.searchbutton.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.startcallbutton.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.volumedownbutton.md (100%) rename docs/{en => jp}/3.3.0/cordova/events/events.volumeupbutton.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/directoryentry/directoryentry.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/directoryreader/directoryreader.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/file.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/fileentry/fileentry.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/fileerror/fileerror.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/fileobj/fileobj.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/filereader/filereader.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/filesystem/filesystem.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/filetransfer/filetransfer.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/filetransfererror/filetransfererror.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/fileuploadoptions/fileuploadoptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/fileuploadresult/fileuploadresult.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/filewriter/filewriter.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/flags/flags.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/localfilesystem/localfilesystem.md (100%) rename docs/{en => jp}/3.3.0/cordova/file/metadata/metadata.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/Coordinates/coordinates.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/Position/position.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/PositionError/positionError.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/geolocation.clearWatch.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/geolocation.getCurrentPosition.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/geolocation.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/geolocation.watchPosition.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/parameters/geolocation.options.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/parameters/geolocationError.md (100%) rename docs/{en => jp}/3.3.0/cordova/geolocation/parameters/geolocationSuccess.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/GlobalizationError/globalizationerror.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.dateToString.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.getCurrencyPattern.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.getDateNames.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.getDatePattern.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.getFirstDayOfWeek.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.getLocaleName.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.getNumberPattern.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.getPreferredLanguage.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.isDayLightSavingsTime.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.numberToString.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.stringToDate.md (100%) rename docs/{en => jp}/3.3.0/cordova/globalization/globalization.stringToNumber.md (100%) rename docs/{en => jp}/3.3.0/cordova/inappbrowser/inappbrowser.md (100%) rename docs/{en => jp}/3.3.0/cordova/inappbrowser/window.open.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/MediaError/mediaError.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/Parameters/mediaError.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/CaptureCB.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/CaptureError.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/CaptureErrorCB.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/ConfigurationData.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/MediaFile.getFormatData.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/MediaFile.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/MediaFileData.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/capture.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/captureAudio.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/captureAudioOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/captureImage.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/captureImageOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/captureVideo.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/capture/captureVideoOptions.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.getCurrentPosition.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.getDuration.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.pause.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.play.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.release.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.seekTo.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.setVolume.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.startRecord.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.stop.md (100%) rename docs/{en => jp}/3.3.0/cordova/media/media.stopRecord.md (100%) rename docs/{en => jp}/3.3.0/cordova/notification/notification.alert.md (100%) rename docs/{en => jp}/3.3.0/cordova/notification/notification.beep.md (100%) rename docs/{en => jp}/3.3.0/cordova/notification/notification.confirm.md (100%) rename docs/{en => jp}/3.3.0/cordova/notification/notification.md (100%) rename docs/{en => jp}/3.3.0/cordova/notification/notification.prompt.md (100%) rename docs/{en => jp}/3.3.0/cordova/notification/notification.vibrate.md (100%) rename docs/{en => jp}/3.3.0/cordova/splashscreen/splashscreen.hide.md (100%) rename docs/{en => jp}/3.3.0/cordova/splashscreen/splashscreen.md (100%) rename docs/{en => jp}/3.3.0/cordova/splashscreen/splashscreen.show.md (100%) rename docs/{en => jp}/3.3.0/cordova/storage/storage.md (100%) rename docs/{en => jp}/3.3.0/guide/appdev/privacy/index.md (100%) rename docs/{en => jp}/3.3.0/guide/appdev/whitelist/index.md (100%) rename docs/{en => jp}/3.3.0/guide/cli/index.md (100%) rename docs/{en => jp}/3.3.0/guide/hybrid/plugins/index.md (100%) rename docs/{en => jp}/3.3.0/guide/hybrid/webviews/index.md (100%) rename docs/{en => jp}/3.3.0/guide/overview/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/config.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/plugin.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/amazonfireos/webview.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/android/config.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/android/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/android/plugin.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/android/tools.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/android/upgrading.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/android/webview.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/blackberry10/config.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/blackberry10/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/blackberry10/plugin.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/blackberry10/tools.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/blackberry10/upgrading.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/ios/config.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/ios/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/ios/plugin.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/ios/tools.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/ios/upgrading.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/ios/webview.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/tizen/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/ubuntu/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/win8/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/win8/tools.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/win8/upgrading.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/wp7/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/wp8/index.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/wp8/plugin.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/wp8/tools.md (100%) rename docs/{en => jp}/3.3.0/guide/platforms/wp8/upgrading.md (100%) rename docs/{en => jp}/3.3.0/guide/support/index.md (100%) diff --git a/docs/en/3.3.0/cordova/accelerometer/acceleration/acceleration.md b/docs/jp/3.3.0/cordova/accelerometer/acceleration/acceleration.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/acceleration/acceleration.md rename to docs/jp/3.3.0/cordova/accelerometer/acceleration/acceleration.md diff --git a/docs/en/3.3.0/cordova/accelerometer/accelerometer.clearWatch.md b/docs/jp/3.3.0/cordova/accelerometer/accelerometer.clearWatch.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/accelerometer.clearWatch.md rename to docs/jp/3.3.0/cordova/accelerometer/accelerometer.clearWatch.md diff --git a/docs/en/3.3.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md b/docs/jp/3.3.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md rename to docs/jp/3.3.0/cordova/accelerometer/accelerometer.getCurrentAcceleration.md diff --git a/docs/en/3.3.0/cordova/accelerometer/accelerometer.md b/docs/jp/3.3.0/cordova/accelerometer/accelerometer.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/accelerometer.md rename to docs/jp/3.3.0/cordova/accelerometer/accelerometer.md diff --git a/docs/en/3.3.0/cordova/accelerometer/accelerometer.watchAcceleration.md b/docs/jp/3.3.0/cordova/accelerometer/accelerometer.watchAcceleration.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/accelerometer.watchAcceleration.md rename to docs/jp/3.3.0/cordova/accelerometer/accelerometer.watchAcceleration.md diff --git a/docs/en/3.3.0/cordova/accelerometer/parameters/accelerometerError.md b/docs/jp/3.3.0/cordova/accelerometer/parameters/accelerometerError.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/parameters/accelerometerError.md rename to docs/jp/3.3.0/cordova/accelerometer/parameters/accelerometerError.md diff --git a/docs/en/3.3.0/cordova/accelerometer/parameters/accelerometerOptions.md b/docs/jp/3.3.0/cordova/accelerometer/parameters/accelerometerOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/parameters/accelerometerOptions.md rename to docs/jp/3.3.0/cordova/accelerometer/parameters/accelerometerOptions.md diff --git a/docs/en/3.3.0/cordova/accelerometer/parameters/accelerometerSuccess.md b/docs/jp/3.3.0/cordova/accelerometer/parameters/accelerometerSuccess.md similarity index 100% rename from docs/en/3.3.0/cordova/accelerometer/parameters/accelerometerSuccess.md rename to docs/jp/3.3.0/cordova/accelerometer/parameters/accelerometerSuccess.md diff --git a/docs/en/3.3.0/cordova/camera/camera.cleanup.md b/docs/jp/3.3.0/cordova/camera/camera.cleanup.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/camera.cleanup.md rename to docs/jp/3.3.0/cordova/camera/camera.cleanup.md diff --git a/docs/en/3.3.0/cordova/camera/camera.getPicture.md b/docs/jp/3.3.0/cordova/camera/camera.getPicture.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/camera.getPicture.md rename to docs/jp/3.3.0/cordova/camera/camera.getPicture.md diff --git a/docs/en/3.3.0/cordova/camera/camera.md b/docs/jp/3.3.0/cordova/camera/camera.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/camera.md rename to docs/jp/3.3.0/cordova/camera/camera.md diff --git a/docs/en/3.3.0/cordova/camera/parameter/CameraPopoverHandle.md b/docs/jp/3.3.0/cordova/camera/parameter/CameraPopoverHandle.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/parameter/CameraPopoverHandle.md rename to docs/jp/3.3.0/cordova/camera/parameter/CameraPopoverHandle.md diff --git a/docs/en/3.3.0/cordova/camera/parameter/CameraPopoverOptions.md b/docs/jp/3.3.0/cordova/camera/parameter/CameraPopoverOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/parameter/CameraPopoverOptions.md rename to docs/jp/3.3.0/cordova/camera/parameter/CameraPopoverOptions.md diff --git a/docs/en/3.3.0/cordova/camera/parameter/cameraError.md b/docs/jp/3.3.0/cordova/camera/parameter/cameraError.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/parameter/cameraError.md rename to docs/jp/3.3.0/cordova/camera/parameter/cameraError.md diff --git a/docs/en/3.3.0/cordova/camera/parameter/cameraOptions.md b/docs/jp/3.3.0/cordova/camera/parameter/cameraOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/parameter/cameraOptions.md rename to docs/jp/3.3.0/cordova/camera/parameter/cameraOptions.md diff --git a/docs/en/3.3.0/cordova/camera/parameter/cameraSuccess.md b/docs/jp/3.3.0/cordova/camera/parameter/cameraSuccess.md similarity index 100% rename from docs/en/3.3.0/cordova/camera/parameter/cameraSuccess.md rename to docs/jp/3.3.0/cordova/camera/parameter/cameraSuccess.md diff --git a/docs/en/3.3.0/cordova/compass/compass.clearWatch.md b/docs/jp/3.3.0/cordova/compass/compass.clearWatch.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/compass.clearWatch.md rename to docs/jp/3.3.0/cordova/compass/compass.clearWatch.md diff --git a/docs/en/3.3.0/cordova/compass/compass.clearWatchFilter.md b/docs/jp/3.3.0/cordova/compass/compass.clearWatchFilter.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/compass.clearWatchFilter.md rename to docs/jp/3.3.0/cordova/compass/compass.clearWatchFilter.md diff --git a/docs/en/3.3.0/cordova/compass/compass.getCurrentHeading.md b/docs/jp/3.3.0/cordova/compass/compass.getCurrentHeading.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/compass.getCurrentHeading.md rename to docs/jp/3.3.0/cordova/compass/compass.getCurrentHeading.md diff --git a/docs/en/3.3.0/cordova/compass/compass.md b/docs/jp/3.3.0/cordova/compass/compass.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/compass.md rename to docs/jp/3.3.0/cordova/compass/compass.md diff --git a/docs/en/3.3.0/cordova/compass/compass.watchHeading.md b/docs/jp/3.3.0/cordova/compass/compass.watchHeading.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/compass.watchHeading.md rename to docs/jp/3.3.0/cordova/compass/compass.watchHeading.md diff --git a/docs/en/3.3.0/cordova/compass/compass.watchHeadingFilter.md b/docs/jp/3.3.0/cordova/compass/compass.watchHeadingFilter.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/compass.watchHeadingFilter.md rename to docs/jp/3.3.0/cordova/compass/compass.watchHeadingFilter.md diff --git a/docs/en/3.3.0/cordova/compass/compassError/compassError.md b/docs/jp/3.3.0/cordova/compass/compassError/compassError.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/compassError/compassError.md rename to docs/jp/3.3.0/cordova/compass/compassError/compassError.md diff --git a/docs/en/3.3.0/cordova/compass/parameters/compassError.md b/docs/jp/3.3.0/cordova/compass/parameters/compassError.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/parameters/compassError.md rename to docs/jp/3.3.0/cordova/compass/parameters/compassError.md diff --git a/docs/en/3.3.0/cordova/compass/parameters/compassHeading.md b/docs/jp/3.3.0/cordova/compass/parameters/compassHeading.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/parameters/compassHeading.md rename to docs/jp/3.3.0/cordova/compass/parameters/compassHeading.md diff --git a/docs/en/3.3.0/cordova/compass/parameters/compassOptions.md b/docs/jp/3.3.0/cordova/compass/parameters/compassOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/parameters/compassOptions.md rename to docs/jp/3.3.0/cordova/compass/parameters/compassOptions.md diff --git a/docs/en/3.3.0/cordova/compass/parameters/compassSuccess.md b/docs/jp/3.3.0/cordova/compass/parameters/compassSuccess.md similarity index 100% rename from docs/en/3.3.0/cordova/compass/parameters/compassSuccess.md rename to docs/jp/3.3.0/cordova/compass/parameters/compassSuccess.md diff --git a/docs/en/3.3.0/cordova/connection/connection.md b/docs/jp/3.3.0/cordova/connection/connection.md similarity index 100% rename from docs/en/3.3.0/cordova/connection/connection.md rename to docs/jp/3.3.0/cordova/connection/connection.md diff --git a/docs/en/3.3.0/cordova/connection/connection.type.md b/docs/jp/3.3.0/cordova/connection/connection.type.md similarity index 100% rename from docs/en/3.3.0/cordova/connection/connection.type.md rename to docs/jp/3.3.0/cordova/connection/connection.type.md diff --git a/docs/en/3.3.0/cordova/contacts/Contact/contact.md b/docs/jp/3.3.0/cordova/contacts/Contact/contact.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/Contact/contact.md rename to docs/jp/3.3.0/cordova/contacts/Contact/contact.md diff --git a/docs/en/3.3.0/cordova/contacts/ContactAddress/contactaddress.md b/docs/jp/3.3.0/cordova/contacts/ContactAddress/contactaddress.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/ContactAddress/contactaddress.md rename to docs/jp/3.3.0/cordova/contacts/ContactAddress/contactaddress.md diff --git a/docs/en/3.3.0/cordova/contacts/ContactError/contactError.md b/docs/jp/3.3.0/cordova/contacts/ContactError/contactError.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/ContactError/contactError.md rename to docs/jp/3.3.0/cordova/contacts/ContactError/contactError.md diff --git a/docs/en/3.3.0/cordova/contacts/ContactField/contactfield.md b/docs/jp/3.3.0/cordova/contacts/ContactField/contactfield.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/ContactField/contactfield.md rename to docs/jp/3.3.0/cordova/contacts/ContactField/contactfield.md diff --git a/docs/en/3.3.0/cordova/contacts/ContactFindOptions/contactfindoptions.md b/docs/jp/3.3.0/cordova/contacts/ContactFindOptions/contactfindoptions.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/ContactFindOptions/contactfindoptions.md rename to docs/jp/3.3.0/cordova/contacts/ContactFindOptions/contactfindoptions.md diff --git a/docs/en/3.3.0/cordova/contacts/ContactName/contactname.md b/docs/jp/3.3.0/cordova/contacts/ContactName/contactname.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/ContactName/contactname.md rename to docs/jp/3.3.0/cordova/contacts/ContactName/contactname.md diff --git a/docs/en/3.3.0/cordova/contacts/ContactOrganization/contactorganization.md b/docs/jp/3.3.0/cordova/contacts/ContactOrganization/contactorganization.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/ContactOrganization/contactorganization.md rename to docs/jp/3.3.0/cordova/contacts/ContactOrganization/contactorganization.md diff --git a/docs/en/3.3.0/cordova/contacts/contacts.create.md b/docs/jp/3.3.0/cordova/contacts/contacts.create.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/contacts.create.md rename to docs/jp/3.3.0/cordova/contacts/contacts.create.md diff --git a/docs/en/3.3.0/cordova/contacts/contacts.find.md b/docs/jp/3.3.0/cordova/contacts/contacts.find.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/contacts.find.md rename to docs/jp/3.3.0/cordova/contacts/contacts.find.md diff --git a/docs/en/3.3.0/cordova/contacts/contacts.md b/docs/jp/3.3.0/cordova/contacts/contacts.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/contacts.md rename to docs/jp/3.3.0/cordova/contacts/contacts.md diff --git a/docs/en/3.3.0/cordova/contacts/parameters/contactError.md b/docs/jp/3.3.0/cordova/contacts/parameters/contactError.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/parameters/contactError.md rename to docs/jp/3.3.0/cordova/contacts/parameters/contactError.md diff --git a/docs/en/3.3.0/cordova/contacts/parameters/contactFields.md b/docs/jp/3.3.0/cordova/contacts/parameters/contactFields.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/parameters/contactFields.md rename to docs/jp/3.3.0/cordova/contacts/parameters/contactFields.md diff --git a/docs/en/3.3.0/cordova/contacts/parameters/contactFindOptions.md b/docs/jp/3.3.0/cordova/contacts/parameters/contactFindOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/parameters/contactFindOptions.md rename to docs/jp/3.3.0/cordova/contacts/parameters/contactFindOptions.md diff --git a/docs/en/3.3.0/cordova/contacts/parameters/contactSuccess.md b/docs/jp/3.3.0/cordova/contacts/parameters/contactSuccess.md similarity index 100% rename from docs/en/3.3.0/cordova/contacts/parameters/contactSuccess.md rename to docs/jp/3.3.0/cordova/contacts/parameters/contactSuccess.md diff --git a/docs/en/3.3.0/cordova/device/device.cordova.md b/docs/jp/3.3.0/cordova/device/device.cordova.md similarity index 100% rename from docs/en/3.3.0/cordova/device/device.cordova.md rename to docs/jp/3.3.0/cordova/device/device.cordova.md diff --git a/docs/en/3.3.0/cordova/device/device.md b/docs/jp/3.3.0/cordova/device/device.md similarity index 100% rename from docs/en/3.3.0/cordova/device/device.md rename to docs/jp/3.3.0/cordova/device/device.md diff --git a/docs/en/3.3.0/cordova/device/device.model.md b/docs/jp/3.3.0/cordova/device/device.model.md similarity index 100% rename from docs/en/3.3.0/cordova/device/device.model.md rename to docs/jp/3.3.0/cordova/device/device.model.md diff --git a/docs/en/3.3.0/cordova/device/device.name.md b/docs/jp/3.3.0/cordova/device/device.name.md similarity index 100% rename from docs/en/3.3.0/cordova/device/device.name.md rename to docs/jp/3.3.0/cordova/device/device.name.md diff --git a/docs/en/3.3.0/cordova/device/device.platform.md b/docs/jp/3.3.0/cordova/device/device.platform.md similarity index 100% rename from docs/en/3.3.0/cordova/device/device.platform.md rename to docs/jp/3.3.0/cordova/device/device.platform.md diff --git a/docs/en/3.3.0/cordova/device/device.uuid.md b/docs/jp/3.3.0/cordova/device/device.uuid.md similarity index 100% rename from docs/en/3.3.0/cordova/device/device.uuid.md rename to docs/jp/3.3.0/cordova/device/device.uuid.md diff --git a/docs/en/3.3.0/cordova/device/device.version.md b/docs/jp/3.3.0/cordova/device/device.version.md similarity index 100% rename from docs/en/3.3.0/cordova/device/device.version.md rename to docs/jp/3.3.0/cordova/device/device.version.md diff --git a/docs/en/3.3.0/cordova/events/events.backbutton.md b/docs/jp/3.3.0/cordova/events/events.backbutton.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.backbutton.md rename to docs/jp/3.3.0/cordova/events/events.backbutton.md diff --git a/docs/en/3.3.0/cordova/events/events.batterycritical.md b/docs/jp/3.3.0/cordova/events/events.batterycritical.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.batterycritical.md rename to docs/jp/3.3.0/cordova/events/events.batterycritical.md diff --git a/docs/en/3.3.0/cordova/events/events.batterylow.md b/docs/jp/3.3.0/cordova/events/events.batterylow.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.batterylow.md rename to docs/jp/3.3.0/cordova/events/events.batterylow.md diff --git a/docs/en/3.3.0/cordova/events/events.batterystatus.md b/docs/jp/3.3.0/cordova/events/events.batterystatus.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.batterystatus.md rename to docs/jp/3.3.0/cordova/events/events.batterystatus.md diff --git a/docs/en/3.3.0/cordova/events/events.deviceready.md b/docs/jp/3.3.0/cordova/events/events.deviceready.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.deviceready.md rename to docs/jp/3.3.0/cordova/events/events.deviceready.md diff --git a/docs/en/3.3.0/cordova/events/events.endcallbutton.md b/docs/jp/3.3.0/cordova/events/events.endcallbutton.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.endcallbutton.md rename to docs/jp/3.3.0/cordova/events/events.endcallbutton.md diff --git a/docs/en/3.3.0/cordova/events/events.md b/docs/jp/3.3.0/cordova/events/events.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.md rename to docs/jp/3.3.0/cordova/events/events.md diff --git a/docs/en/3.3.0/cordova/events/events.menubutton.md b/docs/jp/3.3.0/cordova/events/events.menubutton.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.menubutton.md rename to docs/jp/3.3.0/cordova/events/events.menubutton.md diff --git a/docs/en/3.3.0/cordova/events/events.offline.md b/docs/jp/3.3.0/cordova/events/events.offline.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.offline.md rename to docs/jp/3.3.0/cordova/events/events.offline.md diff --git a/docs/en/3.3.0/cordova/events/events.online.md b/docs/jp/3.3.0/cordova/events/events.online.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.online.md rename to docs/jp/3.3.0/cordova/events/events.online.md diff --git a/docs/en/3.3.0/cordova/events/events.pause.md b/docs/jp/3.3.0/cordova/events/events.pause.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.pause.md rename to docs/jp/3.3.0/cordova/events/events.pause.md diff --git a/docs/en/3.3.0/cordova/events/events.resume.md b/docs/jp/3.3.0/cordova/events/events.resume.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.resume.md rename to docs/jp/3.3.0/cordova/events/events.resume.md diff --git a/docs/en/3.3.0/cordova/events/events.searchbutton.md b/docs/jp/3.3.0/cordova/events/events.searchbutton.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.searchbutton.md rename to docs/jp/3.3.0/cordova/events/events.searchbutton.md diff --git a/docs/en/3.3.0/cordova/events/events.startcallbutton.md b/docs/jp/3.3.0/cordova/events/events.startcallbutton.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.startcallbutton.md rename to docs/jp/3.3.0/cordova/events/events.startcallbutton.md diff --git a/docs/en/3.3.0/cordova/events/events.volumedownbutton.md b/docs/jp/3.3.0/cordova/events/events.volumedownbutton.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.volumedownbutton.md rename to docs/jp/3.3.0/cordova/events/events.volumedownbutton.md diff --git a/docs/en/3.3.0/cordova/events/events.volumeupbutton.md b/docs/jp/3.3.0/cordova/events/events.volumeupbutton.md similarity index 100% rename from docs/en/3.3.0/cordova/events/events.volumeupbutton.md rename to docs/jp/3.3.0/cordova/events/events.volumeupbutton.md diff --git a/docs/en/3.3.0/cordova/file/directoryentry/directoryentry.md b/docs/jp/3.3.0/cordova/file/directoryentry/directoryentry.md similarity index 100% rename from docs/en/3.3.0/cordova/file/directoryentry/directoryentry.md rename to docs/jp/3.3.0/cordova/file/directoryentry/directoryentry.md diff --git a/docs/en/3.3.0/cordova/file/directoryreader/directoryreader.md b/docs/jp/3.3.0/cordova/file/directoryreader/directoryreader.md similarity index 100% rename from docs/en/3.3.0/cordova/file/directoryreader/directoryreader.md rename to docs/jp/3.3.0/cordova/file/directoryreader/directoryreader.md diff --git a/docs/en/3.3.0/cordova/file/file.md b/docs/jp/3.3.0/cordova/file/file.md similarity index 100% rename from docs/en/3.3.0/cordova/file/file.md rename to docs/jp/3.3.0/cordova/file/file.md diff --git a/docs/en/3.3.0/cordova/file/fileentry/fileentry.md b/docs/jp/3.3.0/cordova/file/fileentry/fileentry.md similarity index 100% rename from docs/en/3.3.0/cordova/file/fileentry/fileentry.md rename to docs/jp/3.3.0/cordova/file/fileentry/fileentry.md diff --git a/docs/en/3.3.0/cordova/file/fileerror/fileerror.md b/docs/jp/3.3.0/cordova/file/fileerror/fileerror.md similarity index 100% rename from docs/en/3.3.0/cordova/file/fileerror/fileerror.md rename to docs/jp/3.3.0/cordova/file/fileerror/fileerror.md diff --git a/docs/en/3.3.0/cordova/file/fileobj/fileobj.md b/docs/jp/3.3.0/cordova/file/fileobj/fileobj.md similarity index 100% rename from docs/en/3.3.0/cordova/file/fileobj/fileobj.md rename to docs/jp/3.3.0/cordova/file/fileobj/fileobj.md diff --git a/docs/en/3.3.0/cordova/file/filereader/filereader.md b/docs/jp/3.3.0/cordova/file/filereader/filereader.md similarity index 100% rename from docs/en/3.3.0/cordova/file/filereader/filereader.md rename to docs/jp/3.3.0/cordova/file/filereader/filereader.md diff --git a/docs/en/3.3.0/cordova/file/filesystem/filesystem.md b/docs/jp/3.3.0/cordova/file/filesystem/filesystem.md similarity index 100% rename from docs/en/3.3.0/cordova/file/filesystem/filesystem.md rename to docs/jp/3.3.0/cordova/file/filesystem/filesystem.md diff --git a/docs/en/3.3.0/cordova/file/filetransfer/filetransfer.md b/docs/jp/3.3.0/cordova/file/filetransfer/filetransfer.md similarity index 100% rename from docs/en/3.3.0/cordova/file/filetransfer/filetransfer.md rename to docs/jp/3.3.0/cordova/file/filetransfer/filetransfer.md diff --git a/docs/en/3.3.0/cordova/file/filetransfererror/filetransfererror.md b/docs/jp/3.3.0/cordova/file/filetransfererror/filetransfererror.md similarity index 100% rename from docs/en/3.3.0/cordova/file/filetransfererror/filetransfererror.md rename to docs/jp/3.3.0/cordova/file/filetransfererror/filetransfererror.md diff --git a/docs/en/3.3.0/cordova/file/fileuploadoptions/fileuploadoptions.md b/docs/jp/3.3.0/cordova/file/fileuploadoptions/fileuploadoptions.md similarity index 100% rename from docs/en/3.3.0/cordova/file/fileuploadoptions/fileuploadoptions.md rename to docs/jp/3.3.0/cordova/file/fileuploadoptions/fileuploadoptions.md diff --git a/docs/en/3.3.0/cordova/file/fileuploadresult/fileuploadresult.md b/docs/jp/3.3.0/cordova/file/fileuploadresult/fileuploadresult.md similarity index 100% rename from docs/en/3.3.0/cordova/file/fileuploadresult/fileuploadresult.md rename to docs/jp/3.3.0/cordova/file/fileuploadresult/fileuploadresult.md diff --git a/docs/en/3.3.0/cordova/file/filewriter/filewriter.md b/docs/jp/3.3.0/cordova/file/filewriter/filewriter.md similarity index 100% rename from docs/en/3.3.0/cordova/file/filewriter/filewriter.md rename to docs/jp/3.3.0/cordova/file/filewriter/filewriter.md diff --git a/docs/en/3.3.0/cordova/file/flags/flags.md b/docs/jp/3.3.0/cordova/file/flags/flags.md similarity index 100% rename from docs/en/3.3.0/cordova/file/flags/flags.md rename to docs/jp/3.3.0/cordova/file/flags/flags.md diff --git a/docs/en/3.3.0/cordova/file/localfilesystem/localfilesystem.md b/docs/jp/3.3.0/cordova/file/localfilesystem/localfilesystem.md similarity index 100% rename from docs/en/3.3.0/cordova/file/localfilesystem/localfilesystem.md rename to docs/jp/3.3.0/cordova/file/localfilesystem/localfilesystem.md diff --git a/docs/en/3.3.0/cordova/file/metadata/metadata.md b/docs/jp/3.3.0/cordova/file/metadata/metadata.md similarity index 100% rename from docs/en/3.3.0/cordova/file/metadata/metadata.md rename to docs/jp/3.3.0/cordova/file/metadata/metadata.md diff --git a/docs/en/3.3.0/cordova/geolocation/Coordinates/coordinates.md b/docs/jp/3.3.0/cordova/geolocation/Coordinates/coordinates.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/Coordinates/coordinates.md rename to docs/jp/3.3.0/cordova/geolocation/Coordinates/coordinates.md diff --git a/docs/en/3.3.0/cordova/geolocation/Position/position.md b/docs/jp/3.3.0/cordova/geolocation/Position/position.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/Position/position.md rename to docs/jp/3.3.0/cordova/geolocation/Position/position.md diff --git a/docs/en/3.3.0/cordova/geolocation/PositionError/positionError.md b/docs/jp/3.3.0/cordova/geolocation/PositionError/positionError.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/PositionError/positionError.md rename to docs/jp/3.3.0/cordova/geolocation/PositionError/positionError.md diff --git a/docs/en/3.3.0/cordova/geolocation/geolocation.clearWatch.md b/docs/jp/3.3.0/cordova/geolocation/geolocation.clearWatch.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/geolocation.clearWatch.md rename to docs/jp/3.3.0/cordova/geolocation/geolocation.clearWatch.md diff --git a/docs/en/3.3.0/cordova/geolocation/geolocation.getCurrentPosition.md b/docs/jp/3.3.0/cordova/geolocation/geolocation.getCurrentPosition.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/geolocation.getCurrentPosition.md rename to docs/jp/3.3.0/cordova/geolocation/geolocation.getCurrentPosition.md diff --git a/docs/en/3.3.0/cordova/geolocation/geolocation.md b/docs/jp/3.3.0/cordova/geolocation/geolocation.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/geolocation.md rename to docs/jp/3.3.0/cordova/geolocation/geolocation.md diff --git a/docs/en/3.3.0/cordova/geolocation/geolocation.watchPosition.md b/docs/jp/3.3.0/cordova/geolocation/geolocation.watchPosition.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/geolocation.watchPosition.md rename to docs/jp/3.3.0/cordova/geolocation/geolocation.watchPosition.md diff --git a/docs/en/3.3.0/cordova/geolocation/parameters/geolocation.options.md b/docs/jp/3.3.0/cordova/geolocation/parameters/geolocation.options.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/parameters/geolocation.options.md rename to docs/jp/3.3.0/cordova/geolocation/parameters/geolocation.options.md diff --git a/docs/en/3.3.0/cordova/geolocation/parameters/geolocationError.md b/docs/jp/3.3.0/cordova/geolocation/parameters/geolocationError.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/parameters/geolocationError.md rename to docs/jp/3.3.0/cordova/geolocation/parameters/geolocationError.md diff --git a/docs/en/3.3.0/cordova/geolocation/parameters/geolocationSuccess.md b/docs/jp/3.3.0/cordova/geolocation/parameters/geolocationSuccess.md similarity index 100% rename from docs/en/3.3.0/cordova/geolocation/parameters/geolocationSuccess.md rename to docs/jp/3.3.0/cordova/geolocation/parameters/geolocationSuccess.md diff --git a/docs/en/3.3.0/cordova/globalization/GlobalizationError/globalizationerror.md b/docs/jp/3.3.0/cordova/globalization/GlobalizationError/globalizationerror.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/GlobalizationError/globalizationerror.md rename to docs/jp/3.3.0/cordova/globalization/GlobalizationError/globalizationerror.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.dateToString.md b/docs/jp/3.3.0/cordova/globalization/globalization.dateToString.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.dateToString.md rename to docs/jp/3.3.0/cordova/globalization/globalization.dateToString.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.getCurrencyPattern.md b/docs/jp/3.3.0/cordova/globalization/globalization.getCurrencyPattern.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.getCurrencyPattern.md rename to docs/jp/3.3.0/cordova/globalization/globalization.getCurrencyPattern.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.getDateNames.md b/docs/jp/3.3.0/cordova/globalization/globalization.getDateNames.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.getDateNames.md rename to docs/jp/3.3.0/cordova/globalization/globalization.getDateNames.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.getDatePattern.md b/docs/jp/3.3.0/cordova/globalization/globalization.getDatePattern.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.getDatePattern.md rename to docs/jp/3.3.0/cordova/globalization/globalization.getDatePattern.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.getFirstDayOfWeek.md b/docs/jp/3.3.0/cordova/globalization/globalization.getFirstDayOfWeek.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.getFirstDayOfWeek.md rename to docs/jp/3.3.0/cordova/globalization/globalization.getFirstDayOfWeek.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.getLocaleName.md b/docs/jp/3.3.0/cordova/globalization/globalization.getLocaleName.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.getLocaleName.md rename to docs/jp/3.3.0/cordova/globalization/globalization.getLocaleName.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.getNumberPattern.md b/docs/jp/3.3.0/cordova/globalization/globalization.getNumberPattern.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.getNumberPattern.md rename to docs/jp/3.3.0/cordova/globalization/globalization.getNumberPattern.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.getPreferredLanguage.md b/docs/jp/3.3.0/cordova/globalization/globalization.getPreferredLanguage.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.getPreferredLanguage.md rename to docs/jp/3.3.0/cordova/globalization/globalization.getPreferredLanguage.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.isDayLightSavingsTime.md b/docs/jp/3.3.0/cordova/globalization/globalization.isDayLightSavingsTime.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.isDayLightSavingsTime.md rename to docs/jp/3.3.0/cordova/globalization/globalization.isDayLightSavingsTime.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.md b/docs/jp/3.3.0/cordova/globalization/globalization.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.md rename to docs/jp/3.3.0/cordova/globalization/globalization.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.numberToString.md b/docs/jp/3.3.0/cordova/globalization/globalization.numberToString.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.numberToString.md rename to docs/jp/3.3.0/cordova/globalization/globalization.numberToString.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.stringToDate.md b/docs/jp/3.3.0/cordova/globalization/globalization.stringToDate.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.stringToDate.md rename to docs/jp/3.3.0/cordova/globalization/globalization.stringToDate.md diff --git a/docs/en/3.3.0/cordova/globalization/globalization.stringToNumber.md b/docs/jp/3.3.0/cordova/globalization/globalization.stringToNumber.md similarity index 100% rename from docs/en/3.3.0/cordova/globalization/globalization.stringToNumber.md rename to docs/jp/3.3.0/cordova/globalization/globalization.stringToNumber.md diff --git a/docs/en/3.3.0/cordova/inappbrowser/inappbrowser.md b/docs/jp/3.3.0/cordova/inappbrowser/inappbrowser.md similarity index 100% rename from docs/en/3.3.0/cordova/inappbrowser/inappbrowser.md rename to docs/jp/3.3.0/cordova/inappbrowser/inappbrowser.md diff --git a/docs/en/3.3.0/cordova/inappbrowser/window.open.md b/docs/jp/3.3.0/cordova/inappbrowser/window.open.md similarity index 100% rename from docs/en/3.3.0/cordova/inappbrowser/window.open.md rename to docs/jp/3.3.0/cordova/inappbrowser/window.open.md diff --git a/docs/en/3.3.0/cordova/media/MediaError/mediaError.md b/docs/jp/3.3.0/cordova/media/MediaError/mediaError.md similarity index 100% rename from docs/en/3.3.0/cordova/media/MediaError/mediaError.md rename to docs/jp/3.3.0/cordova/media/MediaError/mediaError.md diff --git a/docs/en/3.3.0/cordova/media/Parameters/mediaError.md b/docs/jp/3.3.0/cordova/media/Parameters/mediaError.md similarity index 100% rename from docs/en/3.3.0/cordova/media/Parameters/mediaError.md rename to docs/jp/3.3.0/cordova/media/Parameters/mediaError.md diff --git a/docs/en/3.3.0/cordova/media/capture/CaptureCB.md b/docs/jp/3.3.0/cordova/media/capture/CaptureCB.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/CaptureCB.md rename to docs/jp/3.3.0/cordova/media/capture/CaptureCB.md diff --git a/docs/en/3.3.0/cordova/media/capture/CaptureError.md b/docs/jp/3.3.0/cordova/media/capture/CaptureError.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/CaptureError.md rename to docs/jp/3.3.0/cordova/media/capture/CaptureError.md diff --git a/docs/en/3.3.0/cordova/media/capture/CaptureErrorCB.md b/docs/jp/3.3.0/cordova/media/capture/CaptureErrorCB.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/CaptureErrorCB.md rename to docs/jp/3.3.0/cordova/media/capture/CaptureErrorCB.md diff --git a/docs/en/3.3.0/cordova/media/capture/ConfigurationData.md b/docs/jp/3.3.0/cordova/media/capture/ConfigurationData.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/ConfigurationData.md rename to docs/jp/3.3.0/cordova/media/capture/ConfigurationData.md diff --git a/docs/en/3.3.0/cordova/media/capture/MediaFile.getFormatData.md b/docs/jp/3.3.0/cordova/media/capture/MediaFile.getFormatData.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/MediaFile.getFormatData.md rename to docs/jp/3.3.0/cordova/media/capture/MediaFile.getFormatData.md diff --git a/docs/en/3.3.0/cordova/media/capture/MediaFile.md b/docs/jp/3.3.0/cordova/media/capture/MediaFile.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/MediaFile.md rename to docs/jp/3.3.0/cordova/media/capture/MediaFile.md diff --git a/docs/en/3.3.0/cordova/media/capture/MediaFileData.md b/docs/jp/3.3.0/cordova/media/capture/MediaFileData.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/MediaFileData.md rename to docs/jp/3.3.0/cordova/media/capture/MediaFileData.md diff --git a/docs/en/3.3.0/cordova/media/capture/capture.md b/docs/jp/3.3.0/cordova/media/capture/capture.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/capture.md rename to docs/jp/3.3.0/cordova/media/capture/capture.md diff --git a/docs/en/3.3.0/cordova/media/capture/captureAudio.md b/docs/jp/3.3.0/cordova/media/capture/captureAudio.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/captureAudio.md rename to docs/jp/3.3.0/cordova/media/capture/captureAudio.md diff --git a/docs/en/3.3.0/cordova/media/capture/captureAudioOptions.md b/docs/jp/3.3.0/cordova/media/capture/captureAudioOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/captureAudioOptions.md rename to docs/jp/3.3.0/cordova/media/capture/captureAudioOptions.md diff --git a/docs/en/3.3.0/cordova/media/capture/captureImage.md b/docs/jp/3.3.0/cordova/media/capture/captureImage.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/captureImage.md rename to docs/jp/3.3.0/cordova/media/capture/captureImage.md diff --git a/docs/en/3.3.0/cordova/media/capture/captureImageOptions.md b/docs/jp/3.3.0/cordova/media/capture/captureImageOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/captureImageOptions.md rename to docs/jp/3.3.0/cordova/media/capture/captureImageOptions.md diff --git a/docs/en/3.3.0/cordova/media/capture/captureVideo.md b/docs/jp/3.3.0/cordova/media/capture/captureVideo.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/captureVideo.md rename to docs/jp/3.3.0/cordova/media/capture/captureVideo.md diff --git a/docs/en/3.3.0/cordova/media/capture/captureVideoOptions.md b/docs/jp/3.3.0/cordova/media/capture/captureVideoOptions.md similarity index 100% rename from docs/en/3.3.0/cordova/media/capture/captureVideoOptions.md rename to docs/jp/3.3.0/cordova/media/capture/captureVideoOptions.md diff --git a/docs/en/3.3.0/cordova/media/media.getCurrentPosition.md b/docs/jp/3.3.0/cordova/media/media.getCurrentPosition.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.getCurrentPosition.md rename to docs/jp/3.3.0/cordova/media/media.getCurrentPosition.md diff --git a/docs/en/3.3.0/cordova/media/media.getDuration.md b/docs/jp/3.3.0/cordova/media/media.getDuration.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.getDuration.md rename to docs/jp/3.3.0/cordova/media/media.getDuration.md diff --git a/docs/en/3.3.0/cordova/media/media.md b/docs/jp/3.3.0/cordova/media/media.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.md rename to docs/jp/3.3.0/cordova/media/media.md diff --git a/docs/en/3.3.0/cordova/media/media.pause.md b/docs/jp/3.3.0/cordova/media/media.pause.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.pause.md rename to docs/jp/3.3.0/cordova/media/media.pause.md diff --git a/docs/en/3.3.0/cordova/media/media.play.md b/docs/jp/3.3.0/cordova/media/media.play.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.play.md rename to docs/jp/3.3.0/cordova/media/media.play.md diff --git a/docs/en/3.3.0/cordova/media/media.release.md b/docs/jp/3.3.0/cordova/media/media.release.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.release.md rename to docs/jp/3.3.0/cordova/media/media.release.md diff --git a/docs/en/3.3.0/cordova/media/media.seekTo.md b/docs/jp/3.3.0/cordova/media/media.seekTo.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.seekTo.md rename to docs/jp/3.3.0/cordova/media/media.seekTo.md diff --git a/docs/en/3.3.0/cordova/media/media.setVolume.md b/docs/jp/3.3.0/cordova/media/media.setVolume.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.setVolume.md rename to docs/jp/3.3.0/cordova/media/media.setVolume.md diff --git a/docs/en/3.3.0/cordova/media/media.startRecord.md b/docs/jp/3.3.0/cordova/media/media.startRecord.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.startRecord.md rename to docs/jp/3.3.0/cordova/media/media.startRecord.md diff --git a/docs/en/3.3.0/cordova/media/media.stop.md b/docs/jp/3.3.0/cordova/media/media.stop.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.stop.md rename to docs/jp/3.3.0/cordova/media/media.stop.md diff --git a/docs/en/3.3.0/cordova/media/media.stopRecord.md b/docs/jp/3.3.0/cordova/media/media.stopRecord.md similarity index 100% rename from docs/en/3.3.0/cordova/media/media.stopRecord.md rename to docs/jp/3.3.0/cordova/media/media.stopRecord.md diff --git a/docs/en/3.3.0/cordova/notification/notification.alert.md b/docs/jp/3.3.0/cordova/notification/notification.alert.md similarity index 100% rename from docs/en/3.3.0/cordova/notification/notification.alert.md rename to docs/jp/3.3.0/cordova/notification/notification.alert.md diff --git a/docs/en/3.3.0/cordova/notification/notification.beep.md b/docs/jp/3.3.0/cordova/notification/notification.beep.md similarity index 100% rename from docs/en/3.3.0/cordova/notification/notification.beep.md rename to docs/jp/3.3.0/cordova/notification/notification.beep.md diff --git a/docs/en/3.3.0/cordova/notification/notification.confirm.md b/docs/jp/3.3.0/cordova/notification/notification.confirm.md similarity index 100% rename from docs/en/3.3.0/cordova/notification/notification.confirm.md rename to docs/jp/3.3.0/cordova/notification/notification.confirm.md diff --git a/docs/en/3.3.0/cordova/notification/notification.md b/docs/jp/3.3.0/cordova/notification/notification.md similarity index 100% rename from docs/en/3.3.0/cordova/notification/notification.md rename to docs/jp/3.3.0/cordova/notification/notification.md diff --git a/docs/en/3.3.0/cordova/notification/notification.prompt.md b/docs/jp/3.3.0/cordova/notification/notification.prompt.md similarity index 100% rename from docs/en/3.3.0/cordova/notification/notification.prompt.md rename to docs/jp/3.3.0/cordova/notification/notification.prompt.md diff --git a/docs/en/3.3.0/cordova/notification/notification.vibrate.md b/docs/jp/3.3.0/cordova/notification/notification.vibrate.md similarity index 100% rename from docs/en/3.3.0/cordova/notification/notification.vibrate.md rename to docs/jp/3.3.0/cordova/notification/notification.vibrate.md diff --git a/docs/en/3.3.0/cordova/splashscreen/splashscreen.hide.md b/docs/jp/3.3.0/cordova/splashscreen/splashscreen.hide.md similarity index 100% rename from docs/en/3.3.0/cordova/splashscreen/splashscreen.hide.md rename to docs/jp/3.3.0/cordova/splashscreen/splashscreen.hide.md diff --git a/docs/en/3.3.0/cordova/splashscreen/splashscreen.md b/docs/jp/3.3.0/cordova/splashscreen/splashscreen.md similarity index 100% rename from docs/en/3.3.0/cordova/splashscreen/splashscreen.md rename to docs/jp/3.3.0/cordova/splashscreen/splashscreen.md diff --git a/docs/en/3.3.0/cordova/splashscreen/splashscreen.show.md b/docs/jp/3.3.0/cordova/splashscreen/splashscreen.show.md similarity index 100% rename from docs/en/3.3.0/cordova/splashscreen/splashscreen.show.md rename to docs/jp/3.3.0/cordova/splashscreen/splashscreen.show.md diff --git a/docs/en/3.3.0/cordova/storage/storage.md b/docs/jp/3.3.0/cordova/storage/storage.md similarity index 100% rename from docs/en/3.3.0/cordova/storage/storage.md rename to docs/jp/3.3.0/cordova/storage/storage.md diff --git a/docs/en/3.3.0/guide/appdev/privacy/index.md b/docs/jp/3.3.0/guide/appdev/privacy/index.md similarity index 100% rename from docs/en/3.3.0/guide/appdev/privacy/index.md rename to docs/jp/3.3.0/guide/appdev/privacy/index.md diff --git a/docs/en/3.3.0/guide/appdev/whitelist/index.md b/docs/jp/3.3.0/guide/appdev/whitelist/index.md similarity index 100% rename from docs/en/3.3.0/guide/appdev/whitelist/index.md rename to docs/jp/3.3.0/guide/appdev/whitelist/index.md diff --git a/docs/en/3.3.0/guide/cli/index.md b/docs/jp/3.3.0/guide/cli/index.md similarity index 100% rename from docs/en/3.3.0/guide/cli/index.md rename to docs/jp/3.3.0/guide/cli/index.md diff --git a/docs/en/3.3.0/guide/hybrid/plugins/index.md b/docs/jp/3.3.0/guide/hybrid/plugins/index.md similarity index 100% rename from docs/en/3.3.0/guide/hybrid/plugins/index.md rename to docs/jp/3.3.0/guide/hybrid/plugins/index.md diff --git a/docs/en/3.3.0/guide/hybrid/webviews/index.md b/docs/jp/3.3.0/guide/hybrid/webviews/index.md similarity index 100% rename from docs/en/3.3.0/guide/hybrid/webviews/index.md rename to docs/jp/3.3.0/guide/hybrid/webviews/index.md diff --git a/docs/en/3.3.0/guide/overview/index.md b/docs/jp/3.3.0/guide/overview/index.md similarity index 100% rename from docs/en/3.3.0/guide/overview/index.md rename to docs/jp/3.3.0/guide/overview/index.md diff --git a/docs/en/3.3.0/guide/platforms/amazonfireos/config.md b/docs/jp/3.3.0/guide/platforms/amazonfireos/config.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/amazonfireos/config.md rename to docs/jp/3.3.0/guide/platforms/amazonfireos/config.md diff --git a/docs/en/3.3.0/guide/platforms/amazonfireos/index.md b/docs/jp/3.3.0/guide/platforms/amazonfireos/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/amazonfireos/index.md rename to docs/jp/3.3.0/guide/platforms/amazonfireos/index.md diff --git a/docs/en/3.3.0/guide/platforms/amazonfireos/plugin.md b/docs/jp/3.3.0/guide/platforms/amazonfireos/plugin.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/amazonfireos/plugin.md rename to docs/jp/3.3.0/guide/platforms/amazonfireos/plugin.md diff --git a/docs/en/3.3.0/guide/platforms/amazonfireos/webview.md b/docs/jp/3.3.0/guide/platforms/amazonfireos/webview.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/amazonfireos/webview.md rename to docs/jp/3.3.0/guide/platforms/amazonfireos/webview.md diff --git a/docs/en/3.3.0/guide/platforms/android/config.md b/docs/jp/3.3.0/guide/platforms/android/config.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/android/config.md rename to docs/jp/3.3.0/guide/platforms/android/config.md diff --git a/docs/en/3.3.0/guide/platforms/android/index.md b/docs/jp/3.3.0/guide/platforms/android/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/android/index.md rename to docs/jp/3.3.0/guide/platforms/android/index.md diff --git a/docs/en/3.3.0/guide/platforms/android/plugin.md b/docs/jp/3.3.0/guide/platforms/android/plugin.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/android/plugin.md rename to docs/jp/3.3.0/guide/platforms/android/plugin.md diff --git a/docs/en/3.3.0/guide/platforms/android/tools.md b/docs/jp/3.3.0/guide/platforms/android/tools.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/android/tools.md rename to docs/jp/3.3.0/guide/platforms/android/tools.md diff --git a/docs/en/3.3.0/guide/platforms/android/upgrading.md b/docs/jp/3.3.0/guide/platforms/android/upgrading.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/android/upgrading.md rename to docs/jp/3.3.0/guide/platforms/android/upgrading.md diff --git a/docs/en/3.3.0/guide/platforms/android/webview.md b/docs/jp/3.3.0/guide/platforms/android/webview.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/android/webview.md rename to docs/jp/3.3.0/guide/platforms/android/webview.md diff --git a/docs/en/3.3.0/guide/platforms/blackberry10/config.md b/docs/jp/3.3.0/guide/platforms/blackberry10/config.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/blackberry10/config.md rename to docs/jp/3.3.0/guide/platforms/blackberry10/config.md diff --git a/docs/en/3.3.0/guide/platforms/blackberry10/index.md b/docs/jp/3.3.0/guide/platforms/blackberry10/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/blackberry10/index.md rename to docs/jp/3.3.0/guide/platforms/blackberry10/index.md diff --git a/docs/en/3.3.0/guide/platforms/blackberry10/plugin.md b/docs/jp/3.3.0/guide/platforms/blackberry10/plugin.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/blackberry10/plugin.md rename to docs/jp/3.3.0/guide/platforms/blackberry10/plugin.md diff --git a/docs/en/3.3.0/guide/platforms/blackberry10/tools.md b/docs/jp/3.3.0/guide/platforms/blackberry10/tools.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/blackberry10/tools.md rename to docs/jp/3.3.0/guide/platforms/blackberry10/tools.md diff --git a/docs/en/3.3.0/guide/platforms/blackberry10/upgrading.md b/docs/jp/3.3.0/guide/platforms/blackberry10/upgrading.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/blackberry10/upgrading.md rename to docs/jp/3.3.0/guide/platforms/blackberry10/upgrading.md diff --git a/docs/en/3.3.0/guide/platforms/index.md b/docs/jp/3.3.0/guide/platforms/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/index.md rename to docs/jp/3.3.0/guide/platforms/index.md diff --git a/docs/en/3.3.0/guide/platforms/ios/config.md b/docs/jp/3.3.0/guide/platforms/ios/config.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/ios/config.md rename to docs/jp/3.3.0/guide/platforms/ios/config.md diff --git a/docs/en/3.3.0/guide/platforms/ios/index.md b/docs/jp/3.3.0/guide/platforms/ios/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/ios/index.md rename to docs/jp/3.3.0/guide/platforms/ios/index.md diff --git a/docs/en/3.3.0/guide/platforms/ios/plugin.md b/docs/jp/3.3.0/guide/platforms/ios/plugin.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/ios/plugin.md rename to docs/jp/3.3.0/guide/platforms/ios/plugin.md diff --git a/docs/en/3.3.0/guide/platforms/ios/tools.md b/docs/jp/3.3.0/guide/platforms/ios/tools.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/ios/tools.md rename to docs/jp/3.3.0/guide/platforms/ios/tools.md diff --git a/docs/en/3.3.0/guide/platforms/ios/upgrading.md b/docs/jp/3.3.0/guide/platforms/ios/upgrading.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/ios/upgrading.md rename to docs/jp/3.3.0/guide/platforms/ios/upgrading.md diff --git a/docs/en/3.3.0/guide/platforms/ios/webview.md b/docs/jp/3.3.0/guide/platforms/ios/webview.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/ios/webview.md rename to docs/jp/3.3.0/guide/platforms/ios/webview.md diff --git a/docs/en/3.3.0/guide/platforms/tizen/index.md b/docs/jp/3.3.0/guide/platforms/tizen/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/tizen/index.md rename to docs/jp/3.3.0/guide/platforms/tizen/index.md diff --git a/docs/en/3.3.0/guide/platforms/ubuntu/index.md b/docs/jp/3.3.0/guide/platforms/ubuntu/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/ubuntu/index.md rename to docs/jp/3.3.0/guide/platforms/ubuntu/index.md diff --git a/docs/en/3.3.0/guide/platforms/win8/index.md b/docs/jp/3.3.0/guide/platforms/win8/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/win8/index.md rename to docs/jp/3.3.0/guide/platforms/win8/index.md diff --git a/docs/en/3.3.0/guide/platforms/win8/tools.md b/docs/jp/3.3.0/guide/platforms/win8/tools.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/win8/tools.md rename to docs/jp/3.3.0/guide/platforms/win8/tools.md diff --git a/docs/en/3.3.0/guide/platforms/win8/upgrading.md b/docs/jp/3.3.0/guide/platforms/win8/upgrading.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/win8/upgrading.md rename to docs/jp/3.3.0/guide/platforms/win8/upgrading.md diff --git a/docs/en/3.3.0/guide/platforms/wp7/index.md b/docs/jp/3.3.0/guide/platforms/wp7/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/wp7/index.md rename to docs/jp/3.3.0/guide/platforms/wp7/index.md diff --git a/docs/en/3.3.0/guide/platforms/wp8/index.md b/docs/jp/3.3.0/guide/platforms/wp8/index.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/wp8/index.md rename to docs/jp/3.3.0/guide/platforms/wp8/index.md diff --git a/docs/en/3.3.0/guide/platforms/wp8/plugin.md b/docs/jp/3.3.0/guide/platforms/wp8/plugin.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/wp8/plugin.md rename to docs/jp/3.3.0/guide/platforms/wp8/plugin.md diff --git a/docs/en/3.3.0/guide/platforms/wp8/tools.md b/docs/jp/3.3.0/guide/platforms/wp8/tools.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/wp8/tools.md rename to docs/jp/3.3.0/guide/platforms/wp8/tools.md diff --git a/docs/en/3.3.0/guide/platforms/wp8/upgrading.md b/docs/jp/3.3.0/guide/platforms/wp8/upgrading.md similarity index 100% rename from docs/en/3.3.0/guide/platforms/wp8/upgrading.md rename to docs/jp/3.3.0/guide/platforms/wp8/upgrading.md diff --git a/docs/en/3.3.0/guide/support/index.md b/docs/jp/3.3.0/guide/support/index.md similarity index 100% rename from docs/en/3.3.0/guide/support/index.md rename to docs/jp/3.3.0/guide/support/index.md From 5f41597bd990aadb0b70f2a47ee2e5b9acaaf19a Mon Sep 17 00:00:00 2001 From: Channa Date: Mon, 10 Mar 2014 19:24:58 +0900 Subject: [PATCH 3/5] Added 3.4.0 docs to be translated in Japanese --- docs/jp/3.4.0/cordova/accelerometor/index.md | 156 ++++ docs/jp/3.4.0/cordova/battery-status/index.md | 136 +++ docs/jp/3.4.0/cordova/camera/index.md | 441 ++++++++++ docs/jp/3.4.0/cordova/compass/index.md | 195 +++++ docs/jp/3.4.0/cordova/connection/index.md | 190 +++++ docs/jp/3.4.0/cordova/contacts/index.md | 683 +++++++++++++++ docs/jp/3.4.0/cordova/device/index.md | 213 +++++ docs/jp/3.4.0/cordova/dialogs/index.md | 261 ++++++ .../3.4.0/cordova/events/events.backbutton.md | 81 ++ .../cordova/events/events.deviceready.md | 90 ++ .../cordova/events/events.endcallbutton.md | 78 ++ docs/jp/3.4.0/cordova/events/events.md | 47 ++ .../3.4.0/cordova/events/events.menubutton.md | 80 ++ docs/jp/3.4.0/cordova/events/events.pause.md | 101 +++ docs/jp/3.4.0/cordova/events/events.resume.md | 114 +++ .../cordova/events/events.searchbutton.md | 79 ++ .../cordova/events/events.startcallbutton.md | 79 ++ .../cordova/events/events.volumedownbutton.md | 79 ++ .../cordova/events/events.volumeupbutton.md | 79 ++ docs/jp/3.4.0/cordova/file-transfer/index.md | 277 ++++++ docs/jp/3.4.0/cordova/file/index.md | 165 ++++ docs/jp/3.4.0/cordova/file/plugins.md | 101 +++ docs/jp/3.4.0/cordova/geolocation/index.md | 279 +++++++ docs/jp/3.4.0/cordova/globalization/index.md | 698 ++++++++++++++++ docs/jp/3.4.0/cordova/inappbrowser/index.md | 280 +++++++ docs/jp/3.4.0/cordova/media-capture/index.md | 597 +++++++++++++ docs/jp/3.4.0/cordova/media/index.md | 492 +++++++++++ docs/jp/3.4.0/cordova/plugins/pluginapis.md | 80 ++ docs/jp/3.4.0/cordova/splashscreen/index.md | 94 +++ docs/jp/3.4.0/cordova/storage/storage.md | 70 ++ docs/jp/3.4.0/cordova/vibration/index.md | 57 ++ docs/jp/3.4.0/guide/appdev/privacy/index.md | 117 +++ docs/jp/3.4.0/guide/appdev/whitelist/index.md | 168 ++++ docs/jp/3.4.0/guide/cli/index.md | 497 +++++++++++ docs/jp/3.4.0/guide/hybrid/plugins/index.md | 211 +++++ docs/jp/3.4.0/guide/hybrid/webviews/index.md | 36 + docs/jp/3.4.0/guide/overview/index.md | 139 +++ .../guide/platforms/amazonfireos/config.md | 66 ++ .../guide/platforms/amazonfireos/index.md | 145 ++++ .../guide/platforms/amazonfireos/plugin.md | 100 +++ .../guide/platforms/amazonfireos/webview.md | 113 +++ .../3.4.0/guide/platforms/android/config.md | 93 +++ .../jp/3.4.0/guide/platforms/android/index.md | 244 ++++++ .../3.4.0/guide/platforms/android/plugin.md | 240 ++++++ .../jp/3.4.0/guide/platforms/android/tools.md | 85 ++ .../guide/platforms/android/upgrading.md | 454 ++++++++++ .../3.4.0/guide/platforms/android/webview.md | 131 +++ .../guide/platforms/blackberry10/config.md | 51 ++ .../guide/platforms/blackberry10/index.md | 199 +++++ .../guide/platforms/blackberry10/plugin.md | 255 ++++++ .../guide/platforms/blackberry10/tools.md | 178 ++++ .../guide/platforms/blackberry10/upgrading.md | 490 +++++++++++ .../3.4.0/guide/platforms/firefoxos/index.md | 87 ++ docs/jp/3.4.0/guide/platforms/index.md | 98 +++ docs/jp/3.4.0/guide/platforms/ios/config.md | 113 +++ docs/jp/3.4.0/guide/platforms/ios/index.md | 231 +++++ docs/jp/3.4.0/guide/platforms/ios/plugin.md | 246 ++++++ docs/jp/3.4.0/guide/platforms/ios/tools.md | 63 ++ .../jp/3.4.0/guide/platforms/ios/upgrading.md | 788 ++++++++++++++++++ docs/jp/3.4.0/guide/platforms/ios/webview.md | 185 ++++ docs/jp/3.4.0/guide/platforms/tizen/index.md | 116 +++ docs/jp/3.4.0/guide/platforms/ubuntu/index.md | 97 +++ docs/jp/3.4.0/guide/platforms/win8/index.md | 124 +++ docs/jp/3.4.0/guide/platforms/win8/tools.md | 50 ++ .../3.4.0/guide/platforms/win8/upgrading.md | 61 ++ docs/jp/3.4.0/guide/platforms/wp7/index.md | 131 +++ docs/jp/3.4.0/guide/platforms/wp8/index.md | 162 ++++ docs/jp/3.4.0/guide/platforms/wp8/plugin.md | 224 +++++ docs/jp/3.4.0/guide/platforms/wp8/tools.md | 113 +++ .../jp/3.4.0/guide/platforms/wp8/upgrading.md | 435 ++++++++++ docs/jp/3.4.0/guide/support/index.md | 324 +++++++ docs/jp/3.4.0/index.md | 90 ++ 72 files changed, 14122 insertions(+) create mode 100644 docs/jp/3.4.0/cordova/accelerometor/index.md create mode 100644 docs/jp/3.4.0/cordova/battery-status/index.md create mode 100644 docs/jp/3.4.0/cordova/camera/index.md create mode 100644 docs/jp/3.4.0/cordova/compass/index.md create mode 100644 docs/jp/3.4.0/cordova/connection/index.md create mode 100644 docs/jp/3.4.0/cordova/contacts/index.md create mode 100644 docs/jp/3.4.0/cordova/device/index.md create mode 100644 docs/jp/3.4.0/cordova/dialogs/index.md create mode 100644 docs/jp/3.4.0/cordova/events/events.backbutton.md create mode 100644 docs/jp/3.4.0/cordova/events/events.deviceready.md create mode 100644 docs/jp/3.4.0/cordova/events/events.endcallbutton.md create mode 100644 docs/jp/3.4.0/cordova/events/events.md create mode 100644 docs/jp/3.4.0/cordova/events/events.menubutton.md create mode 100644 docs/jp/3.4.0/cordova/events/events.pause.md create mode 100644 docs/jp/3.4.0/cordova/events/events.resume.md create mode 100644 docs/jp/3.4.0/cordova/events/events.searchbutton.md create mode 100644 docs/jp/3.4.0/cordova/events/events.startcallbutton.md create mode 100644 docs/jp/3.4.0/cordova/events/events.volumedownbutton.md create mode 100644 docs/jp/3.4.0/cordova/events/events.volumeupbutton.md create mode 100644 docs/jp/3.4.0/cordova/file-transfer/index.md create mode 100644 docs/jp/3.4.0/cordova/file/index.md create mode 100644 docs/jp/3.4.0/cordova/file/plugins.md create mode 100644 docs/jp/3.4.0/cordova/geolocation/index.md create mode 100644 docs/jp/3.4.0/cordova/globalization/index.md create mode 100644 docs/jp/3.4.0/cordova/inappbrowser/index.md create mode 100644 docs/jp/3.4.0/cordova/media-capture/index.md create mode 100644 docs/jp/3.4.0/cordova/media/index.md create mode 100644 docs/jp/3.4.0/cordova/plugins/pluginapis.md create mode 100644 docs/jp/3.4.0/cordova/splashscreen/index.md create mode 100644 docs/jp/3.4.0/cordova/storage/storage.md create mode 100644 docs/jp/3.4.0/cordova/vibration/index.md create mode 100644 docs/jp/3.4.0/guide/appdev/privacy/index.md create mode 100644 docs/jp/3.4.0/guide/appdev/whitelist/index.md create mode 100644 docs/jp/3.4.0/guide/cli/index.md create mode 100644 docs/jp/3.4.0/guide/hybrid/plugins/index.md create mode 100644 docs/jp/3.4.0/guide/hybrid/webviews/index.md create mode 100644 docs/jp/3.4.0/guide/overview/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/amazonfireos/config.md create mode 100644 docs/jp/3.4.0/guide/platforms/amazonfireos/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/amazonfireos/plugin.md create mode 100644 docs/jp/3.4.0/guide/platforms/amazonfireos/webview.md create mode 100644 docs/jp/3.4.0/guide/platforms/android/config.md create mode 100644 docs/jp/3.4.0/guide/platforms/android/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/android/plugin.md create mode 100644 docs/jp/3.4.0/guide/platforms/android/tools.md create mode 100644 docs/jp/3.4.0/guide/platforms/android/upgrading.md create mode 100644 docs/jp/3.4.0/guide/platforms/android/webview.md create mode 100644 docs/jp/3.4.0/guide/platforms/blackberry10/config.md create mode 100644 docs/jp/3.4.0/guide/platforms/blackberry10/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/blackberry10/plugin.md create mode 100644 docs/jp/3.4.0/guide/platforms/blackberry10/tools.md create mode 100644 docs/jp/3.4.0/guide/platforms/blackberry10/upgrading.md create mode 100644 docs/jp/3.4.0/guide/platforms/firefoxos/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/ios/config.md create mode 100644 docs/jp/3.4.0/guide/platforms/ios/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/ios/plugin.md create mode 100644 docs/jp/3.4.0/guide/platforms/ios/tools.md create mode 100644 docs/jp/3.4.0/guide/platforms/ios/upgrading.md create mode 100644 docs/jp/3.4.0/guide/platforms/ios/webview.md create mode 100644 docs/jp/3.4.0/guide/platforms/tizen/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/ubuntu/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/win8/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/win8/tools.md create mode 100644 docs/jp/3.4.0/guide/platforms/win8/upgrading.md create mode 100644 docs/jp/3.4.0/guide/platforms/wp7/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/wp8/index.md create mode 100644 docs/jp/3.4.0/guide/platforms/wp8/plugin.md create mode 100644 docs/jp/3.4.0/guide/platforms/wp8/tools.md create mode 100644 docs/jp/3.4.0/guide/platforms/wp8/upgrading.md create mode 100644 docs/jp/3.4.0/guide/support/index.md create mode 100644 docs/jp/3.4.0/index.md diff --git a/docs/jp/3.4.0/cordova/accelerometor/index.md b/docs/jp/3.4.0/cordova/accelerometor/index.md new file mode 100644 index 0000000000..79d3b47f54 --- /dev/null +++ b/docs/jp/3.4.0/cordova/accelerometor/index.md @@ -0,0 +1,156 @@ + + +# org.apache.cordova.device-motion + +This plugin provides access to the device's accelerometer. The accelerometer is +a motion sensor that detects the change (_delta_) in movement relative to the +current device orientation, in three dimensions along the _x_, _y_, and _z_ +axis. + +## Installation + + cordova plugin add org.apache.cordova.device-motion + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +## Methods + +- navigator.accelerometer.getCurrentAcceleration +- navigator.accelerometer.watchAcceleration +- navigator.accelerometer.clearWatch + +## Objects + +- Acceleration + +## navigator.accelerometer.getCurrentAcceleration + +Get the current acceleration along the _x_, _y_, and _z_ axes. + +These acceleration values are returned to the `accelerometerSuccess` +callback function. + + navigator.accelerometer.getCurrentAcceleration(accelerometerSuccess, accelerometerError); + + +### Example + + function onSuccess(acceleration) { + alert('Acceleration X: ' + acceleration.x + '\n' + + 'Acceleration Y: ' + acceleration.y + '\n' + + 'Acceleration Z: ' + acceleration.z + '\n' + + 'Timestamp: ' + acceleration.timestamp + '\n'); + }; + + function onError() { + alert('onError!'); + }; + + navigator.accelerometer.getCurrentAcceleration(onSuccess, onError); + +### iOS Quirks + +- iOS doesn't recognize the concept of getting the current acceleration at any given point. + +- You must watch the acceleration and capture the data at given time intervals. + +- Thus, the `getCurrentAcceleration` function yields the last value reported from a `watchAccelerometer` call. + +## navigator.accelerometer.watchAcceleration + +Retrieves the device's current `Acceleration` at a regular interval, executing +the `accelerometerSuccess` callback function each time. Specify the interval in +milliseconds via the `acceleratorOptions` object's `frequency` parameter. + +The returned watch ID references the accelerometer's watch interval, +and can be used with `navigator.accelerometer.clearWatch` to stop watching the +accelerometer. + + var watchID = navigator.accelerometer.watchAcceleration(accelerometerSuccess, + accelerometerError, + [accelerometerOptions]); + +- __accelerometerOptions__: An object with the following optional keys: + - __frequency__: How often to retrieve the `Acceleration` in milliseconds. _(Number)_ (Default: 10000) + + +### Example + + function onSuccess(acceleration) { + alert('Acceleration X: ' + acceleration.x + '\n' + + 'Acceleration Y: ' + acceleration.y + '\n' + + 'Acceleration Z: ' + acceleration.z + '\n' + + 'Timestamp: ' + acceleration.timestamp + '\n'); + }; + + function onError() { + alert('onError!'); + }; + + var options = { frequency: 3000 }; // Update every 3 seconds + + var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); + +### iOS Quirks + +The API calls the success callback function at the interval requested, +but restricts the range of requests to the device between 40ms and +1000ms. For example, if you request an interval of 3 seconds, +(3000ms), the API requests data from the device every 1 second, but +only executes the success callback every 3 seconds. + +## navigator.accelerometer.clearWatch + +Stop watching the `Acceleration` referenced by the `watchID` parameter. + + navigator.accelerometer.clearWatch(watchID); + +- __watchID__: The ID returned by `navigator.accelerometer.watchAcceleration`. + +### Example + + var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); + + // ... later on ... + + navigator.accelerometer.clearWatch(watchID); + +## Acceleration + +Contains `Accelerometer` data captured at a specific point in time. +Acceleration values include the effect of gravity (9.81 m/s^2), so that when a +device lies flat and facing up, _x_, _y_, and _z_ values returned should be +`0`, `0`, and `9.81`. + +### Properties + +- __x__: Amount of acceleration on the x-axis. (in m/s^2) _(Number)_ +- __y__: Amount of acceleration on the y-axis. (in m/s^2) _(Number)_ +- __z__: Amount of acceleration on the z-axis. (in m/s^2) _(Number)_ +- __timestamp__: Creation timestamp in milliseconds. _(DOMTimeStamp)_ + diff --git a/docs/jp/3.4.0/cordova/battery-status/index.md b/docs/jp/3.4.0/cordova/battery-status/index.md new file mode 100644 index 0000000000..9d946f9cf0 --- /dev/null +++ b/docs/jp/3.4.0/cordova/battery-status/index.md @@ -0,0 +1,136 @@ + + +# org.apache.cordova.battery-status + +This plugin provides an implementation of an old version of the [Battery Status Events API](http://www.w3.org/TR/2011/WD-battery-status-20110915/). + +It adds the following three `window` events: + +* batterystatus +* batterycritical +* batterylow + +## Installation + + cordova plugin add org.apache.cordova.battery-status + +## batterystatus + +This event fires when the percentage of battery charge changes by at +least 1 percent, or if the device is plugged in or unplugged. + +The battery status handler is passed an object that contains two +properties: + +- __level__: The percentage of battery charge (0-100). _(Number)_ + +- __isPlugged__: A boolean that indicates whether the device is plugged in. _(Boolean)_ + +Applications typically should use `window.addEventListener` to +attach an event listener once the `deviceready` event fires. e.g.: + +### Supported Platforms + +- Amazon Fire OS +- iOS +- Android +- BlackBerry 10 +- Windows Phone 7 and 8 +- Tizen + +### Windows Phone 7 and 8 Quirks + +Windows Phone 7 does not provide native APIs to determine battery +level, so the `level` property is unavailable. The `isPlugged` +parameter _is_ supported. + +### Example + + window.addEventListener("batterystatus", onBatteryStatus, false); + + function onBatteryStatus(info) { + // Handle the online event + console.log("Level: " + info.level + " isPlugged: " + info.isPlugged); + } + +## batterycritical + +The event fires when the percentage of battery charge has reached the +critical battery threshold. The value is device-specific. + +The `batterycritical` handler is passed an object that contains two +properties: + +- __level__: The percentage of battery charge (0-100). _(Number)_ + +- __isPlugged__: A boolean that indicates whether the device is plugged in. _(Boolean)_ + +Applications typically should use `window.addEventListener` to attach +an event listener once the `deviceready` event fires. + +### Supported Platforms + +- Amazon Fire OS +- iOS +- Android +- BlackBerry 10 +- Tizen + +### Example + + window.addEventListener("batterycritical", onBatteryCritical, false); + + function onBatteryCritical(info) { + // Handle the battery critical event + alert("Battery Level Critical " + info.level + "%\nRecharge Soon!"); + } + +## batterylow + +The event fires when the percentage of battery charge has reached the +low battery threshold, device-specific value. + +The `batterylow` handler is passed an object that contains two +properties: + +- __level__: The percentage of battery charge (0-100). _(Number)_ + +- __isPlugged__: A boolean that indicates whether the device is plugged in. _(Boolean)_ + +Applications typically should use `window.addEventListener` to +attach an event listener once the `deviceready` event fires. + +### Supported Platforms + +- Amazon Fire OS +- iOS +- Android +- BlackBerry 10 +- Tizen + +### Example + + window.addEventListener("batterylow", onBatteryLow, false); + + function onBatteryLow(info) { + // Handle the battery low event + alert("Battery Level Low " + info.level + "%"); + } + diff --git a/docs/jp/3.4.0/cordova/camera/index.md b/docs/jp/3.4.0/cordova/camera/index.md new file mode 100644 index 0000000000..c36d6cbb40 --- /dev/null +++ b/docs/jp/3.4.0/cordova/camera/index.md @@ -0,0 +1,441 @@ + + +# org.apache.cordova.camera + +This plugin provides an API for taking pictures and for choosing images from +the system's image libarary. + + cordova plugin add org.apache.cordova.camera + + +## navigator.camera.getPicture + +Takes a photo using the camera, or retrieves a photo from the device's +image gallery. The image is passed to the success callback as a +base64-encoded `String`, or as the URI for the image file. The method +itself returns a `CameraPopoverHandle` object that can be used to +reposition the file selection popover. + + navigator.camera.getPicture( cameraSuccess, cameraError, [ cameraOptions ] ); + +### Description + +The `camera.getPicture` function opens the device's default camera +application that allows users to snap pictures. This behavior occurs +by default, when `Camera.sourceType` equals +`Camera.PictureSourceType.CAMERA`. Once the user snaps the photo, the +camera application closes and the application is restored. + +If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or +`Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays +that allows users to select an existing image. The +`camera.getPicture` function returns a `CameraPopoverHandle` object, +which can be used to reposition the image selection dialog, for +example, when the device orientation changes. + +The return value is sent to the `cameraSuccess` callback function, in +one of the following formats, depending on the specified +`cameraOptions`: + +- A `String` containing the base64-encoded photo image. + +- A `String` representing the image file location on local storage (default). + +You can do whatever you want with the encoded image or URI, for +example: + +- Render the image in an `` tag, as in the example below + +- Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.) + +- Post the data to a remote server + +__NOTE__: Photo resolution on newer devices is quite good. Photos +selected from the device's gallery are not downscaled to a lower +quality, even if a `quality` parameter is specified. To avoid common +memory problems, set `Camera.destinationType` to `FILE_URI` rather +than `DATA_URL`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Amazon Fire OS Quirks + +Amazon Fire OS uses intents to launch the camera activity on the device to capture +images, and on phones with low memory, the Cordova activity may be killed. In this +scenario, the image may not appear when the cordova activity is restored. + +### Android Quirks + +*Android 4.4 only*: Android 4.4 introduced a new [Storage Access Framework](https://developer.android.com/guide/topics/providers/document-provider.html) that makes it +easier for users to browse and open documents across all of their preferred document storage providers. +Cordova has not yet been fully integrated with this new Storage Access Framework. Because of this, the `getPicture()` +method will not correctly return pictures when the user selects from the "Recent", "Drive", "Images", or "External +Storage" folders when the `destinationType` is `FILE_URI`. However, the user will be able to correctly select any pictures +if they go through the "Gallery" app first. Potential workarounds for this issue are documented on [this StackOverflow question](http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content/20177611). Please see [CB-5398](https://issues.apache.org/jira/browse/CB-5398) to track this issue. + +Android uses intents to launch the camera activity on the device to capture +images, and on phones with low memory, the Cordova activity may be killed. In this +scenario, the image may not appear when the Cordova activity is restored. + +### Firefox OS Quirks + +Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/). + +### iOS Quirks + +Including a JavaScript `alert()` in either of the callback functions +can cause problems. Wrap the alert within a `setTimeout()` to allow +the iOS image picker or popover to fully close before the alert +displays: + + setTimeout(function() { + // do your thing here! + }, 0); + +### Windows Phone 7 Quirks + +Invoking the native camera application while the device is connected +via Zune does not work, and triggers an error callback. + +### Tizen Quirks + +Tizen only supports a `destinationType` of +`Camera.DestinationType.FILE_URI` and a `sourceType` of +`Camera.PictureSourceType.PHOTOLIBRARY`. + +### Example + +Take a photo and retrieve it as a base64-encoded image: + + navigator.camera.getPicture(onSuccess, onFail, { quality: 50, + destinationType: Camera.DestinationType.DATA_URL + }); + + function onSuccess(imageData) { + var image = document.getElementById('myImage'); + image.src = "data:image/jpeg;base64," + imageData; + } + + function onFail(message) { + alert('Failed because: ' + message); + } + +Take a photo and retrieve the image's file location: + + navigator.camera.getPicture(onSuccess, onFail, { quality: 50, + destinationType: Camera.DestinationType.FILE_URI }); + + function onSuccess(imageURI) { + var image = document.getElementById('myImage'); + image.src = imageURI; + } + + function onFail(message) { + alert('Failed because: ' + message); + } + +## CameraOptions + +Optional parameters to customize the camera settings. + + { quality : 75, + destinationType : Camera.DestinationType.DATA_URL, + sourceType : Camera.PictureSourceType.CAMERA, + allowEdit : true, + encodingType: Camera.EncodingType.JPEG, + targetWidth: 100, + targetHeight: 100, + popoverOptions: CameraPopoverOptions, + saveToPhotoAlbum: false }; + +### Options + +- __quality__: Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. _(Number)_ (Note that information about the camera's resolution is unavailable.) + +- __destinationType__: Choose the format of the return value. Defined in `navigator.camera.DestinationType` _(Number)_ + + Camera.DestinationType = { + DATA_URL : 0, // Return image as base64-encoded string + FILE_URI : 1, // Return image file URI + NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) + }; + +- __sourceType__: Set the source of the picture. Defined in `navigator.camera.PictureSourceType` _(Number)_ + + Camera.PictureSourceType = { + PHOTOLIBRARY : 0, + CAMERA : 1, + SAVEDPHOTOALBUM : 2 + }; + +- __allowEdit__: Allow simple editing of image before selection. _(Boolean)_ + +- __encodingType__: Choose the returned image file's encoding. Defined in `navigator.camera.EncodingType` _(Number)_ + + Camera.EncodingType = { + JPEG : 0, // Return JPEG encoded image + PNG : 1 // Return PNG encoded image + }; + +- __targetWidth__: Width in pixels to scale image. Must be used with __targetHeight__. Aspect ratio remains constant. _(Number)_ + +- __targetHeight__: Height in pixels to scale image. Must be used with __targetWidth__. Aspect ratio remains constant. _(Number)_ + +- __mediaType__: Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`. Defined in `nagivator.camera.MediaType` _(Number)_ + + Camera.MediaType = { + PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType + VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI + ALLMEDIA : 2 // allow selection from all media types +}; + +- __correctOrientation__: Rotate the image to correct for the orientation of the device during capture. _(Boolean)_ + +- __saveToPhotoAlbum__: Save the image to the photo album on the device after capture. _(Boolean)_ + +- __popoverOptions__: iOS-only options that specify popover location in iPad. Defined in `CameraPopoverOptions`. + +- __cameraDirection__: Choose the camera to use (front- or back-facing). Defined in `navigator.camera.Direction` _(Number)_ + + Camera.Direction = { + BACK : 0, // Use the back-facing camera + FRONT : 1 // Use the front-facing camera + }; + +### Amazon Fire OSQuirks + +- Any `cameraDirection` value results in a back-facing photo. + +- Ignores the `allowEdit` parameter. + +- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album. + +### Android Quirks + +- Any `cameraDirection` value results in a back-facing photo. + +- Ignores the `allowEdit` parameter. + +- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album. + +### BlackBerry 10 Quirks + +- Ignores the `quality` parameter. + +- Ignores the `sourceType` parameter. + +- Ignores the `allowEdit` parameter. + +- `Camera.MediaType` is not supported. + +- Ignores the `correctOrientation` parameter. + +- Ignores the `cameraDirection` parameter. + +### Firefox OS Quirks + +- Ignores the `quality` parameter. + +- `Camera.DestinationType` is ignored and equals `1` (image file URI) + +- Ignores the `allowEdit` parameter. + +- Ignores the `PictureSourceType` parameter (user chooses it in a dialog window) + +- Ignores the `encodingType` + +- Ignores the `targetWidth` and `targetHeight` + +- `Camera.MediaType` is not supported. + +- Ignores the `correctOrientation` parameter. + +- Ignores the `cameraDirection` parameter. + +### iOS Quirks + +- Set `quality` below 50 to avoid memory errors on some devices. + +- When using `destinationType.FILE_URI`, photos are saved in the application's temporary directory. You may delete the contents of this directory using the `navigator.fileMgr` APIs if storage space is a concern. + +### Tizen Quirks + +- options not supported + +- always returns a FILE URI + +### Windows Phone 7 and 8 Quirks + +- Ignores the `allowEdit` parameter. + +- Ignores the `correctOrientation` parameter. + +- Ignores the `cameraDirection` parameter. + +- Ignores the `mediaType` property of `cameraOptions` as the Windows Phone SDK does not provide a way to choose videos from PHOTOLIBRARY. + + +## CameraError + +onError callback function that provides an error message. + + function(message) { + // Show a helpful message + } + +### Parameters + +- __message__: The message is provided by the device's native code. _(String)_ + + +## cameraSuccess + +onSuccess callback function that provides the image data. + + function(imageData) { + // Do something with the image + } + +### Parameters + +- __imageData__: Base64 encoding of the image data, _or_ the image file URI, depending on `cameraOptions` in effect. _(String)_ + +### Example + + // Show image + // + function cameraCallback(imageData) { + var image = document.getElementById('myImage'); + image.src = "data:image/jpeg;base64," + imageData; + } + + +## CameraPopoverHandle + +A handle to the popover dialog created by `navigator.camera.getPicture`. + +### Methods + +- __setPosition__: Set the position of the popover. + +### Supported Platforms + +- iOS + +### setPosition + +Set the position of the popover. + +__Parameters__: + +- `cameraPopoverOptions`: the `CameraPopoverOptions` that specify the new position + +### Example + + var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, + { destinationType: Camera.DestinationType.FILE_URI, + sourceType: Camera.PictureSourceType.PHOTOLIBRARY, + popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) + }); + + // Reposition the popover if the orientation changes. + window.onorientationchange = function() { + var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); + cameraPopoverHandle.setPosition(cameraPopoverOptions); + } + + +## CameraPopoverOptions + +iOS-only parameters that specify the anchor element location and arrow +direction of the popover when selecting images from an iPad's library +or album. + + { x : 0, + y : 32, + width : 320, + height : 480, + arrowDir : Camera.PopoverArrowDirection.ARROW_ANY + }; + +### CameraPopoverOptions + +- __x__: x pixel coordinate of screen element onto which to anchor the popover. _(Number)_ + +- __y__: y pixel coordinate of screen element onto which to anchor the popover. _(Number)_ + +- __width__: width, in pixels, of the screen element onto which to anchor the popover. _(Number)_ + +- __height__: height, in pixels, of the screen element onto which to anchor the popover. _(Number)_ + +- __arrowDir__: Direction the arrow on the popover should point. Defined in `Camera.PopoverArrowDirection` _(Number)_ + + Camera.PopoverArrowDirection = { + ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants + ARROW_DOWN : 2, + ARROW_LEFT : 4, + ARROW_RIGHT : 8, + ARROW_ANY : 15 + }; + +Note that the size of the popover may change to adjust to the +direction of the arrow and orientation of the screen. Make sure to +account for orientation changes when specifying the anchor element +location. + +## navigator.camera.cleanup + +Removes intermediate photos taken by the camera from temporary +storage. + + navigator.camera.cleanup( cameraSuccess, cameraError ); + +### Description + +Removes intermediate image files that are kept in temporary storage +after calling `camera.getPicture`. Applies only when the value of +`Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the +`Camera.destinationType` equals `Camera.DestinationType.FILE_URI`. + +### Supported Platforms + +- iOS + +### Example + + navigator.camera.cleanup(onSuccess, onFail); + + function onSuccess() { + console.log("Camera cleanup success.") + } + + function onFail(message) { + alert('Failed because: ' + message); + } + diff --git a/docs/jp/3.4.0/cordova/compass/index.md b/docs/jp/3.4.0/cordova/compass/index.md new file mode 100644 index 0000000000..37d2f288a3 --- /dev/null +++ b/docs/jp/3.4.0/cordova/compass/index.md @@ -0,0 +1,195 @@ + + +# org.apache.cordova.device-orientation + +This plugin provides access to the device's compass. The compass is a sensor +that detects the direction or heading that the device is pointed, typically +from the top of the device. It measures the heading in degrees from 0 to +359.99, where 0 is north. + +## Installation + + cordova plugin add org.apache.cordova.device-orientation + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 (if available in hardware) +- Windows 8 + +## Methods + +- navigator.compass.getCurrentHeading +- navigator.compass.watchHeading +- navigator.compass.clearWatch + +## navigator.compass.getCurrentHeading + +Get the current compass heading. The compass heading is returned via a `CompassHeading` +object using the `compassSuccess` callback function. + + navigator.compass.getCurrentHeading(compassSuccess, compassError); + +### Example + + function onSuccess(heading) { + alert('Heading: ' + heading.magneticHeading); + }; + + function onError(error) { + alert('CompassError: ' + error.code); + }; + + navigator.compass.getCurrentHeading(onSuccess, onError); + +## navigator.compass.watchHeading + +Gets the device's current heading at a regular interval. Each time the heading +is retrieved, the `headingSuccess` callback function is executed. + +The returned watch ID references the compass watch interval. The watch +ID can be used with `navigator.compass.clearWatch` to stop watching the navigator.compass. + + var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]); + +`compassOptions` may contain the following keys: + +- __frequency__: How often to retrieve the compass heading in milliseconds. _(Number)_ (Default: 100) +- __filter__: The change in degrees required to initiate a watchHeading success callback. When this value is set, __frequency__ is ignored. _(Number)_ + +### Example + + function onSuccess(heading) { + var element = document.getElementById('heading'); + element.innerHTML = 'Heading: ' + heading.magneticHeading; + }; + + function onError(compassError) { + alert('Compass error: ' + compassError.code); + }; + + var options = { + frequency: 3000 + }; // Update every 3 seconds + + var watchID = navigator.compass.watchHeading(onSuccess, onError, options); + + +### iOS Quirks + +Only one `watchHeading` can be in effect at one time in iOS. If a +`watchHeading` uses a filter, calling `getCurrentHeading` or +`watchHeading` uses the existing filter value to specify heading +changes. Watching heading changes with a filter is more efficient than +with time intervals. + +### Amazon Fire OS Quirks + +- `filter` is not supported. + +### Android Quirks + +- No support for `filter`. + +### Firefox OS Quirks + +- No support for `filter`. + +### Tizen Quirks + +- No support for `filter`. + +### Windows Phone 7 and 8 Quirks + +- No support for `filter`. + +## navigator.compass.clearWatch + +Stop watching the compass referenced by the watch ID parameter. + + navigator.compass.clearWatch(watchID); + +- __watchID__: The ID returned by `navigator.compass.watchHeading`. + +### Example + + var watchID = navigator.compass.watchHeading(onSuccess, onError, options); + + // ... later on ... + + navigator.compass.clearWatch(watchID); + +## CompassHeading + +A `CompassHeading` object is returned to the `compassSuccess` callback function. + +### Properties + +- __magneticHeading__: The heading in degrees from 0-359.99 at a single moment in time. _(Number)_ + +- __trueHeading__: The heading relative to the geographic North Pole in degrees 0-359.99 at a single moment in time. A negative value indicates that the true heading can't be determined. _(Number)_ + +- __headingAccuracy__: The deviation in degrees between the reported heading and the true heading. _(Number)_ + +- __timestamp__: The time at which this heading was determined. _(milliseconds)_ + + +### Amazon Fire OS Quirks + +- `trueHeading` is not supported, but reports the same value as `magneticHeading` + +- `headingAccuracy` is always 0 because there is no difference between the `magneticHeading` and `trueHeading` + +### Android Quirks + +- The `trueHeading` property is not supported, but reports the same value as `magneticHeading`. + +- The `headingAccuracy` property is always 0 because there is no difference between the `magneticHeading` and `trueHeading`. + +### Firefox OS Quirks + +- The `trueHeading` property is not supported, but reports the same value as `magneticHeading`. + +- The `headingAccuracy` property is always 0 because there is no difference between the `magneticHeading` and `trueHeading`. + +### iOS Quirks + +- The `trueHeading` property is only returned for location services enabled via `navigator.geolocation.watchLocation()`. + +- For iOS 4 devices and above, heading factors in the device's current orientation, and does not reference its absolute position, for apps that supports that orientation. + +## CompassError + +A `CompassError` object is returned to the `compassError` callback function when an error occurs. + +### Properties + +- __code__: One of the predefined error codes listed below. + +### Constants + +- `CompassError.COMPASS_INTERNAL_ERR` +- `CompassError.COMPASS_NOT_SUPPORTED` + diff --git a/docs/jp/3.4.0/cordova/connection/index.md b/docs/jp/3.4.0/cordova/connection/index.md new file mode 100644 index 0000000000..d2834838ac --- /dev/null +++ b/docs/jp/3.4.0/cordova/connection/index.md @@ -0,0 +1,190 @@ + + +# org.apache.cordova.network-information + +This plugin provides an implementation of an old version of the +[Network Information API](http://www.w3.org/TR/2011/WD-netinfo-api-20110607/). +It provides information about the device's cellular and +wifi connection, and whether the device has an internet connection. + +## Installation + + cordova plugin add org.apache.cordova.network-information + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Tizen +- Windows 8 + +# Connection + +> The `connection` object, exposed via `navigator.connection`, provides information about the device's cellular and wifi connection. + +## Properties + +- connection.type + +## Constants + +- Connection.UNKNOWN +- Connection.ETHERNET +- Connection.WIFI +- Connection.CELL_2G +- Connection.CELL_3G +- Connection.CELL_4G +- Connection.CELL +- Connection.NONE + +## connection.type + +This property offers a fast way to determine the device's network +connection state, and type of connection. + +### Quick Example + + 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 Change + +Until Cordova 2.3.0, the `Connection` object was accessed via +`navigator.network.connection`, after which it was changed to +`navigator.connection` to match the W3C specification. It's still +available at its original location, but is deprecated and will +eventually be removed. + +### iOS Quirks + +- iOS can't detect the type of cellular network connection. + - `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + +### Windows Phone Quirks + +- When running in the emulator, always detects `navigator.connection.type` as `Connection.UNKNOWN`. + +- Windows Phone can't detect the type of cellular network connection. + - `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + +### Tizen Quirks + +- Tizen can only detect a WiFi or cellular connection. + - `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. + +# Network-related Events + +## offline + +The event fires when an application goes offline, and the device is +not connected to the Internet. + + document.addEventListener("offline", yourCallbackFunction, false); + +### Details + +The `offline` event fires when a previously connected device loses a +network connection so that an application can no longer access the +Internet. It relies on the same information as the Connection API, +and fires when the `connection.type` changes from `NONE` to any other +value. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +### Quick Example + + document.addEventListener("offline", onOffline, false); + + function onOffline() { + // Handle the offline event + } + + +### iOS Quirks + +During initial startup, the first offline event (if applicable) takes at least a second to fire. + +### Windows Phone 7 Quirks + +When running in the Emulator, the `connection.status` is always unknown, so this event does _not_ fire. + +### Windows Phone 8 Quirks + +The Emulator reports the connection type as `Cellular`, which does not change, so the event does _not_ fire. + +## online + +This event fires when an application goes online, and the device +becomes connected to the Internet. + + document.addEventListener("online", yourCallbackFunction, false); + +### Details + +The `online` event fires when a previously unconnected device receives +a network connection to allow an application access to the Internet. +It relies on the same information as the Connection API, and fires +when the value of `connection.type` becomes `NONE`. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +### Quick Example + + document.addEventListener("online", onOnline, false); + + function onOnline() { + // Handle the online event + } + + +### iOS Quirks + +During initial startup, the first `online` event (if applicable) takes +at least a second to fire, prior to which `connection.type` is +`UNKNOWN`. + +### Windows Phone 7 Quirks + +When running in the Emulator, the `connection.status` is always unknown, so this event does _not_ fire. + +### Windows Phone 8 Quirks + +The Emulator reports the connection type as `Cellular`, which does not change, so events does _not_ fire. diff --git a/docs/jp/3.4.0/cordova/contacts/index.md b/docs/jp/3.4.0/cordova/contacts/index.md new file mode 100644 index 0000000000..0a78d4c463 --- /dev/null +++ b/docs/jp/3.4.0/cordova/contacts/index.md @@ -0,0 +1,683 @@ + + +# org.apache.cordova.contacts + +Provides access to the device contacts database. + +__WARNING__: Collection and use of contact data raises +important privacy issues. Your app's privacy policy should discuss +how the app uses contact data and whether it is shared with any other +parties. Contact information is considered sensitive because it +reveals the people with whom a person communicates. Therefore, in +addition to the app's privacy policy, you should strongly consider +providing a just-in-time notice before the app accesses or uses +contact data, if the device operating system doesn't do so +already. That notice should provide the same information noted above, +as well as obtaining the user's permission (e.g., by presenting +choices for __OK__ and __No Thanks__). Note that some app +marketplaces may require the app to provide a just-in-time notice and +obtain the user's permission before accessing contact data. A +clear and easy-to-understand user experience surrounding the use of +contact data helps avoid user confusion and perceived misuse of +contact data. For more information, please see the Privacy Guide. + +## Installation + + cordova plugin add org.apache.cordova.contacts + +### Firefox OS Quirks + +Create __www/manifest.webapp__ as described in +[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). +Add relevant permisions. +There is also a need to change the webapp type to "privileged" - [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type). +__WARNING__: All privileged apps enforce [Content Security Policy](https://developer.mozilla.org/en-US/Apps/CSP) which forbids inline script. Initialize your application in another way. + + "type": "privileged", + "permissions": { + "contacts": { + "access": "readwrite", + "description": "Describe why there is a need for such permission" + } + } + +## navigator.contacts + +### Methods + +- navigator.contacts.create +- navigator.contacts.find + +### Objects + +- Contact +- ContactName +- ContactField +- ContactAddress +- ContactOrganization +- ContactFindOptions +- ContactError + +## navigator.contacts.create + +The `navigator.contacts.create` method is synchronous, and returns a new `Contact` object. + +This method does not retain the Contact object in the device contacts +database, for which you need to invoke the `Contact.save` method. + +### Supported Platforms + +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 + +### Example + + var myContact = navigator.contacts.create({"displayName": "Test User"}); + +## navigator.contacts.find + +The `navigator.contacts.find` method executes asynchronously, querying the +device contacts database and returning an array of `Contact` objects. +The resulting objects are passed to the `contactSuccess` callback +function specified by the __contactSuccess__ parameter. + +The __contactFields__ parameter specifies the fields to be used as a +search qualifier, and only those results are passed to the +__contactSuccess__ callback function. A zero-length __contactFields__ +parameter is invalid and results in +`ContactError.INVALID_ARGUMENT_ERROR`. A __contactFields__ value of +`"*"` returns all contact fields. + +The __contactFindOptions.filter__ string can be used as a search +filter when querying the contacts database. If provided, a +case-insensitive, partial value match is applied to each field +specified in the __contactFields__ parameter. If there's a match for +_any_ of the specified fields, the contact is returned. + +### Parameters + +- __contactFields__: Contact fields to use as a search qualifier. The resulting `Contact` object only features values for these fields. _(DOMString[])_ [Required] + +- __contactSuccess__: Success callback function invoked with the array of Contact objects returned from the database. [Required] + +- __contactError__: Error callback function, invoked when an error occurs. [Optional] + +- __contactFindOptions__: Search options to filter navigator.contacts. [Optional] Keys include: + + - __filter__: The search string used to find navigator.contacts. _(DOMString)_ (Default: `""`) + + - __multiple__: Determines if the find operation returns multiple navigator.contacts. _(Boolean)_ (Default: `false`) + +### Supported Platforms + +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Example + + function onSuccess(contacts) { + alert('Found ' + navigator.contacts.length + ' navigator.contacts.'); + }; + + function onError(contactError) { + alert('onError!'); + }; + + // find all contacts with 'Bob' in any name field + var options = new ContactFindOptions(); + options.filter = "Bob"; + options.multiple = true; + var fields = ["displayName", "name"]; + navigator.contacts.find(fields, onSuccess, onError, options); + + +## Contact + +The `Contact` object represents a user's contact. Contacts can be +created, stored, or removed from the device contacts database. +Contacts can also be retrieved (individually or in bulk) from the +database by invoking the `navigator.contacts.find` method. + +__NOTE__: Not all of the contact fields listed above are supported on +every device platform. Please check each platform's _Quirks_ section +for details. + + +### Properties + +- __id__: A globally unique identifier. _(DOMString)_ + +- __displayName__: The name of this Contact, suitable for display to end users. _(DOMString)_ + +- __name__: An object containing all components of a persons name. _(ContactName)_ + +- __nickname__: A casual name by which to address the contact. _(DOMString)_ + +- __phoneNumbers__: An array of all the contact's phone numbers. _(ContactField[])_ + +- __emails__: An array of all the contact's email addresses. _(ContactField[])_ + +- __addresses__: An array of all the contact's addresses. _(ContactAddress[])_ + +- __ims__: An array of all the contact's IM addresses. _(ContactField[])_ + +- __organizations__: An array of all the contact's organizations. _(ContactOrganization[])_ + +- __birthday__: The birthday of the contact. _(Date)_ + +- __note__: A note about the contact. _(DOMString)_ + +- __photos__: An array of the contact's photos. _(ContactField[])_ + +- __categories__: An array of all the user-defined categories associated with the contact. _(ContactField[])_ + +- __urls__: An array of web pages associated with the contact. _(ContactField[])_ + +### Methods + +- __clone__: Returns a new `Contact` object that is a deep copy of the calling object, with the `id` property set to `null`. + +- __remove__: Removes the contact from the device contacts database, otherwise executes an error callback with a `ContactError` object. + +- __save__: Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same __id__ already exists. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Save Example + + function onSuccess(contact) { + alert("Save Success"); + }; + + function onError(contactError) { + alert("Error = " + contactError.code); + }; + + // create a new contact object + var contact = navigator.contacts.create(); + contact.displayName = "Plumber"; + contact.nickname = "Plumber"; // specify both to support all devices + + // populate some fields + var name = new ContactName(); + name.givenName = "Jane"; + name.familyName = "Doe"; + contact.name = name; + + // save to device + contact.save(onSuccess,onError); + +### Clone Example + + // clone the contact object + var clone = contact.clone(); + clone.name.givenName = "John"; + console.log("Original contact name = " + contact.name.givenName); + console.log("Cloned contact name = " + clone.name.givenName); + +### Remove Example + + function onSuccess() { + alert("Removal Success"); + }; + + function onError(contactError) { + alert("Error = " + contactError.code); + }; + + // remove the contact from the device + contact.remove(onSuccess,onError); + + +### Android 2.X Quirks + +- __categories__: Not supported on Android 2.X devices, returning `null`. + +### BlackBerry 10 Quirks + +- __id__: Supported. Assigned by the device when saving the contact. + +- __displayName__: Supported. Stored in BlackBerry __user1__ field. + +- __nickname__: Not supported, returning `null`. + +- __phoneNumbers__: Partially supported. Phone numbers are stored in BlackBerry fields __homePhone1__ and __homePhone2__ if _type_ is 'home', __workPhone1__ and __workPhone2__ if _type_ is 'work', __mobilePhone__ if _type_ is 'mobile', __faxPhone__ if _type_ is 'fax', __pagerPhone__ if _type_ is 'pager', and __otherPhone__ if _type_ is none of the above. + +- __emails__: Partially supported. The first three email addresses are stored in the BlackBerry __email1__, __email2__, and __email3__ fields, respectively. + +- __addresses__: Partially supported. The first and second addresses are stored in the BlackBerry __homeAddress__ and __workAddress__ fields, respectively. + +- __ims__: Not supported, returning `null`. + +- __organizations__: Partially supported. The __name__ and __title__ of the first organization are stored in the BlackBerry __company__ and __title__ fields, respectively. + +- __photos__: Partially supported. A single thumbnail-sized photo is supported. To set a contact's photo, pass in a either a base64-encoded image, or a URL pointing to the image. The image is scaled down before saving to the BlackBerry contacts database. The contact photo is returned as a base64-encoded image. + +- __categories__: Partially supported. Only _Business_ and _Personal_ categories are supported. + +- __urls__: Partially supported. The first URL is stored in BlackBerry __webpage__ field. + +### FirefoxOS Quirks + +- __categories__: Partially supported. Fields __pref__ and __type__ are returning `null` + +- __ims__: Not supported + +- __photos__: Not supported + + +### iOS Quirks + +- __displayName__: Not supported on iOS, returning `null` unless there is no `ContactName` specified, in which case it returns the composite name, __nickname__ or `""`, respectively. + +- __birthday__: Must be input as a JavaScript `Date` object, the same way it is returned. + +- __photos__: Returns a File URL to the image, which is stored in the application's temporary directory. Contents of the temporary directory are removed when the application exits. + +- __categories__: This property is currently not supported, returning `null`. + +### Windows Phone 7 and 8 Quirks + +- __displayName__: When creating a contact, the value provided for the display name parameter differs from the display name retrieved when finding the contact. + +- __urls__: When creating a contact, users can input and save more than one web address, but only one is available when searching the contact. + +- __phoneNumbers__: The _pref_ option is not supported. The _type_ is not supported in a _find_ operation. Only one `phoneNumber` is allowed for each _type_. + +- __emails__: The _pref_ option is not supported. Home and personal references same email entry. Only one entry is allowed for each _type_. + +- __addresses__: Supports only work, and home/personal _type_. The home and personal _type_ reference the same address entry. Only one entry is allowed for each _type_. + +- __organizations__: Only one is allowed, and does not support the _pref_, _type_, and _department_ attributes. + +- __note__: Not supported, returning `null`. + +- __ims__: Not supported, returning `null`. + +- __birthdays__: Not supported, returning `null`. + +- __categories__: Not supported, returning `null`. + + +## ContactAddress + +The `ContactAddress` object stores the properties of a single address +of a contact. A `Contact` object may include more than one address in +a `ContactAddress[]` array. + + +### Properties + +- __pref__: Set to `true` if this `ContactAddress` contains the user's preferred value. _(boolean)_ + +- __type__: A string indicating what type of field this is, _home_ for example. _(DOMString)_ + +- __formatted__: The full address formatted for display. _(DOMString)_ + +- __streetAddress__: The full street address. _(DOMString)_ + +- __locality__: The city or locality. _(DOMString)_ + +- __region__: The state or region. _(DOMString)_ + +- __postalCode__: The zip code or postal code. _(DOMString)_ + +- __country__: The country name. _(DOMString)_ + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Example + + // display the address information for all contacts + + function onSuccess(contacts) { + for (var i = 0; i < navigator.contacts.length; i++) { + for (var j = 0; j < contacts[i].addresses.length; j++) { + alert("Pref: " + contacts[i].addresses[j].pref + "\n" + + "Type: " + contacts[i].addresses[j].type + "\n" + + "Formatted: " + contacts[i].addresses[j].formatted + "\n" + + "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" + + "Locality: " + contacts[i].addresses[j].locality + "\n" + + "Region: " + contacts[i].addresses[j].region + "\n" + + "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" + + "Country: " + contacts[i].addresses[j].country); + } + } + }; + + function onError(contactError) { + alert('onError!'); + }; + + // find all contacts + var options = new ContactFindOptions(); + options.filter = ""; + var filter = ["displayName", "addresses"]; + navigator.contacts.find(filter, onSuccess, onError, options); + +### Android 2.X Quirks + +- __pref__: Not supported, returning `false` on Android 2.X devices. + +### BlackBerry 10 Quirks + +- __pref__: Not supported on BlackBerry devices, returning `false`. + +- __type__: Partially supported. Only one each of _Work_ and _Home_ type addresses can be stored per contact. + +- __formatted__: Partially supported. Returns a concatenation of all BlackBerry address fields. + +- __streetAddress__: Supported. Returns a concatenation of BlackBerry __address1__ and __address2__ address fields. + +- __locality__: Supported. Stored in BlackBerry __city__ address field. + +- __region__: Supported. Stored in BlackBerry __stateProvince__ address field. + +- __postalCode__: Supported. Stored in BlackBerry __zipPostal__ address field. + +- __country__: Supported. + +### FirefoxOS Quirks + +- __formatted__: Currently not supported + +### iOS Quirks + +- __pref__: Not supported on iOS devices, returning `false`. + +- __formatted__: Currently not supported. + + +## ContactError + +The `ContactError` object is returned to the user through the +`contactError` callback function when an error occurs. + +### Properties + +- __code__: One of the predefined error codes listed below. + +### Constants + +- `ContactError.UNKNOWN_ERROR` +- `ContactError.INVALID_ARGUMENT_ERROR` +- `ContactError.TIMEOUT_ERROR` +- `ContactError.PENDING_OPERATION_ERROR` +- `ContactError.IO_ERROR` +- `ContactError.NOT_SUPPORTED_ERROR` +- `ContactError.PERMISSION_DENIED_ERROR` + + +## ContactField + +The `ContactField` object is a reusable component that represents +contact fields generically. Each `ContactField` object contains a +`value`, `type`, and `pref` property. A `Contact` object stores +several properties in `ContactField[]` arrays, such as phone numbers +and email addresses. + +In most instances, there are no pre-determined values for a +`ContactField` object's __type__ attribute. For example, a phone +number can specify __type__ values of _home_, _work_, _mobile_, +_iPhone_, or any other value that is supported by a particular device +platform's contact database. However, for the `Contact` __photos__ +field, the __type__ field indicates the format of the returned image: +__url__ when the __value__ attribute contains a URL to the photo +image, or _base64_ when the __value__ contains a base64-encoded image +string. + +### Properties + +- __type__: A string that indicates what type of field this is, _home_ for example. _(DOMString)_ + +- __value__: The value of the field, such as a phone number or email address. _(DOMString)_ + +- __pref__: Set to `true` if this `ContactField` contains the user's preferred value. _(boolean)_ + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Example + + // create a new contact + var contact = navigator.contacts.create(); + + // store contact phone numbers in ContactField[] + var phoneNumbers = []; + phoneNumbers[0] = new ContactField('work', '212-555-1234', false); + phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number + phoneNumbers[2] = new ContactField('home', '203-555-7890', false); + contact.phoneNumbers = phoneNumbers; + + // save the contact + contact.save(); + +### Android Quirks + +- __pref__: Not supported, returning `false`. + +### BlackBerry 10 Quirks + +- __type__: Partially supported. Used for phone numbers. + +- __value__: Supported. + +- __pref__: Not supported, returning `false`. + +### iOS Quirks + +- __pref__: Not supported, returning `false`. + + +## ContactName + +Contains different kinds of information about a `Contact` object's name. + +### Properties + +- __formatted__: The complete name of the contact. _(DOMString)_ + +- __familyName__: The contact's family name. _(DOMString)_ + +- __givenName__: The contact's given name. _(DOMString)_ + +- __middleName__: The contact's middle name. _(DOMString)_ + +- __honorificPrefix__: The contact's prefix (example _Mr._ or _Dr._) _(DOMString)_ + +- __honorificSuffix__: The contact's suffix (example _Esq._). _(DOMString)_ + +### Supported Platforms + +- Amazon Fire OS +- Android 2.X +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Example + + function onSuccess(contacts) { + for (var i = 0; i < navigator.contacts.length; i++) { + alert("Formatted: " + contacts[i].name.formatted + "\n" + + "Family Name: " + contacts[i].name.familyName + "\n" + + "Given Name: " + contacts[i].name.givenName + "\n" + + "Middle Name: " + contacts[i].name.middleName + "\n" + + "Suffix: " + contacts[i].name.honorificSuffix + "\n" + + "Prefix: " + contacts[i].name.honorificSuffix); + } + }; + + function onError(contactError) { + alert('onError!'); + }; + + var options = new ContactFindOptions(); + options.filter = ""; + filter = ["displayName", "name"]; + navigator.contacts.find(filter, onSuccess, onError, options); + +### Android Quirks + +- __formatted__: Partially supported, and read-only. Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`. + +### BlackBerry 10 Quirks + +- __formatted__: Partially supported. Returns a concatenation of BlackBerry __firstName__ and __lastName__ fields. + +- __familyName__: Supported. Stored in BlackBerry __lastName__ field. + +- __givenName__: Supported. Stored in BlackBerry __firstName__ field. + +- __middleName__: Not supported, returning `null`. + +- __honorificPrefix__: Not supported, returning `null`. + +- __honorificSuffix__: Not supported, returning `null`. + +### FirefoxOS Quirks + +- __formatted__: Partially supported, and read-only. Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`. + +### iOS Quirks + +- __formatted__: Partially supported. Returns iOS Composite Name, but is read-only. + + +## ContactOrganization + +The `ContactOrganization` object stores a contact's organization +properties. A `Contact` object stores one or more +`ContactOrganization` objects in an array. + +### Properties + +- __pref__: Set to `true` if this `ContactOrganization` contains the user's preferred value. _(boolean)_ + +- __type__: A string that indicates what type of field this is, _home_ for example. _(DOMString) + +- __name__: The name of the organization. _(DOMString)_ + +- __department__: The department the contract works for. _(DOMString)_ + +- __title__: The contact's title at the organization. _(DOMString)_ + + +### Supported Platforms + +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Example + + function onSuccess(contacts) { + for (var i = 0; i < navigator.contacts.length; i++) { + for (var j = 0; j < contacts[i].organizations.length; j++) { + alert("Pref: " + contacts[i].organizations[j].pref + "\n" + + "Type: " + contacts[i].organizations[j].type + "\n" + + "Name: " + contacts[i].organizations[j].name + "\n" + + "Department: " + contacts[i].organizations[j].department + "\n" + + "Title: " + contacts[i].organizations[j].title); + } + } + }; + + function onError(contactError) { + alert('onError!'); + }; + + var options = new ContactFindOptions(); + options.filter = ""; + filter = ["displayName", "organizations"]; + navigator.contacts.find(filter, onSuccess, onError, options); + +### Android 2.X Quirks + +- __pref__: Not supported by Android 2.X devices, returning `false`. + +### BlackBerry 10 Quirks + +- __pref__: Not supported by BlackBerry devices, returning `false`. + +- __type__: Not supported by BlackBerry devices, returning `null`. + +- __name__: Partially supported. The first organization name is stored in the BlackBerry __company__ field. + +- __department__: Not supported, returning `null`. + +- __title__: Partially supported. The first organization title is stored in the BlackBerry __jobTitle__ field. + +### Firefox OS Quirks + +- __pref__: Not supported + +- __type__: Not supported + +- __department__: Not supported + +- Fields __name__ and __title__ stored in __org__ and __jobTitle__. + +### iOS Quirks + +- __pref__: Not supported on iOS devices, returning `false`. + +- __type__: Not supported on iOS devices, returning `null`. + +- __name__: Partially supported. The first organization name is stored in the iOS __kABPersonOrganizationProperty__ field. + +- __department__: Partially supported. The first department name is stored in the iOS __kABPersonDepartmentProperty__ field. + +- __title__: Partially supported. The first title is stored in the iOS __kABPersonJobTitleProperty__ field. diff --git a/docs/jp/3.4.0/cordova/device/index.md b/docs/jp/3.4.0/cordova/device/index.md new file mode 100644 index 0000000000..9e5c677943 --- /dev/null +++ b/docs/jp/3.4.0/cordova/device/index.md @@ -0,0 +1,213 @@ + + +# org.apache.cordova.device + +This plugin defines a global `device` object, which describes the device's hardware and software. +Although the object is in the global scope, it is not available until after the `deviceready` event. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + +## Installation + + cordova plugin add org.apache.cordova.device + +## Properties + +- device.cordova +- device.model +- device.name +- device.platform +- device.uuid +- device.version + +## device.cordova + +Get the version of Cordova running on the device. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +## device.model + +The `device.model` 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. + +### Supported Platforms + +- Android +- BlackBerry 10 +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Quick Example + + // 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 = device.model; + +### Android Quirks + +- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`. + +### Tizen Quirks + +- Returns the device model assigned by the vendor, for example, `TIZEN` + +### Windows Phone 7 and 8 Quirks + +- Returns the device model specified by the manufacturer. For example, the Samsung Focus returns `SGH-i917`. + +## device.name + +__WARNING__: `device.name` is deprecated as of version 2.3.0. Use `device.model` instead. + +## device.platform + +Get the device's operating system name. + + var string = device.platform; + +### Supported Platforms + +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Quick Example + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + +### Windows Phone 7 Quirks + +Windows Phone 7 devices report the platform as `WinCE`. + +### Windows Phone 8 Quirks + +Windows Phone 8 devices report the platform as `Win32NT`. + +## device.uuid + +Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + + var string = device.uuid; + +### Description + +The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model. + +### Supported Platforms + +- Android +- BlackBerry 10 +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Quick Example + + // 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 can't 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 = device.uuid; + +### iOS Quirk + +The `uuid` 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 the app per version (apparent in iOS 5.1). The `uuid` is not +a reliable value. + +### Windows Phone 7 and 8 Quirks + +The `uuid` for Windows Phone 7 requires the permission +`ID_CAP_IDENTITY_DEVICE`. 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. + +## device.version + +Get the operating system version. + + var string = device.version; + +### Supported Platforms + +- Android 2.1+ +- BlackBerry 10 +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Quick Example + + // 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 = device.version; + diff --git a/docs/jp/3.4.0/cordova/dialogs/index.md b/docs/jp/3.4.0/cordova/dialogs/index.md new file mode 100644 index 0000000000..1cb3e0969e --- /dev/null +++ b/docs/jp/3.4.0/cordova/dialogs/index.md @@ -0,0 +1,261 @@ + + +# org.apache.cordova.dialogs + +This plugin provides access to some native dialog UI elements. + +## Installation + + cordova plugin add org.apache.cordova.dialogs + +### Firefox OS Quirks + +Create __www/manifest.webapp__ as described in +[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). +Add permisions: + + "permissions": { + "desktop-notification": { + "description": "Describe why you need to enable notifications" + } + } + +Edit __www/index.html__ and add following in `head` section: + + + +## Methods + +- `navigator.notification.alert` +- `navigator.notification.confirm` +- `navigator.notification.prompt` +- `navigator.notification.beep` + +## navigator.notification.alert + +Shows a custom alert or dialog box. Most Cordova implementations use a native +dialog box for this feature, but some platforms use the browser's `alert` +function, which is typically less customizable. + + navigator.notification.alert(message, alertCallback, [title], [buttonName]) + +- __message__: Dialog message. _(String)_ + +- __alertCallback__: Callback to invoke when alert dialog is dismissed. _(Function)_ + +- __title__: Dialog title. _(String)_ (Optional, defaults to `Alert`) + +- __buttonName__: Button name. _(String)_ (Optional, defaults to `OK`) + + +### Example + + function alertDismissed() { + // do something + } + + navigator.notification.alert( + 'You are the winner!', // message + alertDismissed, // callback + 'Game Over', // title + 'Done' // buttonName + ); + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Windows Phone 7 and 8 Quirks + +- There is no built-in browser alert, but you can bind one as follows to call `alert()` in the global scope: + + window.alert = navigator.notification.alert; + +- Both `alert` and `confirm` are non-blocking calls, results of which are only available asynchronously. + +### Firefox OS Quirks: + +Both native-blocking `window.alert()` and non-blocking `navigator.notification.alert()` are available. + +## navigator.notification.confirm + +Displays a customizable confirmation dialog box. + + navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels]) + +- __message__: Dialog message. _(String)_ + +- __confirmCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_ + +- __title__: Dialog title. _(String)_ (Optional, defaults to `Confirm`) + +- __buttonLabels__: Array of strings specifying button labels. _(Array)_ (Optional, defaults to [`OK,Cancel`]) + + +### confirmCallback + +The `confirmCallback` executes when the user presses one of the +buttons in the confirmation dialog box. + +The callback takes the argument `buttonIndex` _(Number)_, which is the +index of the pressed button. Note that the index uses one-based +indexing, so the value is `1`, `2`, `3`, etc. + +### Example + + function onConfirm(buttonIndex) { + alert('You selected button ' + buttonIndex); + } + + navigator.notification.confirm( + 'You are the winner!', // message + onConfirm, // callback to invoke with index of button pressed + 'Game Over', // title + ['Restart','Exit'] // buttonLabels + ); + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Windows Phone 7 and 8 Quirks + +- There is no built-in browser function for `window.confirm`, but you can bind it by assigning: + + window.confirm = navigator.notification.confirm; + +- Calls to `alert` and `confirm` are non-blocking, so the result is only available asynchronously. + +### Firefox OS Quirks: + +Both native-blocking `window.confirm()` and non-blocking `navigator.notification.confirm()` are available. + +## navigator.notification.prompt + +Displays a native dialog box that is more customizable than the browser's `prompt` function. + + navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText]) + +- __message__: Dialog message. _(String)_ + +- __promptCallback__: Callback to invoke when a button is pressed. _(Function)_ + +- __title__: Dialog title _(String)_ (Optional, defaults to `Prompt`) + +- __buttonLabels__: Array of strings specifying button labels _(Array)_ (Optional, defaults to `["OK","Cancel"]`) + +- __defaultText__: Default textbox input value (`String`) (Optional, Default: empty string) + +### promptCallback + +The `promptCallback` executes when the user presses one of the buttons +in the prompt dialog box. The `results` object passed to the callback +contains the following properties: + +- __buttonIndex__: The index of the pressed button. _(Number)_ Note that the index uses one-based indexing, so the value is `1`, `2`, `3`, etc. + +- __input1__: The text entered in the prompt dialog box. _(String)_ + +### Example + + function onPrompt(results) { + alert("You selected button number " + results.buttonIndex + " and entered " + results.input1); + } + + navigator.notification.prompt( + 'Please enter your name', // message + onPrompt, // callback to invoke + 'Registration', // title + ['Ok','Exit'], // buttonLabels + 'Jane Doe' // defaultText + ); + +### Supported Platforms + +- Amazon Fire OS +- Android +- Firefox OS +- iOS + +### Android Quirks + +- Android supports a maximum of three buttons, and ignores any more than that. + +- On Android 3.0 and later, buttons are displayed in reverse order for devices that use the Holo theme. + +### Firefox OS Quirks: + +Both native-blocking `window.prompt()` and non-blocking `navigator.notification.prompt()` are available. + +## navigator.notification.beep + +The device plays a beep sound. + + navigator.notification.beep(times); + +- __times__: The number of times to repeat the beep. _(Number)_ + +### Example + + // Beep twice! + navigator.notification.beep(2); + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +### Amazon Fire OS Quirks + +- Amazon Fire OS plays the default __Notification Sound__ specified under the __Settings/Display & Sound__ panel. + +### Android Quirks + +- Android plays the default __Notification ringtone__ specified under the __Settings/Sound & Display__ panel. + +### Windows Phone 7 and 8 Quirks + +- Relies on a generic beep file from the Cordova distribution. + +### Tizen Quirks + +- Tizen implements beeps by playing an audio file via the media API. + +- The beep file must be short, must be located in a `sounds` subdirectory of the application's root directory, and must be named `beep.wav`. + diff --git a/docs/jp/3.4.0/cordova/events/events.backbutton.md b/docs/jp/3.4.0/cordova/events/events.backbutton.md new file mode 100644 index 0000000000..c40d00a699 --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.backbutton.md @@ -0,0 +1,81 @@ +--- + 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. +--- + +# backbutton + +The event fires when the user presses the back button. + + document.addEventListener("backbutton", yourCallbackFunction, false); + +## Details + +To override the default back-button behavior, register an event +listener for the `backbutton` event, typically by calling +`document.addEventListener` once you receive the `deviceready` event. +It is no longer necessary to call any other method to override the +back-button behavior. + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Windows Phone 7 and 8 + +## Quick Example + + document.addEventListener("backbutton", onBackKeyDown, false); + + function onBackKeyDown() { + // Handle the back button + } + +## Full Example + + + + + Back Button Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/events/events.deviceready.md b/docs/jp/3.4.0/cordova/events/events.deviceready.md new file mode 100644 index 0000000000..47537b0247 --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.deviceready.md @@ -0,0 +1,90 @@ +--- + 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. +--- + +# deviceready + +The event fires when Cordova is fully loaded. + + document.addEventListener("deviceready", yourCallbackFunction, false); + +## Details + +This event is essential to any application. It signals that Cordova's +device APIs have loaded and are ready to access. + +Cordova consists of two code bases: native and JavaScript. While the +native code loads, a custom loading image displays. However, +JavaScript only loads once the DOM loads. This means the web app may +potentially call a Cordova JavaScript function before the +corresponding native code becomes available. + +The `deviceready` event fires once Cordova has fully loaded. Once the +event fires, you can safely make calls to Cordova APIs. Applications +typically attach an event listener with `document.addEventListener` +once the HTML document's DOM has loaded. + +The `deviceready` event behaves somewhat differently from others. Any +event handler registered after the `deviceready` event fires has its +callback function called immediately. + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +## Quick Example + + document.addEventListener("deviceready", onDeviceReady, false); + + function onDeviceReady() { + // Now safe to use device APIs + } + +## Full Example + + + + + Device Ready Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/events/events.endcallbutton.md b/docs/jp/3.4.0/cordova/events/events.endcallbutton.md new file mode 100644 index 0000000000..8b3e21d229 --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.endcallbutton.md @@ -0,0 +1,78 @@ +--- + 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. +--- + +# endcallbutton + +This event fires when the user presses the end call button. + + document.addEventListener("endcallbutton", yourCallbackFunction, false); + +## Details + +The event overrides the default end call behavior. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- BlackBerry 10 + +## Quick Example + + document.addEventListener("endcallbutton", onEndCallKeyDown, false); + + function onEndCallKeyDown() { + // Handle the end call button + } + +## Full Example + + + + + End Call Button Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/events/events.md b/docs/jp/3.4.0/cordova/events/events.md new file mode 100644 index 0000000000..ed7984c35b --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.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. +--- + +# Events + +> Cordova lifecycle events. + +## Event Types + +- deviceready +- pause +- resume +- backbutton +- menubutton +- searchbutton +- startcallbutton +- endcallbutton +- volumedownbutton +- volumeupbutton + +## Events added by [org.apache.cordova.battery-status](https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md) + +- batterycritical +- batterylow +- batterystatus + +## Events added by [org.apache.cordova.network-information](https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md) + +- online +- offline + diff --git a/docs/jp/3.4.0/cordova/events/events.menubutton.md b/docs/jp/3.4.0/cordova/events/events.menubutton.md new file mode 100644 index 0000000000..2d3006a3c9 --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.menubutton.md @@ -0,0 +1,80 @@ +--- +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. +--- + +# menubutton + +The event fires when the user presses the menu button. + + document.addEventListener("menubutton", yourCallbackFunction, false); + +## Details + +Applying an event handler overrides the default menu button behavior. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 + +## Quick Example + + document.addEventListener("menubutton", onMenuKeyDown, false); + + function onMenuKeyDown() { + // Handle the back button + } + +## Full Example + + + + + Menu Button Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/events/events.pause.md b/docs/jp/3.4.0/cordova/events/events.pause.md new file mode 100644 index 0000000000..dc6f4f0506 --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.pause.md @@ -0,0 +1,101 @@ +--- +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. +--- + +# pause + +The event fires when an application is put into the background. + + document.addEventListener("pause", yourCallbackFunction, false); + +## Details + +The `pause` event fires when the native platform puts the application +into the background, typically when the user switches to a different +application. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +## Quick Example + + document.addEventListener("pause", onPause, false); + + function onPause() { + // Handle the pause event + } + +## Full Example + + + + + Pause Example + + + + + + + + +## iOS Quirks + +In the `pause` handler, any calls to the Cordova API or to native +plugins that go through Objective-C do not work, along with any +interactive calls, such as alerts or `console.log()`. They are only +processed when the app resumes, on the next run loop. + +The iOS-specific `resign` event is available as an alternative to +`pause`, and detects when users enable the __Lock__ button to lock the +device with the app running in the foreground. If the app (and +device) is enabled for multi-tasking, this is paired with a subsequent +`pause` event, but only under iOS 5. In effect, all locked apps in iOS +5 that have multi-tasking enabled are pushed to the background. For +apps to remain running when locked under iOS 5, disable the app's +multi-tasking by setting +[UIApplicationExitsOnSuspend](http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html) +to `YES`. To run when locked on iOS 4, this setting does not matter. diff --git a/docs/jp/3.4.0/cordova/events/events.resume.md b/docs/jp/3.4.0/cordova/events/events.resume.md new file mode 100644 index 0000000000..4e38a7d34a --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.resume.md @@ -0,0 +1,114 @@ +--- +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. +--- + +# resume + +The event fires when an application is retrieved from the background. + + document.addEventListener("resume", yourCallbackFunction, false); + +## Details + +The `resume` event fires when the native platform pulls the +application out from the background. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +## Quick Example + + document.addEventListener("resume", onResume, false); + + function onResume() { + // Handle the resume event + } + +## Full Example + + + + + Resume Example + + + + + + + + +## iOS Quirks + +Any interactive functions called from a `pause` event handler execute +later when the app resumes, as signaled by the `resume` event. These +include alerts, `console.log()`, and any calls from plugins or the +Cordova API, which go through Objective-C. + +- __active__ event + + The iOS-specific `active` event is available as an alternative to +`resume`, and detects when users disable the __Lock__ button to unlock +the device with the app running in the foreground. If the app (and +device) is enabled for multi-tasking, this is paired with a subsequent +`resume` event, but only under iOS 5. In effect, all locked apps in +iOS 5 that have multi-tasking enabled are pushed to the background. +For apps to remain running when locked under iOS 5, disable the app's +multi-tasking by setting [UIApplicationExitsOnSuspend](http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html) +to `YES`. To run when locked on iOS 4, this setting does not matter. + +- __resume__ event + + When called from a `resume` event handler, interactive functions such +as `alert()` need to be wrapped in a `setTimeout()` call with a +timeout value of zero, or else the app hangs. For example: + + document.addEventListener("resume", onResume, false); + function onResume() { + setTimeout(function() { + // TODO: do your thing! + }, 0); + } diff --git a/docs/jp/3.4.0/cordova/events/events.searchbutton.md b/docs/jp/3.4.0/cordova/events/events.searchbutton.md new file mode 100644 index 0000000000..bdde91eae4 --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.searchbutton.md @@ -0,0 +1,79 @@ +--- +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. +--- + +# searchbutton + +The event fires when the user presses the search button on Android. + + document.addEventListener("searchbutton", yourCallbackFunction, false); + +## Details + +If you need to override the default search button behavior on Android +you can register an event listener for the 'searchbutton' event. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- Android + +## Quick Example + + document.addEventListener("searchbutton", onSearchKeyDown, false); + + function onSearchKeyDown() { + // Handle the search button + } + +## Full Example + + + + + Search Button Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/events/events.startcallbutton.md b/docs/jp/3.4.0/cordova/events/events.startcallbutton.md new file mode 100644 index 0000000000..ec6f61fb8f --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.startcallbutton.md @@ -0,0 +1,79 @@ +--- +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. +--- + +# startcallbutton + +The event fires when the user presses the start call button. + + document.addEventListener("startcallbutton", yourCallbackFunction, false); + +## Details + +If you need to override the default start call behavior you can +register an event listener for the `startcallbutton` event. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- BlackBerry 10 + +## Quick Example + + document.addEventListener("startcallbutton", onStartCallKeyDown, false); + + function onStartCallKeyDown() { + // Handle the start call button + } + +## Full Example + + + + + Start Call Button Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/events/events.volumedownbutton.md b/docs/jp/3.4.0/cordova/events/events.volumedownbutton.md new file mode 100644 index 0000000000..fd3ff6c28d --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.volumedownbutton.md @@ -0,0 +1,79 @@ +--- +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. +--- + +# volumedownbutton + +The event fires when the user presses the volume down button. + + document.addEventListener("volumedownbutton", yourCallbackFunction, false); + +## Details + +If you need to override the default volume down behavior you can +register an event listener for the `volumedownbutton` event. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- BlackBerry 10 + +## Quick Example + + document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false); + + function onVolumeDownKeyDown() { + // Handle the volume down button + } + +## Full Example + + + + + Volume Down Button Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/events/events.volumeupbutton.md b/docs/jp/3.4.0/cordova/events/events.volumeupbutton.md new file mode 100644 index 0000000000..a17e63b245 --- /dev/null +++ b/docs/jp/3.4.0/cordova/events/events.volumeupbutton.md @@ -0,0 +1,79 @@ +--- +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. +--- + +# volumeupbutton + +The event fires when the user presses the volume up button. + + document.addEventListener("volumeupbutton", yourCallbackFunction, false); + +## Details + +If you need to override the default volume up behavior you can +register an event listener for the `volumeupbutton` event. + +Applications typically should use `document.addEventListener` to +attach an event listener once the `deviceready` event fires. + +## Supported Platforms + +- BlackBerry 10 + +## Quick Example + + document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false); + + function onVolumeUpKeyDown() { + // Handle the volume up button + } + +## Full Example + + + + + Volume Up Button Example + + + + + + + diff --git a/docs/jp/3.4.0/cordova/file-transfer/index.md b/docs/jp/3.4.0/cordova/file-transfer/index.md new file mode 100644 index 0000000000..eb4db58adb --- /dev/null +++ b/docs/jp/3.4.0/cordova/file-transfer/index.md @@ -0,0 +1,277 @@ + + +# org.apache.cordova.file-transfer + +This plugin allows you to upload and download files. + +## Installation + + cordova plugin add org.apache.cordova.file-transfer + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10* +- iOS +- Windows Phone 7 and 8* +- Windows 8* + +\* _Do not support `onprogress` nor `abort()`_ + +# FileTransfer + +The `FileTransfer` object provides a way to upload files using an HTTP +multi-part POST request, and to download files as well. + +## Properties + +- __onprogress__: Called with a `ProgressEvent` whenever a new chunk of data is transferred. _(Function)_ + +## Methods + +- __upload__: sends a file to a server. + +- __download__: downloads a file from server. + +- __abort__: Aborts an in-progress transfer. + + +## upload + +__Parameters__: + +- __fileURL__: Filesystem URL representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (See [Backwards Compatibility Notes] below) + +- __server__: URL of the server to receive the file, as encoded by `encodeURI()`. + +- __successCallback__: A callback that is passed a `Metadata` object. _(Function)_ + +- __errorCallback__: A callback that executes if an error occurs retrieving the `Metadata`. Invoked with a `FileTransferError` object. _(Function)_ + +- __trustAllHosts__: Optional parameter, defaults to `false`. If set to `true`, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_ + +- __options__: Optional parameters _(Object)_. Valid keys: + - __fileKey__: The name of the form element. Defaults to `file`. (DOMString) + - __fileName__: The file name to use when saving the file on the server. Defaults to `image.jpg`. (DOMString) + - __mimeType__: The mime type of the data to upload. Defaults to `image/jpeg`. (DOMString) + - __params__: A set of optional key/value pairs to pass in the HTTP request. (Object) + - __chunkedMode__: Whether to upload the data in chunked streaming mode. Defaults to `true`. (Boolean) + - __headers__: A map of header name/header values. Use an array to specify more than one value. (Object) + +### Example + + // !! Assumes variable fileURL contains a valid URL to a text file on the device, + // for example, cdvfile://localhost/persistent/path/to/file.txt + + var win = function (r) { + console.log("Code = " + r.responseCode); + console.log("Response = " + r.response); + console.log("Sent = " + r.bytesSent); + } + + var fail = function (error) { + alert("An error has occurred: Code = " + error.code); + console.log("upload error source " + error.source); + console.log("upload error target " + error.target); + } + + var options = new FileUploadOptions(); + options.fileKey = "file"; + options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1); + options.mimeType = "text/plain"; + + var params = {}; + params.value1 = "test"; + params.value2 = "param"; + + options.params = params; + + var ft = new FileTransfer(); + ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options); + +### Example with Upload Headers and Progress Events (Android and iOS only) + + function win(r) { + console.log("Code = " + r.responseCode); + console.log("Response = " + r.response); + console.log("Sent = " + r.bytesSent); + } + + function fail(error) { + alert("An error has occurred: Code = " + error.code); + console.log("upload error source " + error.source); + console.log("upload error target " + error.target); + } + + var uri = encodeURI("http://some.server.com/upload.php"); + + var options = new FileUploadOptions(); + options.fileKey="file"; + options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1); + options.mimeType="text/plain"; + + var headers={'headerParam':'headerValue'}; + + options.headers = headers; + + var ft = new FileTransfer(); + ft.onprogress = function(progressEvent) { + if (progressEvent.lengthComputable) { + loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total); + } else { + loadingStatus.increment(); + } + }; + ft.upload(fileURL, uri, win, fail, options); + +## FileUploadResult + +A `FileUploadResult` object is passed to the success callback of the +`FileTransfer` object's `upload()` method. + +### Properties + +- __bytesSent__: The number of bytes sent to the server as part of the upload. (long) + +- __responseCode__: The HTTP response code returned by the server. (long) + +- __response__: The HTTP response returned by the server. (DOMString) + +- __headers__: The HTTP response headers by the server. (Object) + - Currently supported on iOS only. + +### iOS Quirks + +- Does not support `responseCode` or `bytesSent`. + + +## download + +__Parameters__: + +- __source__: URL of the server to download the file, as encoded by `encodeURI()`. + +- __target__: Filesystem url representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (See [Backwards Compatibility Notes] below) + +- __successCallback__: A callback that is passed a `FileEntry` object. _(Function)_ + +- __errorCallback__: A callback that executes if an error occurs when retrieving the `Metadata`. Invoked with a `FileTransferError` object. _(Function)_ + +- __trustAllHosts__: Optional parameter, defaults to `false`. If set to `true`, it accepts all security certificates. This is useful because Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_ + +- __options__: Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc). + +### Example + + // !! Assumes variable fileURL contains a valid URL to a path on the device, + // for example, cdvfile://localhost/persistent/path/to/downloads/ + + var fileTransfer = new FileTransfer(); + var uri = encodeURI("http://some.server.com/download.php"); + + fileTransfer.download( + uri, + fileURL, + function(entry) { + console.log("download complete: " + entry.fullPath); + }, + function(error) { + console.log("download error source " + error.source); + console.log("download error target " + error.target); + console.log("upload error code" + error.code); + }, + false, + { + headers: { + "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" + } + } + ); + +## abort + +Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object which has an error code of FileTransferError.ABORT_ERR. + +### Example + + // !! Assumes variable fileURL contains a valid URL to a text file on the device, + // for example, cdvfile://localhost/persistent/path/to/file.txt + + var win = function(r) { + console.log("Should not be called."); + } + + var fail = function(error) { + // error.code == FileTransferError.ABORT_ERR + alert("An error has occurred: Code = " + error.code); + console.log("upload error source " + error.source); + console.log("upload error target " + error.target); + } + + var options = new FileUploadOptions(); + options.fileKey="file"; + options.fileName="myphoto.jpg"; + options.mimeType="image/jpeg"; + + var ft = new FileTransfer(); + ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options); + ft.abort(); + + +## FileTransferError + +A `FileTransferError` object is passed to an error callback when an error occurs. + +### Properties + +- __code__: One of the predefined error codes listed below. (Number) + +- __source__: URL to the source. (String) + +- __target__: URL to the target. (String) + +- __http_status__: HTTP status code. This attribute is only available when a response code is received from the HTTP connection. (Number) + +### Constants + +- `FileTransferError.FILE_NOT_FOUND_ERR` +- `FileTransferError.INVALID_URL_ERR` +- `FileTransferError.CONNECTION_ERR` +- `FileTransferError.ABORT_ERR` + +## Backwards Compatibility Notes + +Previous versions of this plugin would only accept device-absolute-file-paths as the source for uploads, or as the target for downloads. These paths would typically be of the form + + /var/mobile/Applications//Documents/path/to/file (iOS) + /storage/emulated/0/path/to/file (Android) + +For backwards compatibility, these paths are still accepted, and if your application has recorded paths like these in persistent storage, then they can continue to be used. + +These paths were previously exposed in the `fullPath` property of `FileEntry` and `DirectoryEntry` objects returned by the File plugin. New versions of the File plugin, however, no longer expose these paths to JavaScript. + +If you are upgrading to a new (1.0.0 or newer) version of File, and you have previously been using `entry.fullPath` as arguments to `download()` or `upload()`, then you will need to change your code to use filesystem URLs instead. + +`FileEntry.toURL()` and `DirectoryEntry.toURL()` return a filesystem URL of the form + + cdvfile://localhost/persistent/path/to/file + +which can be used in place of the absolute file path in both `download()` and `upload()` methods. diff --git a/docs/jp/3.4.0/cordova/file/index.md b/docs/jp/3.4.0/cordova/file/index.md new file mode 100644 index 0000000000..0b4262344a --- /dev/null +++ b/docs/jp/3.4.0/cordova/file/index.md @@ -0,0 +1,165 @@ + + +# org.apache.cordova.file + +This plugin provides the [HTML5 Filesystem API](http://dev.w3.org/2009/dap/file-system/pub/FileSystem/). For usage, refer +to HTML5 Rocks' [FileSystem article](http://www.html5rocks.com/en/tutorials/file/filesystem/) +on the subject. For an overview of other storage options, refer to Cordova's +[storage guide](http://cordova.apache.org/docs/en/edge/cordova_storage_storage.md.html). + +## Installation + + cordova plugin add org.apache.cordova.file + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10* +- iOS +- Windows Phone 7 and 8* +- Windows 8* + +\* _These platforms do not support `FileReader.readAsArrayBuffer` nor `FileWriter.write(blob)`._ + +## Android Quirks + +### Android Persistent storage location + +There are multiple valid locations to store persistent files on an Android +device. See [this page](http://developer.android.com/guide/topics/data/data-storage.html) +for an extensive discussion of the various possibilities. + +Previous versions of the plugin would choose the location of the temporary and +persistent files on startup, based on whether the device claimed that the SD +Card (or equivalent storage partition) was mounted. If the SD Card was mounted, +or if a large internal storage partition was available (such as on Nexus +devices,) then the persistent files would be stored in the root of that space. +This meant that all Cordova apps could see all of the files available on the +card. + +If the SD card was not available, then previous versions would store data under +/data/data/, which isolates apps from each other, but may still +cause data to be shared between users. + +It is now possible to choose whether to store files in the internal file +storage location, or using the previous logic, with a preference in your +application's config.xml file. To do this, add one of these two lines to +config.xml: + + + + + +Without this line, the File plugin will use "Compatibility" as the default. If +a preference tag is present, and is not one of these values, the application +will not start. + +If your application has previously been shipped to users, using an older (pre- +1.0) version of this plugin, and has stored files in the persistent filesystem, +then you should set the preference to "Compatibility". Switching the location to +"Internal" would mean that existing users who upgrade their application may be +unable to access their previously-stored files, depending on their device. + +If your application is new, or has never previously stored files in the +persistent filesystem, then the "internal" setting is generally recommended. + +## BlackBerry Quirks + +`DirectoryEntry.removeRecursively()` may fail with a `ControlledAccessException` in the following cases: + +- An app attempts to access a directory created by a previous installation of the app. + +> Solution: ensure temporary directories are cleaned manually, or by the application prior to reinstallation. + +- If the device is connected by USB. + +> Solution: disconnect the USB cable from the device and run again. + +## iOS Quirks +- `FileReader.readAsText(blob, encoding)` + - The `encoding` parameter is not supported, and UTF-8 encoding is always in effect. + +### iOS Persistent storage location + +There are two valid locations to store persistent files on an iOS device: the +Documents directory and the Library directory. Previous versions of the plugin +only ever stored persistent files in the Documents directory. This had the +side-effect of making all of an application's files visible in iTunes, which +was often unintended, especially for applications which handle lots of small +files, rather than producing complete documents for export, which is the +intended purpose of the directory. + +It is now possible to choose whether to store files in the documents or library +directory, with a preference in your application's config.xml file. To do this, +add one of these two lines to config.xml: + + + + + +Without this line, the File plugin will use "Compatibility" as the default. If +a preference tag is present, and is not one of these values, the application +will not start. + +If your application has previously been shipped to users, using an older (pre- +1.0) version of this plugin, and has stored files in the persistent filesystem, +then you should set the preference to "Compatibility". Switching the location to +"Library" would mean that existing users who upgrade their application would be +unable to access their previously-stored files. + +If your application is new, or has never previously stored files in the +persistent filesystem, then the "Library" setting is generally recommended. + +## Upgrading Notes + +In v1.0.0 of this plugin, the `FileEntry` and `DirectoryEntry` structures have changed, +to be more in line with the published specification. + +Previous (pre-1.0.0) versions of the plugin stored the device-absolute-file-location +in the `fullPath` property of `Entry` objects. These paths would typically look like + + /var/mobile/Applications//Documents/path/to/file (iOS) + /storage/emulated/0/path/to/file (Android) + +These paths were also returned by the `toURL()` method of the `Entry` objects. + +With v1.0.0, the `fullPath` attribute is the path to the file, _relative to the root of +the HTML filesystem_. So, the above paths would now both be represented by a `FileEntry` +object with a `fullPath` of + + /path/to/file + +If your application works with device-absolute-paths, and you previously retrieved those +paths through the `fullPath` property of `Entry` objects, then you should update your code +to use `entry.toURL()` instead. This method will now return filesystem URLs of the form + + cdvfile://localhost/persistent/path/to/file + +which can be used to identify the file uniquely. + +For backwards compatibility, the `resolveLocalFileSystemURL()` method will accept a +device-absolute-path, and will return an `Entry` object corresponding to it, as long as that +file exists within either the TEMPORARY or PERSISTENT filesystems. + +This has particularly been an issue with the File-Transfer plugin, which previously used +device-absolute-paths (and can still accept them). It has been updated to work correctly +with FileSystem URLs, so replacing `entry.fullPath` with `entry.toURL()` should resolve any +issues getting that plugin to work with files on the device. diff --git a/docs/jp/3.4.0/cordova/file/plugins.md b/docs/jp/3.4.0/cordova/file/plugins.md new file mode 100644 index 0000000000..496c8d5eec --- /dev/null +++ b/docs/jp/3.4.0/cordova/file/plugins.md @@ -0,0 +1,101 @@ +Notes for plugin developers +=========================== + +These notes are primarily intended for Android and iOS developers who want to write plugins which interface with the file system using the File plugin. + +Working with Cordova file system URLs +------------------------------------- + +Since version 1.0.0, this plugin has used URLs with a `cdvfile` scheme for all communication over the bridge, rather than exposing raw device file system paths to JavaScript. + +On the JavaScript side, this means that FileEntry and DirectoryEntry objects have a fullPath attribute which is relative to the root of the HTML file system. If your plugin's JavaScript API accepts a FileEntry or DirectoryEntry object, you should call `.toURL()` on that object before passing it across the bridge to native code. + +### Converting cdvfile:// URLs to fileystem paths + +Plugins which need to write to the filesystem may want to convert a received file system URL to an actual filesystem location. There are multiple ways of doing this, depending on the native platform. + +It is important to remember that not all `cdvfile://` URLs are mappable to real files on the device. Some URLs can refer to assets on device which are not represented by files, or can even refer to remote resources. Because of these possibilities, plugins should always test whether they get a meaningful result back when trying to convert URLs to paths. + +#### Android + +On Android, the simplest method to convert a `cdvfile://` URL to a filesystem path is to use `org.apache.cordova.CordovaResourceApi`. `CordovaResourceApi` has several methods which can handle `cdvfile://` URLs: + + // webView is a member of the Plugin class + CordovaResourceApi resourceApi = webView.getResourceApi(); + + // Obtain a file:/// URL representing this file on the device, + // or the same URL unchanged if it cannot be mapped to a file + Uri fileURL = resourceApi.remapUri(Uri.parse(cdvfileURL)); + +It is also possible to use the File plugin directly: + + import org.apache.cordova.file.FileUtils; + import org.apache.cordova.file.FileSystem; + import java.net.MalformedURLException; + + // Get the File plugin from the plugin manager + FileUtils filePlugin = (FileUtils)webView.pluginManager.getPlugin("File"); + + // Given a URL, get a path for it + try { + String path = filePlugin.filesystemPathForURL(cdvfileURL); + } catch (MalformedURLException e) { + // The filesystem url wasn't recognized + } + +To convert from a path to a `cdvfile://` URL: + + import org.apache.cordova.file.LocalFilesystemURL; + + // Get a LocalFilesystemURL object for a device path, + // or null if it cannot be represented as a cdvfile URL. + LocalFilesystemURL url = filePlugin.filesystemURLforLocalPath(path); + // Get the string representation of the URL object + String cdvfileURL = url.toString(); + +If your plugin creates a file, and you want to return a FileEntry object for it, use the File plugin: + + // Return a JSON structure suitable for returning to JavaScript, + // or null if this file is not representable as a cdvfile URL. + JSONObject entry = filePlugin.getEntryForFile(file); + +#### iOS + +Cordova on iOS does not use the same `CordovaResourceApi` concept as Android. On iOS, you should use the File plugin to convert between URLs and filesystem paths. + + // Get a CDVFilesystem URL object from a URL string + CDVFilesystemURL* url = [CDVFilesystemURL fileSystemURLWithString:cdvfileURL]; + // Get a path for the URL object, or nil if it cannot be mapped to a file + NSString* path = [filePlugin filesystemPathForURL:url]; + + + // Get a CDVFilesystem URL object for a device path, or + // nil if it cannot be represented as a cdvfile URL. + CDVFilesystemURL* url = [filePlugin fileSystemURLforLocalPath:path]; + // Get the string representation of the URL object + NSString* cdvfileURL = [url absoluteString]; + +If your plugin creates a file, and you want to return a FileEntry object for it, use the File plugin: + + // Get a CDVFilesystem URL object for a device path, or + // nil if it cannot be represented as a cdvfile URL. + CDVFilesystemURL* url = [filePlugin fileSystemURLforLocalPath:path]; + // Get a structure to return to JavaScript + NSDictionary* entry = [filePlugin makeEntryForLocalURL:url] + +#### JavaScript + +In JavaScript, to get a `cdvfile://` URL from a FileEntry or DirectoryEntry object, simply call `.toURL()` on it: + + var cdvfileURL = entry.toURL(); + +In plugin response handlers, to convert from a returned FileEntry structure to an actual Entry object, your handler code should import the File plugin and create a new object: + + // create appropriate Entry object + var entry; + if (entryStruct.isDirectory) { + entry = new DirectoryEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); + } else { + entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); + } + diff --git a/docs/jp/3.4.0/cordova/geolocation/index.md b/docs/jp/3.4.0/cordova/geolocation/index.md new file mode 100644 index 0000000000..038af3d1de --- /dev/null +++ b/docs/jp/3.4.0/cordova/geolocation/index.md @@ -0,0 +1,279 @@ + + +# org.apache.cordova.geolocation + +This plugin provides information about the device's location, such as +latitude and longitude. Common sources of location information include +Global Positioning System (GPS) and location inferred from network +signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, +and GSM/CDMA cell IDs. There is no guarantee that the API returns the +device's actual location. + +This API is based on the +[W3C Geolocation API Specification](http://dev.w3.org/geo/api/spec-source.html), +and only executes on devices that don't already provide an implementation. + +__WARNING__: Collection and use of geolocation data +raises important privacy issues. Your app's privacy policy should +discuss how the app uses geolocation data, whether it is shared with +any other parties, and the level of precision of the data (for +example, coarse, fine, ZIP code level, etc.). Geolocation data is +generally considered sensitive because it can reveal user's +whereabouts and, if stored, the history of their travels. +Therefore, in addition to the app's privacy policy, you should +strongly consider providing a just-in-time notice before the app +accesses geolocation data (if the device operating system doesn't do +so already). That notice should provide the same information noted +above, as well as obtaining the user's permission (e.g., by presenting +choices for __OK__ and __No Thanks__). For more information, please +see the Privacy Guide. + +## Installation + + cordova plugin add org.apache.cordova.geolocation + +### Firefox OS Quirks + +Create __www/manifest.webapp__ as described in +[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). +Add permisions: + + "permissions": { + "geolocation": { "description": "Used to position the map to your current position" } + } + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows 8 + +## Methods + +- navigator.geolocation.getCurrentPosition +- navigator.geolocation.watchPosition +- navigator.geolocation.clearWatch + +## Objects (Read-Only) + +- Position +- PositionError +- Coordinates + +## navigator.geolocation.getCurrentPosition + +Returns the device's current position to the `geolocationSuccess` +callback with a `Position` object as the parameter. If there is an +error, the `geolocationError` callback is passed a +`PositionError` object. + + navigator.geolocation.getCurrentPosition(geolocationSuccess, + [geolocationError], + [geolocationOptions]); + +### Parameters + +- __geolocationSuccess__: The callback that is passed the current position. + +- __geolocationError__: _(Optional)_ The callback that executes if an error occurs. + +- __geolocationOptions__: _(Optional)_ The geolocation options. + + +### Example + + // onSuccess Callback + // This method accepts a Position object, which contains the + // current GPS coordinates + // + var onSuccess = function(position) { + alert('Latitude: ' + position.coords.latitude + '\n' + + 'Longitude: ' + position.coords.longitude + '\n' + + 'Altitude: ' + position.coords.altitude + '\n' + + 'Accuracy: ' + position.coords.accuracy + '\n' + + 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' + + 'Heading: ' + position.coords.heading + '\n' + + 'Speed: ' + position.coords.speed + '\n' + + 'Timestamp: ' + position.timestamp + '\n'); + }; + + // onError Callback receives a PositionError object + // + function onError(error) { + alert('code: ' + error.code + '\n' + + 'message: ' + error.message + '\n'); + } + + navigator.geolocation.getCurrentPosition(onSuccess, onError); + +## navigator.geolocation.watchPosition + +Returns the device's current position when a change in position is detected. +When the device retrieves a new location, the `geolocationSuccess` +callback executes with a `Position` object as the parameter. If +there is an error, the `geolocationError` callback executes with a +`PositionError` object as the parameter. + + var watchId = navigator.geolocation.watchPosition(geolocationSuccess, + [geolocationError], + [geolocationOptions]); + +### Parameters + +- __geolocationSuccess__: The callback that is passed the current position. + +- __geolocationError__: (Optional) The callback that executes if an error occurs. + +- __geolocationOptions__: (Optional) The geolocation options. + +### Returns + +- __String__: returns a watch id that references the watch position interval. The watch id should be used with `navigator.geolocation.clearWatch` to stop watching for changes in position. + +### Example + + // onSuccess Callback + // This method accepts a `Position` object, which contains + // the current GPS coordinates + // + function onSuccess(position) { + var element = document.getElementById('geolocation'); + element.innerHTML = 'Latitude: ' + position.coords.latitude + '
' + + 'Longitude: ' + position.coords.longitude + '
' + + '
' + element.innerHTML; + } + + // onError Callback receives a PositionError object + // + function onError(error) { + alert('code: ' + error.code + '\n' + + 'message: ' + error.message + '\n'); + } + + // Options: throw an error if no update is received every 30 seconds. + // + var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { timeout: 30000 }); + + +## geolocationOptions + +Optional parameters to customize the retrieval of the geolocation +`Position`. + + { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }; + +### Options + +- __enableHighAccuracy__: Provides a hint that the application needs the best possible results. By default, the device attempts to retrieve a `Position` using network-based methods. Setting this property to `true` tells the framework to use more accurate methods, such as satellite positioning. _(Boolean)_ + +- __timeout__: The maximum length of time (milliseconds) that is allowed to pass from the call to `navigator.geolocation.getCurrentPosition` or `geolocation.watchPosition` until the corresponding `geolocationSuccess` callback executes. If the `geolocationSuccess` callback is not invoked within this time, the `geolocationError` callback is passed a `PositionError.TIMEOUT` error code. (Note that when used in conjunction with `geolocation.watchPosition`, the `geolocationError` callback could be called on an interval every `timeout` milliseconds!) _(Number)_ + +- __maximumAge__: Accept a cached position whose age is no greater than the specified time in milliseconds. _(Number)_ + +### Android Quirks + +Android 2.x emulators do not return a geolocation result unless the `enableHighAccuracy` option is set to `true`. + +## navigator.geolocation.clearWatch + +Stop watching for changes to the device's location referenced by the +`watchID` parameter. + + navigator.geolocation.clearWatch(watchID); + +### Parameters + +- __watchID__: The id of the `watchPosition` interval to clear. (String) + +### Example + + // Options: watch for changes in position, and use the most + // accurate position acquisition method available. + // + var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { enableHighAccuracy: true }); + + // ...later on... + + navigator.geolocation.clearWatch(watchID); + +## Position + +Contains `Position` coordinates and timestamp, created by the geolocation API. + +### Properties + +- __coords__: A set of geographic coordinates. _(Coordinates)_ + +- __timestamp__: Creation timestamp for `coords`. _(Date)_ + +## Coordinates + +A `Coordinates` object is attached to a `Position` object that is +available to callback functions in requests for the current position. +It contains a set of properties that describe the geographic coordinates of a position. + +### Properties + +* __latitude__: Latitude in decimal degrees. _(Number)_ + +* __longitude__: Longitude in decimal degrees. _(Number)_ + +* __altitude__: Height of the position in meters above the ellipsoid. _(Number)_ + +* __accuracy__: Accuracy level of the latitude and longitude coordinates in meters. _(Number)_ + +* __altitudeAccuracy__: Accuracy level of the altitude coordinate in meters. _(Number)_ + +* __heading__: Direction of travel, specified in degrees counting clockwise relative to the true north. _(Number)_ + +* __speed__: Current ground speed of the device, specified in meters per second. _(Number)_ + +### Amazon Fire OS Quirks + +__altitudeAccuracy__: Not supported by Android devices, returning `null`. + +### Android Quirks + +__altitudeAccuracy__: Not supported by Android devices, returning `null`. + +## PositionError + +The `PositionError` object is passed to the `geolocationError` +callback function when an error occurs with navigator.geolocation. + +### Properties + +- __code__: One of the predefined error codes listed below. + +- __message__: Error message describing the details of the error encountered. + +### Constants + +- `PositionError.PERMISSION_DENIED` + - Returned when users do not allow the app to retrieve position information. This is dependent on the platform. +- `PositionError.POSITION_UNAVAILABLE` + - Returned when the device is unable to retrieve a position. In general, this means the device is not connected to a network or can't get a satellite fix. +- `PositionError.TIMEOUT` + - Returned when the device is unable to retrieve a position within the time specified by the `timeout` included in `geolocationOptions`. When used with `navigator.geolocation.watchPosition`, this error could be repeatedly passed to the `geolocationError` callback every `timeout` milliseconds. diff --git a/docs/jp/3.4.0/cordova/globalization/index.md b/docs/jp/3.4.0/cordova/globalization/index.md new file mode 100644 index 0000000000..74bf9ee302 --- /dev/null +++ b/docs/jp/3.4.0/cordova/globalization/index.md @@ -0,0 +1,698 @@ + + +# org.apache.cordova.globalization + +This plugin obtains information and performs operations specific to the user's +locale and timezone. + +## Installation + + cordova plugin add org.apache.cordova.globalization + +## Objects + +- GlobalizationError + +## Methods + +- navigator.globalization.getPreferredLanguage +- navigator.globalization.getLocaleName +- navigator.globalization.dateToString +- navigator.globalization.stringToDate +- navigator.globalization.getDatePattern +- navigator.globalization.getDateNames +- navigator.globalization.isDayLightSavingsTime +- navigator.globalization.getFirstDayOfWeek +- navigator.globalization.numberToString +- navigator.globalization.stringToNumber +- navigator.globalization.getNumberPattern +- navigator.globalization.getCurrencyPattern + + +## navigator.globalization.dateToString + +Returns a date formatted as a string according to the client's locale and timezone. + + navigator.globalization.dateToString(date, successCallback, errorCallback, options); + +### Description + +Returns the formatted date `String` via a `value` property accessible +from the object passed as a parameter to the `successCallback`. + +The inbound `date` parameter should be of type `Date`. + +If there is an error formatting the date, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.FORMATTING\_ERROR`. + +The `options` parameter is optional, and its default values are: + + {formatLength:'short', selector:'date and time'} + +The `options.formatLength` can be `short`, `medium`, `long`, or `full`. + +The `options.selector` can be `date`, `time` or `date and time`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +If the browser is set to the `en\_US` locale, this displays a popup +dialog with text similar to `date: 9/25/2012 4:21PM` using the default +options: + + navigator.globalization.dateToString( + new Date(), + function (date) { alert('date: ' + date.value + '\n'); }, + function () { alert('Error getting dateString\n'); }, + { formatLength: 'short', selector: 'date and time' } + ); + +### Windows Phone 8 Quirks + +- The `formatLength` option supports only `short` and `full` values. + +## navigator.globalization.getCurrencyPattern + +Returns a pattern string to format and parse currency values according +to the client's user preferences and ISO 4217 currency code. + + navigator.globalization.getCurrencyPattern(currencyCode, successCallback, errorCallback); + +### Description + +Returns the pattern to the `successCallback` with a `properties` object +as a parameter. That object should contain the following properties: + +- __pattern__: The currency pattern to format and parse currency values. The patterns follow [Unicode Technical Standard #35](http://unicode.org/reports/tr35/tr35-4.html). _(String)_ + +- __code__: The ISO 4217 currency code for the pattern. _(String)_ + +- __fraction__: The number of fractional digits to use when parsing and formatting currency. _(Number)_ + +- __rounding__: The rounding increment to use when parsing and formatting. _(Number)_ + +- __decimal__: The decimal symbol to use for parsing and formatting. _(String)_ + +- __grouping__: The grouping symbol to use for parsing and formatting. _(String)_ + +The inbound `currencyCode` parameter should be a `String` of one of +the ISO 4217 currency codes, for example 'USD'. + +If there is an error obtaining the pattern, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.FORMATTING\_ERROR`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS + +### Example + +When the browser is set to the `en\_US` locale and the selected +currency is United States Dollars, this example displays a popup +dialog with text similar to the results that follow: + + navigator.globalization.getCurrencyPattern( + 'USD', + function (pattern) { + alert('pattern: ' + pattern.pattern + '\n' + + 'code: ' + pattern.code + '\n' + + 'fraction: ' + pattern.fraction + '\n' + + 'rounding: ' + pattern.rounding + '\n' + + 'decimal: ' + pattern.decimal + '\n' + + 'grouping: ' + pattern.grouping); + }, + function () { alert('Error getting pattern\n'); } + ); + +Expected result: + + pattern: $#,##0.##;($#,##0.##) + code: USD + fraction: 2 + rounding: 0 + decimal: . + grouping: , + + +## navigator.globalization.getDateNames + +Returns an array of the names of the months or days of the week, +depending on the client's user preferences and calendar. + + navigator.globalization.getDateNames(successCallback, errorCallback, options); + +### Description + +Returns the array of names to the `successCallback` with a +`properties` object as a parameter. That object contains a `value` +property with an `Array` of `String` values. The array features names +starting from either the first month in the year or the first day of +the week, depending on the option selected. + +If there is an error obtaining the names, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.UNKNOWN\_ERROR`. + +The `options` parameter is optional, and its default values are: + + {type:'wide', item:'months'} + +The value of `options.type` can be `narrow` or `wide`. + +The value of `options.item` can be `months` or `days`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this example displays +a series of twelve popup dialogs, one per month, with text similar to +`month: January`: + + navigator.globalization.getDateNames( + function (names) { + for (var i = 0; i < names.value.length; i++) { + alert('month: ' + names.value[i] + '\n'); + } + }, + function () { alert('Error getting names\n'); }, + { type: 'wide', item: 'months' } + ); + + +## navigator.globalization.getDatePattern + +Returns a pattern string to format and parse dates according to the +client's user preferences. + + navigator.globalization.getDatePattern(successCallback, errorCallback, options); + +### Description + +Returns the pattern to the `successCallback`. The object passed in as +a parameter contains the following properties: + +- __pattern__: The date and time pattern to format and parse dates. The patterns follow [Unicode Technical Standard #35](http://unicode.org/reports/tr35/tr35-4.html). _(String)_ + +- __timezone__: The abbreviated name of the time zone on the client. _(String)_ + +- __utc\_offset__: The current difference in seconds between the client's time zone and coordinated universal time. _(Number)_ + +- __dst\_offset__: The current daylight saving time offset in seconds between the client's non-daylight saving's time zone and the client's daylight saving's time zone. _(Number)_ + +If there is an error obtaining the pattern, the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.PATTERN\_ERROR`. + +The `options` parameter is optional, and defaults to the following values: + + {formatLength:'short', selector:'date and time'} + +The `options.formatLength` can be `short`, `medium`, `long`, or +`full`. The `options.selector` can be `date`, `time` or `date and +time`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this example displays +a popup dialog with text such as `pattern: M/d/yyyy h:mm a`: + + function checkDatePattern() { + navigator.globalization.getDatePattern( + function (date) { alert('pattern: ' + date.pattern + '\n'); }, + function () { alert('Error getting pattern\n'); }, + { formatLength: 'short', selector: 'date and time' } + ); + } + +### Windows Phone 8 Quirks + +- The `formatLength` supports only `short` and `full` values. + +- The `pattern` for `date and time` pattern returns only full datetime format. + +- The `timezone` returns the full time zone name. + +- The `dst_offset` property is not supported, and always returns zero. + + +## navigator.globalization.getFirstDayOfWeek + +Returns the first day of the week according to the client's user +preferences and calendar. + + navigator.globalization.getFirstDayOfWeek(successCallback, errorCallback); + +### Description + +The days of the week are numbered starting from 1, where 1 is assumed +to be Sunday. Returns the day to the `successCallback` with a +`properties` object as a parameter. That object should have a `value` +property with a `Number` value. + +If there is an error obtaining the pattern, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.UNKNOWN\_ERROR`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this displays a +popup dialog with text similar to `day: 1`. + + navigator.globalization.getFirstDayOfWeek( + function (day) {alert('day: ' + day.value + '\n');}, + function () {alert('Error getting day\n');} + ); + + +Get the string identifier for the client's current locale setting. + + navigator.globalization.getLocaleName(successCallback, errorCallback); + +### Description + +Returns the locale identifier string to the `successCallback` with a +`properties` object as a parameter. That object should have a `value` +property with a `String` value. + +If there is an error getting the locale, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.UNKNOWN\_ERROR`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this displays a popup +dialog with the text `locale: en\_US`. + + navigator.globalization.getLocaleName( + function (locale) {alert('locale: ' + locale.value + '\n');}, + function () {alert('Error getting locale\n');} + ); + + +### Windows Phone 8 Quirks + +- Returns the two-letter code defined in ISO 3166 for the current country/region. + +## navigator.globalization.getNumberPattern + +Returns a pattern string to format and parse numbers according to the client's user preferences. + + navigator.globalization.getNumberPattern(successCallback, errorCallback, options); + +### Description + +Returns the pattern to the `successCallback` with a `properties` object +as a parameter. That object contains the following properties: + +- __pattern__: The number pattern to format and parse numbers. The patterns follow [Unicode Technical Standard #35](http://unicode.org/reports/tr35/tr35-4.html). _(String)_ + +- __symbol__: The symbol to use when formatting and parsing, such as a percent or currency symbol. _(String)_ + +- __fraction__: The number of fractional digits to use when parsing and formatting numbers. _(Number)_ + +- __rounding__: The rounding increment to use when parsing and formatting. _(Number)_ + +- __positive__: The symbol to use for positive numbers when parsing and formatting. _(String)_ + +- __negative__: The symbol to use for negative numbers when parsing and formatting. _(String)_ + +- __decimal__: The decimal symbol to use for parsing and formatting. _(String)_ + +- __grouping__: The grouping symbol to use for parsing and formatting. _(String)_ + +If there is an error obtaining the pattern, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.PATTERN\_ERROR`. + +The `options` parameter is optional, and default values are: + + {type:'decimal'} + +The `options.type` can be `decimal`, `percent`, or `currency`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this should display a +popup dialog with text similar to the results that follow: + + navigator.globalization.getNumberPattern( + function (pattern) {alert('pattern: ' + pattern.pattern + '\n' + + 'symbol: ' + pattern.symbol + '\n' + + 'fraction: ' + pattern.fraction + '\n' + + 'rounding: ' + pattern.rounding + '\n' + + 'positive: ' + pattern.positive + '\n' + + 'negative: ' + pattern.negative + '\n' + + 'decimal: ' + pattern.decimal + '\n' + + 'grouping: ' + pattern.grouping);}, + function () {alert('Error getting pattern\n');}, + {type:'decimal'} + ); + +Results: + + pattern: #,##0.### + symbol: . + fraction: 0 + rounding: 0 + positive: + negative: - + decimal: . + grouping: , + + +### Windows Phone 8 Quirks + +- The `pattern` property is not supported, and retuens an empty string. + +- The `fraction` property is not supported, and returns zero. + +## navigator.globalization.getPreferredLanguage + +Get the string identifier for the client's current language. + + navigator.globalization.getPreferredLanguage(successCallback, errorCallback); + +### Description + +Returns the language identifier string to the `successCallback` with a +`properties` object as a parameter. That object should have a `value` +property with a `String` value. + +If there is an error getting the language, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.UNKNOWN\_ERROR`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this should display a +popup dialog with the text `language: English`: + + navigator.globalization.getPreferredLanguage( + function (language) {alert('language: ' + language.value + '\n');}, + function () {alert('Error getting language\n');} + ); + + +### Windows Phone 8 Quirks + +- Returns the ISO 639-1 two-letter code for the current language. + +## navigator.globalization.isDayLightSavingsTime + +Indicates whether daylight savings time is in effect for a given date +using the client's time zone and calendar. + + navigator.globalization.isDayLightSavingsTime(date, successCallback, errorCallback); + +### Description + +Indicates whether or not daylight savings time is in effect to the +`successCallback` with a `properties` object as a parameter. That object +should have a `dst` property with a `Boolean` value. A `true` value +indicates that daylight savings time is in effect for the given date, +and `false` indicates that it is not. + +The inbound parameter `date` should be of type `Date`. + +If there is an error reading the date, then the `errorCallback` +executes. The error's expected code is `GlobalizationError.UNKNOWN\_ERROR`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +During the summer, and if the browser is set to a DST-enabled +timezone, this should display a popup dialog with text similar to +`dst: true`: + + navigator.globalization.isDayLightSavingsTime( + new Date(), + function (date) {alert('dst: ' + date.dst + '\n');}, + function () {alert('Error getting names\n');} + ); + + + +## navigator.globalization.numberToString + +Returns a number formatted as a string according to the client's user preferences. + + navigator.globalization.numberToString(number, successCallback, errorCallback, options); + +### Description + +Returns the formatted number string to the `successCallback` with a +`properties` object as a parameter. That object should have a `value` +property with a `String` value. + +If there is an error formatting the number, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.FORMATTING\_ERROR`. + +The `options` parameter is optional, and its default values are: + + {type:'decimal'} + +The `options.type` can be 'decimal', 'percent', or 'currency'. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this displays a popup +dialog with text similar to `number: 3.142`: + + navigator.globalization.numberToString( + 3.1415926, + function (number) {alert('number: ' + number.value + '\n');}, + function () {alert('Error getting number\n');}, + {type:'decimal'} + ); + + +## navigator.globalization.stringToDate + +Parses a date formatted as a string, according to the client's user +preferences and calendar using the time zone of the client, and +returns the corresponding date object. + + navigator.globalization.stringToDate(dateString, successCallback, errorCallback, options); + +### Description + +Returns the date to the success callback with a `properties` object as +a parameter. That object should have the following properties: + +- __year__: The four digit year. _(Number)_ + +- __month__: The month from (0-11). _(Number)_ + +- __day__: The day from (1-31). _(Number)_ + +- __hour__: The hour from (0-23). _(Number)_ + +- __minute__: The minute from (0-59). _(Number)_ + +- __second__: The second from (0-59). _(Number)_ + +- __millisecond__: The milliseconds (from 0-999), not available on all platforms. _(Number)_ + +The inbound `dateString` parameter should be of type `String`. + +The `options` parameter is optional, and defaults to the following +values: + + {formatLength:'short', selector:'date and time'} + +The `options.formatLength` can be `short`, `medium`, `long`, or +`full`. The `options.selector` can be `date`, `time` or `date and +time`. + +If there is an error parsing the date string, then the `errorCallback` +executes with a `GlobalizationError` object as a parameter. The +error's expected code is `GlobalizationError.PARSING\_ERROR`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this displays a +popup dialog with text similar to `month:8 day:25 year:2012`. Note +that the month integer is one less than the string, as the month +integer represents an array index. + + navigator.globalization.stringToDate( + '9/25/2012', + function (date) {alert('month:' + date.month + + ' day:' + date.day + + ' year:' + date.year + '\n');}, + function () {alert('Error getting date\n');}, + {selector: 'date'} + ); + + +### Windows Phone 8 Quirks + +- The `formatLength` option supports only `short` and `full` values. + +## navigator.globalization.stringToNumber + +Parses a number formatted as a string according to the client's user +preferences and returns the corresponding number. + + navigator.globalization.stringToNumber(string, successCallback, errorCallback, options); + +### Description + +Returns the number to the `successCallback` with a `properties` object +as a parameter. That object should have a `value` property with a +`Number` value. + +If there is an error parsing the number string, then the +`errorCallback` executes with a `GlobalizationError` object as a +parameter. The error's expected code is +`GlobalizationError.PARSING\_ERROR`. + +The `options` parameter is optional, and defaults to the following +values: + + {type:'decimal'} + +The `options.type` can be `decimal`, `percent`, or `currency`. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS +- Windows Phone 8 + +### Example + +When the browser is set to the `en\_US` locale, this should display a +popup dialog with text similar to `number: 1234.56`: + + navigator.globalization.stringToNumber( + '1234.56', + function (number) {alert('number: ' + number.value + '\n');}, + function () {alert('Error getting number\n');}, + {type:'decimal'} + ); + + +## GlobalizationError + +An object representing a error from the Globalization API. + +### Properties + +- __code__: One of the following codes representing the error type _(Number)_ + - GlobalizationError.UNKNOWN\_ERROR: 0 + - GlobalizationError.FORMATTING\_ERROR: 1 + - GlobalizationError.PARSING\_ERROR: 2 + - GlobalizationError.PATTERN\_ERROR: 3 +- __message__: A text message that includes the error's explanation and/or details _(String)_ + +### Description + +This object is created and populated by Cordova, and returned to a callback in the case of an error. + +### Supported Platforms + +- Amazon Fire OS +- Android +- iOS + +### Example + +When the following error callback executes, it displays a +popup dialog with the text similar to `code: 3` and `message:` + + function errorCallback(error) { + alert('code: ' + error.code + '\n' + + 'message: ' + error.message + '\n'); + }; + diff --git a/docs/jp/3.4.0/cordova/inappbrowser/index.md b/docs/jp/3.4.0/cordova/inappbrowser/index.md new file mode 100644 index 0000000000..61f702cf6d --- /dev/null +++ b/docs/jp/3.4.0/cordova/inappbrowser/index.md @@ -0,0 +1,280 @@ + + +# org.apache.cordova.inappbrowser + +This plugin provides a web browser view that displays when calling `window.open()`, or when opening a link formed as ``. + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + +__NOTE__: The InAppBrowser window behaves like a standard web browser, +and can't access Cordova APIs. + +## Installation + + cordova plugin add org.apache.cordova.inappbrowser + +## window.open + +Opens a URL in a new `InAppBrowser` instance, the current browser +instance, or the system browser. + + var ref = window.open(url, target, options); + +- __ref__: Reference to the `InAppBrowser` window. _(InAppBrowser)_ + +- __url__: The URL to load _(String)_. Call `encodeURI()` on this if the URL contains Unicode characters. + +- __target__: The target in which to load the URL, an optional parameter that defaults to `_self`. _(String)_ + + - `_self`: Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the `InAppBrowser`. + - `_blank`: Opens in the `InAppBrowser`. + - `_system`: Opens in the system's web browser. + +- __options__: Options for the `InAppBrowser`. Optional, defaulting to: `location=yes`. _(String)_ + + The `options` string must not contain any blank space, and each feature's name/value pairs must be separated by a comma. Feature names are case insensitive. All platforms support the value below: + + - __location__: Set to `yes` or `no` to turn the `InAppBrowser`'s location bar on or off. + + Android only: + + - __closebuttoncaption__: set to a string to use as the __Done__ button's caption. + - __hidden__: set to `yes` to create the browser and load the page, but not show it. The load event fires when loading is complete. Omit or set to `no` (default) to have the browser open and load normally. + - __clearcache__: set to `yes` to have the browser's cookie cache cleared before the new window is opened + - __clearsessioncache__: set to `yes` to have the session cookie cache cleared before the new window is opened + + iOS only: + + - __closebuttoncaption__: set to a string to use as the __Done__ button's caption. Note that you need to localize this value yourself. + - __disallowoverscroll__: Set to `yes` or `no` (default is `no`). Turns on/off the UIWebViewBounce property. + - __hidden__: set to `yes` to create the browser and load the page, but not show it. The load event fires when loading is complete. Omit or set to `no` (default) to have the browser open and load normally. + - __toolbar__: set to `yes` or `no` to turn the toolbar on or off for the InAppBrowser (defaults to `yes`) + - __enableViewportScale__: Set to `yes` or `no` to prevent viewport scaling through a meta tag (defaults to `no`). + - __mediaPlaybackRequiresUserAction__: Set to `yes` or `no` to prevent HTML5 audio or video from autoplaying (defaults to `no`). + - __allowInlineMediaPlayback__: Set to `yes` or `no` to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. The HTML's `video` element must also include the `webkit-playsinline` attribute (defaults to `no`) + - __keyboardDisplayRequiresUserAction__: Set to `yes` or `no` to open the keyboard when form elements receive focus via JavaScript's `focus()` call (defaults to `yes`). + - __suppressesIncrementalRendering__: Set to `yes` or `no` to wait until all new view content is received before being rendered (defaults to `no`). + - __presentationstyle__: Set to `pagesheet`, `formsheet` or `fullscreen` to set the [presentation style](http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle) (defaults to `fullscreen`). + - __transitionstyle__: Set to `fliphorizontal`, `crossdissolve` or `coververtical` to set the [transition style](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle) (defaults to `coververtical`). + - __toolbarposition__: Set to `top` or `bottom` (default is `bottom`). Causes the toolbar to be at the top or bottom of the window. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 + +### Example + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + var ref2 = window.open(encodeURI('http://ja.m.wikipedia.org/wiki/ハングル'), '_blank', 'location=yes'); + +## InAppBrowser + +The object returned from a call to `window.open`. + +### Methods + +- addEventListener +- removeEventListener +- close +- show +- executeScript +- insertCSS + +## addEventListener + +> Adds a listener for an event from the `InAppBrowser`. + + ref.addEventListener(eventname, callback); + +- __ref__: reference to the `InAppBrowser` window _(InAppBrowser)_ + +- __eventname__: the event to listen for _(String)_ + + - __loadstart__: event fires when the `InAppBrowser` starts to load a URL. + - __loadstop__: event fires when the `InAppBrowser` finishes loading a URL. + - __loaderror__: event fires when the `InAppBrowser` encounters an error when loading a URL. + - __exit__: event fires when the `InAppBrowser` window is closed. + +- __callback__: the function that executes when the event fires. The function is passed an `InAppBrowserEvent` object as a parameter. + +### InAppBrowserEvent Properties + +- __type__: the eventname, either `loadstart`, `loadstop`, `loaderror`, or `exit`. _(String)_ + +- __url__: the URL that was loaded. _(String)_ + +- __code__: the error code, only in the case of `loaderror`. _(Number)_ + +- __message__: the error message, only in the case of `loaderror`. _(String)_ + + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 + +### Quick Example + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.addEventListener('loadstart', function() { alert(event.url); }); + +## removeEventListener + +> Removes a listener for an event from the `InAppBrowser`. + + ref.removeEventListener(eventname, callback); + +- __ref__: reference to the `InAppBrowser` window. _(InAppBrowser)_ + +- __eventname__: the event to stop listening for. _(String)_ + + - __loadstart__: event fires when the `InAppBrowser` starts to load a URL. + - __loadstop__: event fires when the `InAppBrowser` finishes loading a URL. + - __loaderror__: event fires when the `InAppBrowser` encounters an error loading a URL. + - __exit__: event fires when the `InAppBrowser` window is closed. + +- __callback__: the function to execute when the event fires. +The function is passed an `InAppBrowserEvent` object. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 + +### Quick Example + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + var myCallback = function() { alert(event.url); } + ref.addEventListener('loadstart', myCallback); + ref.removeEventListener('loadstart', myCallback); + +## close + +> Closes the `InAppBrowser` window. + + ref.close(); + +- __ref__: reference to the `InAppBrowser` window _(InAppBrowser)_ + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 + +### Quick Example + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.close(); + +## show + +> Displays an InAppBrowser window that was opened hidden. Calling this has no effect if the InAppBrowser was already visible. + + ref.show(); + +- __ref__: reference to the InAppBrowser window (`InAppBrowser`) + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS + +### Quick Example + + var ref = window.open('http://apache.org', '_blank', 'hidden=yes'); + // some time later... + ref.show(); + +## executeScript + +> Injects JavaScript code into the `InAppBrowser` window + + ref.executeScript(details, callback); + +- __ref__: reference to the `InAppBrowser` window. _(InAppBrowser)_ + +- __injectDetails__: details of the script to run, specifying either a `file` or `code` key. _(Object)_ + - __file__: URL of the script to inject. + - __code__: Text of the script to inject. + +- __callback__: the function that executes after the JavaScript code is injected. + - If the injected script is of type `code`, the callback executes + with a single parameter, which is the return value of the + script, wrapped in an `Array`. For multi-line scripts, this is + the return value of the last statement, or the last expression + evaluated. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS + +### Quick Example + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.addEventListener('loadstop', function() { + ref.executeScript({file: "myscript.js"}); + }); + +## insertCSS + +> Injects CSS into the `InAppBrowser` window. + + ref.insertCSS(details, callback); + +- __ref__: reference to the `InAppBrowser` window _(InAppBrowser)_ + +- __injectDetails__: details of the script to run, specifying either a `file` or `code` key. _(Object)_ + - __file__: URL of the stylesheet to inject. + - __code__: Text of the stylesheet to inject. + +- __callback__: the function that executes after the CSS is injected. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS + +### Quick Example + + var ref = window.open('http://apache.org', '_blank', 'location=yes'); + ref.addEventListener('loadstop', function() { + ref.insertCSS({file: "mystyles.css"}); + }); + diff --git a/docs/jp/3.4.0/cordova/media-capture/index.md b/docs/jp/3.4.0/cordova/media-capture/index.md new file mode 100644 index 0000000000..8a29718e96 --- /dev/null +++ b/docs/jp/3.4.0/cordova/media-capture/index.md @@ -0,0 +1,597 @@ + + +# org.apache.cordova.media-capture + +This plugin provides access to the device's audio, image, and video capture capabilities. + +__WARNING__: Collection and use of images, video, or +audio from the device's camera or microphone raises important privacy +issues. Your app's privacy policy should discuss how the app uses +such sensors and whether the data recorded is shared with any other +parties. In addition, if the app's use of the camera or microphone is +not apparent in the user interface, you should provide a just-in-time +notice before the app accesses the camera or microphone (if the +device operating system doesn't do so already). That notice should +provide the same information noted above, as well as obtaining the +user's permission (e.g., by presenting choices for __OK__ and __No +Thanks__). Note that some app marketplaces may require your app to +provide just-in-time notice and obtain permission from the user prior +to accessing the camera or microphone. For more information, please +see the Privacy Guide. + +## Installation + + cordova plugin add org.apache.cordova.media-capture + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +## Objects + +- Capture +- CaptureAudioOptions +- CaptureImageOptions +- CaptureVideoOptions +- CaptureCallback +- CaptureErrorCB +- ConfigurationData +- MediaFile +- MediaFileData + +## Methods + +- capture.captureAudio +- capture.captureImage +- capture.captureVideo +- MediaFile.getFormatData + +## Properties + +- __supportedAudioModes__: The audio recording formats supported by the device. (ConfigurationData[]) + +- __supportedImageModes__: The recording image sizes and formats supported by the device. (ConfigurationData[]) + +- __supportedVideoModes__: The recording video resolutions and formats supported by the device. (ConfigurationData[]) + +## capture.captureAudio + +> Start the audio recorder application and return information about captured audio clip files. + + navigator.device.capture.captureAudio( + CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options] + ); + +### Description + +Starts an asynchronous operation to capture audio recordings using the +device's default audio recording application. The operation allows +the device user to capture multiple recordings in a single session. + +The capture operation ends when either the user exits the audio +recording application, or the maximum number of recordings specified +by `CaptureAudioOptions.limit` is reached. If no `limit` parameter +value is specified, it defaults to one (1), and the capture operation +terminates after the user records a single audio clip. + +When the capture operation finishes, the `CaptureCallback` executes +with an array of `MediaFile` objects describing each captured audio +clip file. If the user terminates the operation before an audio clip +is captured, the `CaptureErrorCallback` executes with a `CaptureError` +object, featuring the `CaptureError.CAPTURE_NO_MEDIA_FILES` error +code. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Example + + // capture callback + var captureSuccess = function(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // do something interesting with the file + } + }; + + // capture error callback + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + + // start audio capture + navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2}); + + +### BlackBerry 10 Quirks + +- Cordova for BlackBerry 10 attempts to launch the __Voice Notes Recorder__ application, provided by RIM, to capture audio recordings. The app receives a `CaptureError.CAPTURE_NOT_SUPPORTED` error code if the application is not installed on the device. + +### iOS Quirks + +- iOS does not have a default audio recording application, so a simple user interface is provided. + +### Windows Phone 7 and 8 Quirks + +- Windows Phone 7 does not have a default audio recording application, so a simple user interface is provided. + +## CaptureAudioOptions + +> Encapsulates audio capture configuration options. + +### Properties + +- __limit__: The maximum number of audio clips the device user can record in a single capture operation. The value must be greater than or equal to 1 (defaults to 1). + +- __duration__: The maximum duration of an audio sound clip, in seconds. + +### Example + + // limit capture operation to 3 media files, no longer than 10 seconds each + var options = { limit: 3, duration: 10 }; + + navigator.device.capture.captureAudio(captureSuccess, captureError, options); + +### Amazon Fire OS Quirks + +- The `duration` parameter is not supported. Recording lengths cannot be limited programmatically. + +### Android Quirks + +- The `duration` parameter is not supported. Recording lengths can't be limited programmatically. + +### BlackBerry 10 Quirks + +- The `duration` parameter is not supported. Recording lengths can't be limited programmatically. + +### iOS Quirks + +- The `limit` parameter is not supported, so only one recording can be created for each invocation. + +## capture.captureImage + +> Start the camera application and return information about captured image files. + + navigator.device.capture.captureImage( + CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options] + ); + +### Description + +Starts an asynchronous operation to capture images using the device's +camera application. The operation allows users to capture more than +one image in a single session. + +The capture operation ends either when the user closes the camera +application, or the maximum number of recordings specified by +`CaptureAudioOptions.limit` is reached. If no `limit` value is +specified, it defaults to one (1), and the capture operation +terminates after the user captures a single image. + +When the capture operation finishes, it invokes the `CaptureCB` +callback with an array of `MediaFile` objects describing each captured +image file. If the user terminates the operation before capturing an +image, the `CaptureErrorCB` callback executes with a `CaptureError` +object featuring a `CaptureError.CAPTURE_NO_MEDIA_FILES` error code. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Windows Phone 7 Quirks + +Invoking the native camera application while your device is connected +via Zune does not work, and the error callback executes. + +### Example + + // capture callback + var captureSuccess = function(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // do something interesting with the file + } + }; + + // capture error callback + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + + // start image capture + navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2}); + + + +## CaptureImageOptions + +> Encapsulates image capture configuration options. + +### Properties + +- __limit__: The maximum number of images the user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1). + +### Example + + // limit capture operation to 3 images + var options = { limit: 3 }; + + navigator.device.capture.captureImage(captureSuccess, captureError, options); + +### iOS Quirks + +- The __limit__ parameter is not supported, and only one image is taken per invocation. + +## capture.captureVideo + +> Start the video recorder application and return information about captured video clip files. + + navigator.device.capture.captureVideo( + CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options] + ); + +### Description + +Starts an asynchronous operation to capture video recordings using the +device's video recording application. The operation allows the user +to capture more than one recordings in a single session. + +The capture operation ends when either the user exits the video +recording application, or the maximum number of recordings specified +by `CaptureVideoOptions.limit` is reached. If no `limit` parameter +value is specified, it defaults to one (1), and the capture operation +terminates after the user records a single video clip. + +When the capture operation finishes, it the `CaptureCB` callback +executes with an array of `MediaFile` objects describing each captured +video clip file. If the user terminates the operation before +capturing a video clip, the `CaptureErrorCB` callback executes with a +`CaptureError` object featuring a +`CaptureError.CAPTURE_NO_MEDIA_FILES` error code. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Example + + // capture callback + var captureSuccess = function(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // do something interesting with the file + } + }; + + // capture error callback + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + + // start video capture + navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2}); + + +### BlackBerry 10 Quirks + +- Cordova for BlackBerry 10 attempts to launch the __Video Recorder__ application, provided by RIM, to capture video recordings. The app receives a `CaptureError.CAPTURE_NOT_SUPPORTED` error code if the application is not installed on the device. + + +## CaptureVideoOptions + +> Encapsulates video capture configuration options. + +### Properties + +- __limit__: The maximum number of video clips the device's user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1). + +- __duration__: The maximum duration of a video clip, in seconds. + +### Example + + // limit capture operation to 3 video clips + var options = { limit: 3 }; + + navigator.device.capture.captureVideo(captureSuccess, captureError, options); + +### BlackBerry 10 Quirks + +- The __duration__ parameter is not supported, so the length of recordings can't be limited programmatically. + +### iOS Quirks + +- The __limit__ parameter is not supported. Only one video is recorded per invocation. + + +## CaptureCB + +> Invoked upon a successful media capture operation. + + function captureSuccess( MediaFile[] mediaFiles ) { ... }; + +### Description + +This function executes after a successful capture operation completes. +At this point a media file has been captured, and either the user has +exited the media capture application, or the capture limit has been +reached. + +Each `MediaFile` object describes a captured media file. + +### Example + + // capture callback + function captureSuccess(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // do something interesting with the file + } + }; + +## CaptureError + +> Encapsulates the error code resulting from a failed media capture operation. + +### Properties + +- __code__: One of the pre-defined error codes listed below. + +### Constants + +- `CaptureError.CAPTURE_INTERNAL_ERR`: The camera or microphone failed to capture image or sound. + +- `CaptureError.CAPTURE_APPLICATION_BUSY`: The camera or audio capture application is currently serving another capture request. + +- `CaptureError.CAPTURE_INVALID_ARGUMENT`: Invalid use of the API (e.g., the value of `limit` is less than one). + +- `CaptureError.CAPTURE_NO_MEDIA_FILES`: The user exits the camera or audio capture application before capturing anything. + +- `CaptureError.CAPTURE_NOT_SUPPORTED`: The requested capture operation is not supported. + +## CaptureErrorCB + +> Invoked if an error occurs during a media capture operation. + + function captureError( CaptureError error ) { ... }; + +### Description + +This function executes if an error occurs when trying to launch a +media capture operation. Failure scenarios include when the capture +application is busy, a capture operation is already taking place, or +the user cancels the operation before any media files are captured. + +This function executes with a `CaptureError` object containing an +appropriate error `code`. + +### Example + + // capture error callback + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + +## ConfigurationData + +> Encapsulates a set of media capture parameters that a device supports. + +### Description + +Describes media capture modes supported by the device. The +configuration data includes the MIME type, and capture dimensions for +video or image capture. + +The MIME types should adhere to [RFC2046](http://www.ietf.org/rfc/rfc2046.txt). Examples: + +- `video/3gpp` +- `video/quicktime` +- `image/jpeg` +- `audio/amr` +- `audio/wav` + +### Properties + +- __type__: The ASCII-encoded lowercase string representing the media type. (DOMString) + +- __height__: The height of the image or video in pixels. The value is zero for sound clips. (Number) + +- __width__: The width of the image or video in pixels. The value is zero for sound clips. (Number) + +### Example + + // retrieve supported image modes + var imageModes = navigator.device.capture.supportedImageModes; + + // Select mode that has the highest horizontal resolution + var width = 0; + var selectedmode; + for each (var mode in imageModes) { + if (mode.width > width) { + width = mode.width; + selectedmode = mode; + } + } + +Not supported by any platform. All configuration data arrays are empty. + +## MediaFile.getFormatData + +> Retrieves format information about the media capture file. + + mediaFile.getFormatData( + MediaFileDataSuccessCB successCallback, + [MediaFileDataErrorCB errorCallback] + ); + +### Description + +This function asynchronously attempts to retrieve the format +information for the media file. If successful, it invokes the +`MediaFileDataSuccessCB` callback with a `MediaFileData` object. If +the attempt fails, this function invokes the `MediaFileDataErrorCB` +callback. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Amazon Fire OS Quirks + +The API to access media file format information is limited, so not all +`MediaFileData` properties are supported. + +### BlackBerry 10 Quirks + +Does not provide an API for information about media files, so all +`MediaFileData` objects return with default values. + +### Android Quirks + +The API to access media file format information is limited, so not all +`MediaFileData` properties are supported. + +### iOS Quirks + +The API to access media file format information is limited, so not all +`MediaFileData` properties are supported. + +## MediaFile + +> Encapsulates properties of a media capture file. + +### Properties + +- __name__: The name of the file, without path information. (DOMString) + +- __fullPath__: The full path of the file, including the name. (DOMString) + +- __type__: The file's mime type (DOMString) + +- __lastModifiedDate__: The date and time when the file was last modified. (Date) + +- __size__: The size of the file, in bytes. (Number) + +### Methods + +- __MediaFile.getFormatData__: Retrieves the format information of the media file. + +## MediaFileData + +> Encapsulates format information about a media file. + +### Properties + +- __codecs__: The actual format of the audio and video content. (DOMString) + +- __bitrate__: The average bitrate of the content. The value is zero for images. (Number) + +- __height__: The height of the image or video in pixels. The value is zero for audio clips. (Number) + +- __width__: The width of the image or video in pixels. The value is zero for audio clips. (Number) + +- __duration__: The length of the video or sound clip in seconds. The value is zero for images. (Number) + +### BlackBerry 10 Quirks + +No API provides format information for media files, so the +`MediaFileData` object returned by `MediaFile.getFormatData` features +the following default values: + +- __codecs__: Not supported, and returns `null`. + +- __bitrate__: Not supported, and returns zero. + +- __height__: Not supported, and returns zero. + +- __width__: Not supported, and returns zero. + +- __duration__: Not supported, and returns zero. + +### Amazon Fire OS Quirks + +Supports the following `MediaFileData` properties: + +- __codecs__: Not supported, and returns `null`. + +- __bitrate__: Not supported, and returns zero. + +- __height__: Supported: image and video files only. + +- __width__: Supported: image and video files only. + +- __duration__: Supported: audio and video files only + +### Android Quirks + +Supports the following `MediaFileData` properties: + +- __codecs__: Not supported, and returns `null`. + +- __bitrate__: Not supported, and returns zero. + +- __height__: Supported: image and video files only. + +- __width__: Supported: image and video files only. + +- __duration__: Supported: audio and video files only. + +### iOS Quirks + +Supports the following `MediaFileData` properties: + +- __codecs__: Not supported, and returns `null`. + +- __bitrate__: Supported on iOS4 devices for audio only. Returns zero for images and videos. + +- __height__: Supported: image and video files only. + +- __width__: Supported: image and video files only. + +- __duration__: Supported: audio and video files only. diff --git a/docs/jp/3.4.0/cordova/media/index.md b/docs/jp/3.4.0/cordova/media/index.md new file mode 100644 index 0000000000..12957eb59e --- /dev/null +++ b/docs/jp/3.4.0/cordova/media/index.md @@ -0,0 +1,492 @@ + + +# org.apache.cordova.media + +This plugin provides the ability to record and play back audio files on a device. + +__NOTE__: The current implementation does not adhere to a W3C +specification for media capture, and is provided for convenience only. +A future implementation will adhere to the latest W3C specification +and may deprecate the current APIs. + +## Installation + + cordova plugin add org.apache.cordova.media + +## Supported Platforms + +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Tizen +- Windows 8 + +## Windows Phone Quirks + +- Only one media file can be played back at a time. + +- There are strict restrictions on how your application interacts with other media. See the [Microsoft documentation for details][url]. + +[url]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh184838(v=vs.92).aspx + +## Media + + var media = new Media(src, mediaSuccess, [mediaError], [mediaStatus]); + +### Parameters + +- __src__: A URI containing the audio content. _(DOMString)_ + +- __mediaSuccess__: (Optional) The callback that executes after a `Media` object has completed the current play, record, or stop action. _(Function)_ + +- __mediaError__: (Optional) The callback that executes if an error occurs. _(Function)_ + +- __mediaStatus__: (Optional) The callback that executes to indicate status changes. _(Function)_ + +### Constants + +The following constants are reported as the only parameter to the +`mediaStatus` callback: + +- `Media.MEDIA_NONE` = 0; +- `Media.MEDIA_STARTING` = 1; +- `Media.MEDIA_RUNNING` = 2; +- `Media.MEDIA_PAUSED` = 3; +- `Media.MEDIA_STOPPED` = 4; + +### Methods + +- `media.getCurrentPosition`: Returns the current position within an audio file. + +- `media.getDuration`: Returns the duration of an audio file. + +- `media.play`: Start or resume playing an audio file. + +- `media.pause`: Pause playback of an audio file. + +- `media.release`: Releases the underlying operating system's audio resources. + +- `media.seekTo`: Moves the position within the audio file. + +- `media.setVolume`: Set the volume for audio playback. + +- `media.startRecord`: Start recording an audio file. + +- `media.stopRecord`: Stop recording an audio file. + +- `media.stop`: Stop playing an audio file. + +### Additional ReadOnly Parameters + +- __position__: The position within the audio playback, in seconds. + - Not automatically updated during play; call `getCurrentPosition` to update. + +- __duration__: The duration of the media, in seconds. + + +## media.getCurrentPosition + +Returns the current position within an audio file. Also updates the `Media` object's `position` parameter. + + media.getCurrentPosition(mediaSuccess, [mediaError]); + +### Parameters + +- __mediaSuccess__: The callback that is passed the current position in seconds. + +- __mediaError__: (Optional) The callback to execute if an error occurs. + +### Quick Example + + // Audio player + // + var my_media = new Media(src, onSuccess, onError); + + // Update media position every second + var mediaTimer = setInterval(function () { + // get media position + my_media.getCurrentPosition( + // success callback + function (position) { + if (position > -1) { + console.log((position) + " sec"); + } + }, + // error callback + function (e) { + console.log("Error getting pos=" + e); + } + ); + }, 1000); + + +## media.getDuration + +Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1. + + + media.getDuration(); + +### Quick Example + + // Audio player + // + var my_media = new Media(src, onSuccess, onError); + + // Get duration + var counter = 0; + var timerDur = setInterval(function() { + counter = counter + 100; + if (counter > 2000) { + clearInterval(timerDur); + } + var dur = my_media.getDuration(); + if (dur > 0) { + clearInterval(timerDur); + document.getElementById('audio_duration').innerHTML = (dur) + " sec"; + } + }, 100); + + +## media.pause + +Pauses playing an audio file. + + media.pause(); + + +### Quick Example + + // Play audio + // + function playAudio(url) { + // Play the audio file at url + var my_media = new Media(url, + // success callback + function () { console.log("playAudio():Audio Success"); }, + // error callback + function (err) { console.log("playAudio():Audio Error: " + err); } + ); + + // Play audio + my_media.play(); + + // Pause after 10 seconds + setTimeout(function () { + media.pause(); + }, 10000); + } + + +## media.play + +Starts or resumes playing an audio file. + + media.play(); + + +### Quick Example + + // Play audio + // + function playAudio(url) { + // Play the audio file at url + var my_media = new Media(url, + // success callback + function () { + console.log("playAudio():Audio Success"); + }, + // error callback + function (err) { + console.log("playAudio():Audio Error: " + err); + } + ); + // Play audio + my_media.play(); + } + + +### iOS Quirks + +- __numberOfLoops__: Pass this option to the `play` method to specify + the number of times you want the media file to play, e.g.: + + var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3") + myMedia.play({ numberOfLoops: 2 }) + +- __playAudioWhenScreenIsLocked__: Pass in this option to the `play` + method to specify whether you want to allow playback when the screen + is locked. If set to `true` (the default value), the state of the + hardware mute button is ignored, e.g.: + + var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3") + myMedia.play({ playAudioWhenScreenIsLocked : false }) + +- __order of file search__: When only a file name or simple path is + provided, iOS searches in the `www` directory for the file, then in + the application's `documents/tmp` directory: + + var myMedia = new Media("audio/beer.mp3") + myMedia.play() // first looks for file in www/audio/beer.mp3 then in /documents/tmp/audio/beer.mp3 + +## media.release + +Releases the underlying operating system's audio resources. +This is particularly important for Android, since there are a finite amount of +OpenCore instances for media playback. Applications should call the `release` +function for any `Media` resource that is no longer needed. + + media.release(); + + +### Quick Example + + // Audio player + // + var my_media = new Media(src, onSuccess, onError); + + my_media.play(); + my_media.stop(); + my_media.release(); + + +## media.seekTo + +Sets the current position within an audio file. + + media.seekTo(milliseconds); + +### Parameters + +- __milliseconds__: The position to set the playback position within the audio, in milliseconds. + + +### Quick Example + + // Audio player + // + var my_media = new Media(src, onSuccess, onError); + my_media.play(); + // SeekTo to 10 seconds after 5 seconds + setTimeout(function() { + my_media.seekTo(10000); + }, 5000); + + +### BlackBerry 10 Quirks + +- Not supported on BlackBerry OS 5 devices. + +## media.setVolume + +Set the volume for an audio file. + + media.setVolume(volume); + +### Parameters + +- __volume__: The volume to set for playback. The value must be within the range of 0.0 to 1.0. + +### Supported Platforms + +- Android +- iOS + +### Quick Example + + // Play audio + // + function playAudio(url) { + // Play the audio file at url + var my_media = new Media(url, + // success callback + function() { + console.log("playAudio():Audio Success"); + }, + // error callback + function(err) { + console.log("playAudio():Audio Error: "+err); + }); + + // Play audio + my_media.play(); + + // Mute volume after 2 seconds + setTimeout(function() { + my_media.setVolume('0.0'); + }, 2000); + + // Set volume to 1.0 after 5 seconds + setTimeout(function() { + my_media.setVolume('1.0'); + }, 5000); + } + + +## media.startRecord + +Starts recording an audio file. + + media.startRecord(); + +### Supported Platforms + +- Android +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Quick Example + + // Record audio + // + function recordAudio() { + var src = "myrecording.mp3"; + var mediaRec = new Media(src, + // success callback + function() { + console.log("recordAudio():Audio Success"); + }, + + // error callback + function(err) { + console.log("recordAudio():Audio Error: "+ err.code); + }); + + // Record audio + mediaRec.startRecord(); + } + + +### Android Quirks + +- Android devices record audio in Adaptive Multi-Rate format. The specified file should end with a _.amr_ extension. + +### iOS Quirks + +- iOS only records to files of type _.wav_ and returns an error if the file name extension is not correct. + +- If a full path is not provided, the recording is placed in the application's `documents/tmp` directory. This can be accessed via the `File` API using `LocalFileSystem.TEMPORARY`. Any subdirectory specified at record time must already exist. + +- Files can be recorded and played back using the documents URI: + + var myMedia = new Media("documents://beer.mp3") + +### Tizen Quirks + +- Not supported on Tizen devices. + +## media.stop + +Stops playing an audio file. + + media.stop(); + +### Quick Example + + // Play audio + // + function playAudio(url) { + // Play the audio file at url + var my_media = new Media(url, + // success callback + function() { + console.log("playAudio():Audio Success"); + }, + // error callback + function(err) { + console.log("playAudio():Audio Error: "+err); + } + ); + + // Play audio + my_media.play(); + + // Pause after 10 seconds + setTimeout(function() { + my_media.stop(); + }, 10000); + } + + +## media.stopRecord + +Stops recording an audio file. + + media.stopRecord(); + +### Supported Platforms + +- Android +- iOS +- Windows Phone 7 and 8 +- Windows 8 + +### Quick Example + + // Record audio + // + function recordAudio() { + var src = "myrecording.mp3"; + var mediaRec = new Media(src, + // success callback + function() { + console.log("recordAudio():Audio Success"); + }, + + // error callback + function(err) { + console.log("recordAudio():Audio Error: "+ err.code); + } + ); + + // Record audio + mediaRec.startRecord(); + + // Stop recording after 10 seconds + setTimeout(function() { + mediaRec.stopRecord(); + }, 10000); + } + + +### Tizen Quirks + +- Not supported on Tizen devices. + +## MediaError + +A `MediaError` object is returned to the `mediaError` callback +function when an error occurs. + +### Properties + +- __code__: One of the predefined error codes listed below. + +- __message__: An error message describing the details of the error. + +### Constants + +- `MediaError.MEDIA_ERR_ABORTED` +- `MediaError.MEDIA_ERR_NETWORK` +- `MediaError.MEDIA_ERR_DECODE` +- `MediaError.MEDIA_ERR_NONE_SUPPORTED` + diff --git a/docs/jp/3.4.0/cordova/plugins/pluginapis.md b/docs/jp/3.4.0/cordova/plugins/pluginapis.md new file mode 100644 index 0000000000..20733212ba --- /dev/null +++ b/docs/jp/3.4.0/cordova/plugins/pluginapis.md @@ -0,0 +1,80 @@ +--- +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. +--- + +# Plugin APIs + +Cordova ships with a minimal set of APIs, and projects add what extra APIs they require through plugins. + +You can search through all existing plugins using the [Plugin Registry](http://plugins.cordova.io/). + +The traditional set of Cordova plugins are as follows: + +- [Battery Status](https://github.com/apache/cordova-plugin-battery-status/blob/dev/doc/index.md) +> Monitor the status of the device's battery. + +- [Camera](https://github.com/apache/cordova-plugin-camera/blob/dev/doc/index.md) +> Capture a photo using the device's camera. + +- [Contacts](https://github.com/apache/cordova-plugin-contacts/blob/dev/doc/index.md) +> Work with the devices contact database. + +- [Device](https://github.com/apache/cordova-plugin-device/blob/dev/doc/index.md) +> Gather device specific information. + +- [Device Motion (Accelerometer)](https://github.com/apache/cordova-plugin-device-motion/blob/dev/doc/index.md) +> Tap into the device's motion sensor. + +- [Device Orientation (Compass)](https://github.com/apache/cordova-plugin-device-orientation/blob/dev/doc/index.md) +> Obtain the direction that the device is pointing. + +- [Dialogs](https://github.com/apache/cordova-plugin-dialogs/blob/dev/doc/index.md) +> Visual device notifications. + +- [FileSystem](https://github.com/apache/cordova-plugin-file/blob/dev/doc/index.md) +> Hook into native file system through JavaScript. + +- [File Transfer](https://github.com/apache/cordova-plugin-file-transfer/blob/dev/doc/index.md) +> Hook into native file system through JavaScript. + +- [Geolocation](https://github.com/apache/cordova-plugin-geolocation/blob/dev/doc/index.md) +> Make your application location aware. + +- [Globalization](https://github.com/apache/cordova-plugin-globalization/blob/dev/doc/index.md) +> Enable representation of objects specific to a locale. + +- [InAppBrowser](https://github.com/apache/cordova-plugin-inappbrowser/blob/dev/doc/index.md) +> Launch URLs in another in-app browser instance. + +- [Media](https://github.com/apache/cordova-plugin-media/blob/dev/doc/index.md) +> Record and play back audio files. + +- [Media Capture](https://github.com/apache/cordova-plugin-media-capture/blob/dev/doc/index.md) +> Capture media files using device's media capture applications. + +- [Network Information (Connection)](https://github.com/apache/cordova-plugin-network-information/blob/dev/doc/index.md) +> Quickly check the network state, and cellular network information. + +- [Splashscreen](https://github.com/apache/cordova-plugin-splashscreen/blob/dev/doc/index.md) +> Show and hide the applications splash screen. + +- [Vibration](https://github.com/apache/cordova-plugin-vibration/blob/dev/doc/index.md) +> An API to vibrate the device. + +Non-English translations of these plugin docs can be found by looking at older versions of the Cordova documentation. Use the drop-down menu at the very top-right of this site to switch versions. + diff --git a/docs/jp/3.4.0/cordova/splashscreen/index.md b/docs/jp/3.4.0/cordova/splashscreen/index.md new file mode 100644 index 0000000000..c39bee71f5 --- /dev/null +++ b/docs/jp/3.4.0/cordova/splashscreen/index.md @@ -0,0 +1,94 @@ + + +# org.apache.cordova.splashscreen + +This plugin displays and hides a splash screen during application launch. + +## Installation + + cordova plugin add org.apache.cordova.splashscreen + + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 + + +## Methods + +- splashscreen.show +- splashscreen.hide + +### Android Quirks + +In your config.xml, you need to add the following preference + +`` + +Where foo is the name of the splashscreen file. Preferably a 9 patch file. Make sure to add your splashcreen files to your res/xml directory under the appropriate folders. + +For Android, you also have to edit your projects main java file. You must add a second parameter representing a time delay to your super.loadUrl. + +`super.loadUrl(Config.getStartUrl(), 10000);` + +## splashscreen.hide + +Dismiss the splash screen. + + navigator.splashscreen.hide(); + + +### BlackBerry 10 Quirk + +The `config.xml` file's `AutoHideSplashScreen` setting must be `false`. + +### iOS Quirk + +The `config.xml` file's `AutoHideSplashScreen` setting must be +`false`. To delay hiding the splash screen for two seconds, add a +timer such as the following in the `deviceready` event handler: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + +## splashscreen.show + +Displays the splash screen. + + navigator.splashscreen.show(); + + +Your application cannot call `navigator.splashscreen.show()` until the app has +started and the `deviceready` event has fired. But since typically the splash +screen is meant to be visible before your app has started, that would seem to +defeat the purpose of the splash screen. Providing some configuration in +`config.xml` will automatically `show` the splash screen immediately after your +app launch and before it has fully started and received the `deviceready` +event. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) +for more information on doing this configuration. For this reason, it is +unlikely you need to call `navigator.splashscreen.show()` to make the splash +screen visible for app startup. + diff --git a/docs/jp/3.4.0/cordova/storage/storage.md b/docs/jp/3.4.0/cordova/storage/storage.md new file mode 100644 index 0000000000..dac5c71c13 --- /dev/null +++ b/docs/jp/3.4.0/cordova/storage/storage.md @@ -0,0 +1,70 @@ +--- +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. +--- + +# Storage + +> An overview of storage options for Cordova. + +Several storage APIs are available for Cordova applications. +See +[html5rocks](http://www.html5rocks.com/en/features/storage). +for a more complete overview and examples. + +## LocalStorage + +Also known as _web storage_, _simple storage_, or by its alternate +_session storage_ interface, this API provides synchronous key/value +pair storage, and is available in underlying WebView implementations. +Refer to [the W3C spec](http://www.w3.org/TR/webstorage/) for details. + +__Windows Phone 7 Quirk__: Dot notation is _not_ available, so be sure +to use `setItem` or `getItem` rather than access keys directly from +the storage object, as in `window.localStorage.someKey`. + +## WebSQL + +This API is available in the underlying WebView. +The [Web SQL Database Specification](http://dev.w3.org/html5/webdatabase/) +offers more full-featured database tables accessed via SQL queries. + +The following platforms support WebSQL: + +- Android +- BlackBerry 10 +- iOS +- Tizen + +## IndexedDB + +This API is available in the underlying WebView. +[Indexed DB](http://www.w3.org/TR/IndexedDB/) offers more features +than LocalStorage but fewer than WebSQL. + +The following platforms support IndexedDB: + +- Windows Phone 8 +- BlackBerry 10 + +## Plugin-Based Options + +In addition to the storage APIs listed above, the +[File API](https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md) +allows you to cache data on the local file system. Other +[Cordova plugins](http://plugins.cordova.io/) provide similar storage options. + diff --git a/docs/jp/3.4.0/cordova/vibration/index.md b/docs/jp/3.4.0/cordova/vibration/index.md new file mode 100644 index 0000000000..fd557f9820 --- /dev/null +++ b/docs/jp/3.4.0/cordova/vibration/index.md @@ -0,0 +1,57 @@ + + +# org.apache.cordova.vibration + +This plugin provides a way to vibrate the device. + +## Installation + + cordova plugin add org.apache.cordova.vibration + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Firefox OS +- iOS +- Windows Phone 7 and 8 + +## notification.vibrate + +Vibrates the device for the specified amount of time. + + navigator.notification.vibrate(time) + +- __time__: Milliseconds to vibrate the device. _(Number)_ + + +## Example + + // Vibrate for 2.5 seconds + navigator.notification.vibrate(2500); + + +## iOS Quirks + +- __time__: Ignores the specified time and vibrates for a pre-set amount of time. + + navigator.notification.vibrate(); + navigator.notification.vibrate(2500); // 2500 is ignored diff --git a/docs/jp/3.4.0/guide/appdev/privacy/index.md b/docs/jp/3.4.0/guide/appdev/privacy/index.md new file mode 100644 index 0000000000..601ee3828a --- /dev/null +++ b/docs/jp/3.4.0/guide/appdev/privacy/index.md @@ -0,0 +1,117 @@ +--- +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. +--- + +# Privacy Guide + +Mobile privacy is a critical issue that every app developer must +address. Your users expect that their private information will be +collected and treated appropriately by your app. Also, there are an +increasing number of jurisdictions that now have legal requirements +regarding mobile privacy practices. + +This guide on mobile app privacy should be considered a _primer_ +addressing some the most significant issues. It outlines some broadly +accepted best practices and provides references to other more detailed +guides and references. + +* __Privacy Policy__: You app should include a privacy policy that + addresses topics such as what kind of information your app collects + from or about your users, how that information is used, with whom it + is shared, and how users can make privacy-related choices within the + app. To aid understanding, you should use plain language and avoid + technical jargon. You should make your privacy policy available for + users to review prior to download, such as in the app description in + the app marketplace. In addition, you should make your privacy + policy available within the app itself. The limited size of mobile + device displays creates challenges for displaying privacy policies + to users. Consider developing a _short form_ of the policy that + includes the most important information, and then provide a link to + the "long form" policy for those interested in more details. Several + groups are attempting to develop icon-based standards for + communicating privacy practices, which you may want to consider once + these standards mature. + +* __Collection of sensitive information__: An app's collection of + sensitive personal information raises important privacy concerns. + Examples of sensitive personal information include financial + information, health information, and information from or about + children. It also includes information gathered from certain sensors + and databases typically found on mobile devices and tablets, such as + geolocation information, contacts/phonebook, microphone/camera, and + stored pictures/videos. See the following documentation pages for + more information: [camera](cordova_camera_camera.md.html), + [capture](cordova_media_capture_capture.md.html), + [contacts](cordova_contacts_contacts.md.html), and + [geolocation](cordova_geolocation_geolocation.md.html). Generally, + you should obtain a user's express permission before collecting + sensitive information and, if possible, provide a control mechanism + that allows a user to easily change permissions. App operating + systems can help in some instances by presenting just-in-time dialog + boxes that ask for the user's permission before collection. In these + cases, be sure to take advantage of any opportunity to customize the + dialog box text to clarify how the app uses and, if applicable, + shares such information. + +* __Avoiding user surprise__: If your app collects or uses information + in a way that may be surprising to users in light of the primary + purpose of your app (for example, a music player that accesses + stored pictures), you should take similar steps as with the + collection of sensitive personal information. That is, you should + strongly consider the use of just-in-time dialog boxes to inform the + user about the collection or use of that information and, if + appropriate, provide a corresponding privacy control. + +* __Third party data collection or sharing__: If you app collects + information that is provided to another company--such as a social + networking platform or an ad network (for example, if your app + displays advertising)--you should inform your users of that + collection and sharing. At a minimum, your privacy policy should + describe the information collection and sharing and, if appropriate, + offer your users the ability to control or opt-out of such + collection or sharing. + +* __Collection limitation and security__: Your users entrust your app + with their information and they expect that you will take + appropriate security precautions to protect it. One of the best ways + to avoid security compromises of personal information is not to + collect the information in the first place unless your app has a + specific and legitimate business reason for the collection. For + information that does need to be collected, ensure that you provide + appropriate security controls to protect that information, whether + it is stored on the device or on your backend servers. You should + also develop an appropriate data retention policy that is + implemented within the app and on your backend servers. + +Following are some additional helpful mobile privacy guides for developers: + +* California Attorney General, [Privacy on the Go: Recommendations for the Mobile Ecosystem][1] + +* Center for Democracy & Technology, Future of Privacy Forum, [Best Practices for Mobile App Developers][2] + +* CTIA-The Wireless Association, [Best Practices and Guidelines for Location Based Services][3] + +* Federal Trade Commission, [Mobile Privacy Disclosures: Building Trust Through Transparency][4] + +* Future of Privacy Forum, [Application Privacy][5] Website + +[1]: http://oag.ca.gov/sites/all/files/pdfs/privacy/privacy_on_the_go.pdf +[2]: http://www.futureofprivacy.org/wp-content/uploads/Best-Practices-for-Mobile-App-Developers_Final.pdf +[3]: http://www.ctia.org/business_resources/wic/index.cfm/AID/11300 +[4]: http://www.ftc.gov/os/2013/02/130201mobileprivacyreport.pdf +[5]: http://www.applicationprivacy.org diff --git a/docs/jp/3.4.0/guide/appdev/whitelist/index.md b/docs/jp/3.4.0/guide/appdev/whitelist/index.md new file mode 100644 index 0000000000..4e5e484bab --- /dev/null +++ b/docs/jp/3.4.0/guide/appdev/whitelist/index.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. +--- + +# Whitelist Guide + +Domain whitelisting is a security model that controls access to +external domains over which you application has no control. Cordova's +default security policy allows access to any site. Before moving your +application to production, you should formulate a whitelist and allow +access to specific network domains and subdomains. + +Cordova adheres to the [W3C Widget Access][1] specification, which +relies on the `` element within the app's `config.xml` file to +enable network access to specific domains. For projects that rely on +the CLI workflow described in The Command-Line Interface, this file is +located in the project's top-level directory. Otherwise for +platform-specific development paths, locations are listed in the +sections below. (See the various Platform Guides for more information +on each platform.) + +The following examples demonstrate whitelist syntax: + +* Access to [google.com][2]: + + + +* Access to the secure [google.com][3] (`https://`): + + + +* Access to the subdomain [maps.google.com][4]: + + + +* Access to all the subdomains on [google.com][2], for example + [mail.google.com][5] and [docs.google.com][6]: + + + +* Access to _all_ domains, for example, [google.com][2] and + [developer.mozilla.org][7]: + + + + This is the default value for newly created CLI projects. + +## Amazon Fire OS Whitelisting + +Platform-specific whitelisting rules are found in +`res/xml/config.xml`. + +## Android Whitelisting + +Platform-specific whitelisting rules are found in +`res/xml/config.xml`. + +__NOTE__: On Android 2.3 and before, domain whitelisting only works +for `href` hyperlinks, not referenced resources such as images and +scripts. Take steps to avoid scripts from being injected into the +application. + +Navigating to non-whitelisted domains via `href` hyperlink causes the +page to open in the default browser rather than within the +application. (Compare this to iOS's behavior noted below.) + +## iOS Whitelisting + +The platform's whitelisting rules are found in the named application +directory's `config.xml` file. + +Origins specified without a protocol, such as `www.apache.org` rather +than `http://www.apache.org`, default to all of the `http`, `https`, +`ftp`, and `ftps` schemes. + +Wildcards on the iOS platform are more flexible than in the [W3C +Widget Access][1] specification. For example, the following accesses +all subdomains and top-level domains such as `.com` and `.net`: + + + +Unlike the Android platform noted above, navigating to non-whitelisted +domains via `href` hyperlink on iOS prevents the page from opening at +all. + +## BlackBerry 10 Whitelisting + +The whitelisting rules are found in `www/config.xml`. + +BlackBerry 10's use of wildcards differs from other platforms in two +ways: + +* Any content accessed by `XMLHttpRequest` must be declared + explicitly. Setting `origin="*"` does not work in this case. + Alternatively, all web security may be disabled using the + `WebSecurity` preference described in BlackBerry Configuration: + + + +* As an alternative to setting `*.domain`, set an additional + `subdomains` attribute to `true`. It should be set to `false` by + default. For example, the following allows access to `google.com`, + `maps.google.com`, and `docs.google.com`: + + + + The following narrows access to `google.com`: + + + + Specify access to all domains, including the local `file://` + protocol: + + + +(For more information on support, see BlackBerry's documentation on the +[access element][8].) + +## iOS Changes in 3.1.0 + +Prior to version 3.1.0, Cordova-iOS included some non-standard extensions to the domain whitelisting scheme supported by other Cordova platforms. As of 3.1.0, the iOS whitelist now conforms to the resource whitelist syntax described at the top of this document. If you upgrade from pre-3.1.0, and you were using these extensions, you may have to change your `config.xml` file in order to continue whitelisting the same set of resources as before. + +Specifically, these patterns need to be updated: + +- `apache.org` (no protocol): This would previously match `http`, `https`, `ftp`, and `ftps` protocols. Change to "`*://apache.org/*`" to include all protocols, or include a line for each protocol you need to support. + +- `http://apache.*` (wildcard at end of domain): This would previously match all top-level-domains, including all possible two-letter TLDs (but not useful domains like .co.uk). Include a line for each TLD which you actually control, and need to whitelist. + +- `h*t*://ap*he.o*g` (wildcards for random missing letters): These are no longer supported; change to include a line for each domain and protocol that you actually need to whitelist. + +## Windows Phone Whitelisting + +The whitelisting rules for Windows Phone 7 and 8 are found in the +app's `config.xml` file. + +## Tizen Whitelisting + +Whitelisting rules are found in the app's `config.xml` file. The +platform relies on the same `subdomains` attribute as the BlackBerry +platform. +(For more information on support, see Tizen's documentation on the +[access element][9].) + +[1]: http://www.w3.org/TR/widgets-access/ +[2]: http://google.com +[3]: https://google.com +[4]: http://maps.google.com +[5]: http://mail.google.com +[6]: http://docs.google.com +[7]: http://developer.mozilla.org +[8]: https://developer.blackberry.com/html5/documentation/ww_developing/Access_element_834677_11.html +[9]: https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.web.appprogramming%2Fhtml%2Fide_sdk_tools%2Fconfig_editor_w3celements.htm + diff --git a/docs/jp/3.4.0/guide/cli/index.md b/docs/jp/3.4.0/guide/cli/index.md new file mode 100644 index 0000000000..ac02a64101 --- /dev/null +++ b/docs/jp/3.4.0/guide/cli/index.md @@ -0,0 +1,497 @@ +--- +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. + +--- + +# The Command-Line Interface + +This guide shows you how to create applications and deploy them to +various native mobile platforms using the `cordova` command-line +interface (CLI). This tool allows you to create new projects, build +them on different platforms, and run on real devices or within emulators. The CLI +is the main tool to use for the cross-platform workflow (See the Overview for a description +of the various workflows.) However, you can also use the CLI to initialize project code, after +which you use various platforms' SDKs and shell tools for continued development. + +## Prerequisites + +Before running any command-line tools, you need to install SDKs for +each platform you wish to target. +(See the Platform Guides for more details.) + +To add support or rebuild a project for any platform, you need to run +the command-line interface from the same machine that supports the +platform's SDK. The CLI supports the following combinations: + +* iOS (Mac) +* Amazon Fire OS (Mac, Linux, Windows) +* Android (Mac, Linux) +* BlackBerry 10 (Mac, Linux, Windows) +* Windows Phone 7 (Windows) +* Windows Phone 8 (Windows) +* Windows 8 (Windows) +* Firefox OS (Mac, Linux, Windows) + +On the Mac, the command-line is available via the _Terminal_ +application. On the PC, it's available as _Command Prompt_ under +_Accessories_. + +The more likely it is that you run the CLI from different machines, +the more it makes sense to maintain a remote source code repository, +whose assets you pull down to local working directories. + +To install the `cordova` command-line tool, follow these steps: + +1. Download and install [Node.js](http://nodejs.org/). Following + installation, you should be able to invoke `node` or `npm` on your + command line. + +1. Install the `cordova` utility. In Unix, prefixing the additional + `sudo` command may be necessary to install development utilities in + otherwise restricted directories: + + $ sudo npm install -g cordova + + The installation log may produce errors for any uninstalled + platform SDKs. Following installation, you should be able to run + `cordova` on the command line. + + **NOTE**: The `-g` flag above tells npm to install cordova globally. + You may need to add the npm directory to your PATH in order to invoke + globally installed npm modules. On Windows, npm can usually be found at + `C:\Users\username\AppData\Roaming\npm` and on Unix at + `/usr/local/share/npm`. + +## Create the App + +Go to the directory where you maintain your source code, and run a +command such as the following: + + $ cordova create hello com.example.hello HelloWorld + +It may take some time for the command to complete, so be patient. Running +the command with the ` -d` option displays information about its progress. + +The first argument _hello_ specifies a directory to be generated +for your project. This directory should not already exist, Cordova will +create it for you. Its `www` subdirectory houses your application's +home page, along with various resources under `css`, `js`, and `img`, +which follow common web development file-naming conventions. The +`config.xml` file contains important metadata needed to generate and +distribute the application. + +The second argument `com.example.hello` +provides your project with a reverse domain-style identifier. This argument +is optional, but only if you also omit the third argument, since the arguments +are positional. You can edit +this value later in the `config.xml` file, but do be aware that there may +be code generated outside of `config.xml` using this value, such as Java +package names. The default value is `io.cordova.hellocordova`, but it is +recommended that you select an appropriate value. + +The third argument `HelloWorld` provides the application's display title. +This argument is optional. You can edit this value later in the `config.xml` +file, but do be aware that there may be code generated outside of `config.xml` +using this value, such as Java class names. The default value is `HelloCordova`, +but it is recommended that you select an appropriate value. + +## Add Platforms + +All subsequent commands need to be run within the project's directory, +or any subdirectories within its scope: + + $ cd hello + +Before you can build the project, you need to specify a set of target +platforms. Your ability to run these commands depends on whether your +machine supports each SDK, and whether you have already installed each +SDK. Run any of these from a Mac: + + $ cordova platform add ios + $ cordova platform add amazon-fireos + $ cordova platform add android + $ cordova platform add blackberry10 + $ cordova platform add firefoxos + +Run any of these from a Windows machine, where _wp_ refers to +different versions of the Windows Phone operating system: + + $ cordova platform add wp7 + $ cordova platform add wp8 + $ cordova platform add windows8 + $ cordova platform add amazon-fireos + $ cordova platform add android + $ cordova platform add blackberry10 + $ cordova platform add firefoxos + +Run this to check your current set of platforms: + + $ cordova platforms ls + +(Note the `platform` and `platforms` commands are synonymous.) + +Run either of the following synonymous commands to remove a platform: + + $ cordova platform remove blackberry10 + $ cordova platform rm amazon-fireos + $ cordova platform rm android + +Running commands to add or remove platforms affects the contents of +the project's _platforms_ directory, where each specified platform +appears as a subdirectory. The _www_ source directory is reproduced +within each platform's subdirectory, appearing for example in +`platforms/ios/www` or `platforms/android/assets/www`. Because the CLI +constantly copies over files from the source _www_ folder, you should only +edit these files and not the ones located under the _platforms_ subdirectories. +If you use version control software, you should add this source _www_ folder, +along with the _merges_ folder, to your version control system. (More information +about the _merges_ folder can be found in the Customize Each Platform section below.) + +**WARNING**: When using the CLI to build your application, you are strongly discouraged +from editing any files in the `/platforms/` folder unless you know what you are doing +or are specifically told otherwise in documentation. This is because the files in the +`/platforms/` directory will be overwritten on prepare or plugin reinstallation. + +If you wish at this point, you can use an SDK such as Eclipse or Xcode +to open the project you created. You will need to open the derivative set of assets +from the `/platforms/` directory to develop with an SDK. This is because +the SDK specific metadata files are stored within the appropriate `/platform/` subdirectory. +(See the Platform Guides for information on how to develop applications within each IDE.) +Use this approach if you simply want to initialize a project using the CLI and +then switch to an SDK for native work. + +Read on if you wish to use the cross-platform workflow approach (the CLI) for the entire +development cycle. + +## Build the App + +By default, the `cordova create` script generates a skeletal web-based +application whose home page is the project's `www/index.html` file. +Edit this application however you want, but any initialization should +be specified as part of the `deviceready` event handler, referenced by +default from `www/js/index.js`. + +Run the following command to iteratively build the project: + + $ cordova build + +This generates platform-specific code within the project's `platforms` +subdirectory. You can optionally limit the scope of each build to +specific platforms: + + $ cordova build ios + +The `cordova build` command is a shorthand for the following, which in +this example is also targeted to a single platform: + + $ cordova prepare ios + $ cordova compile ios + +In this case, once you run `prepare`, you can use Apple's Xcode SDK as +an alternative to modify and compile the platform-specific code that +Cordova generates within `platforms/ios`. You can use the same +approach with other platforms' SDKs. + +## Test the App on an Emulator or Device + +SDKs for mobile platforms often come bundled with emulators that +execute a device image, so that you can launch the app from the home +screen and see how it interacts with many platform features. Run a +command such as the following to rebuild the app and view it within a +specific platform's emulator: + + $ cordova emulate android + +Some mobile platforms emulate a particular device by default, such as +the iPhone for iOS projects. For other platforms, you may need to +first associate a device with an emulator. + +Note: Emulator support is currently not available for Amazon Fire OS + +(See the Platform Guides for details.) +For example, you may first run the `android` command to launch the +Android SDK, then run a particular device image, which launches it +according to its default behavior: + +![](img/guide/cli/android_emulate_init.png) + +Following up with the `cordova emulate` command refreshes the emulator +image to display the latest application, which is now available for +launch from the home screen: + +![](img/guide/cli/android_emulate_install.png) + +Alternately, you can plug the handset into your computer and test the +app directly: + + $ cordova run android + +Before running this command, you need to set up the device for +testing, following procedures that vary for each platform. In +Android and Amazon Fire OS devices, you would have to enable a __USB debugging__ option on +the device, and perhaps add a USB driver depending on your development +environmnent. +See Platform Guides for details on each platform's requirements. + +## Add Plugin Features + +When you build and view a new project, the default application that +appears doesn't do very much. You can modify the app in many ways to +take advantage of standard web technologies, but for the app to +communicate closely with various device-level features, you need to +add plugins that provide access to core Cordova APIs. + +A _plugin_ is a bit of add-on code that provides an interface to +native components. You can design your own plugin interface, for +example when designing a hybrid app that mixes a Cordova WebView with +native components. (See Embedding WebViews and Plugin Development +Guide for details.) More commonly, you would add a plugin to enable +one of Cordova's basic device-level features +detailed in the API Reference. A list of these plugins, including +additional plugins provided by the community, can be found at +[plugins.cordova.io](http://plugins.cordova.io/). You can use +the CLI to search for plugins from this registry. For example, +searching for `bar` and `code` produces a single result that matches +both terms as case-insensitive substrings: + + $ cordova plugin search bar code + + com.phonegap.plugins.barcodescanner - Scans Barcodes + +Searching for only the `bar` term yields and additional result: + + org.apache.cordova.statusbar - Cordova StatusBar Plugin + +The `cordova plugin add` command requires you to specify the +repository for the plugin code. Please note that when you follow the +Web Project Dev workflow and use the CLI, the CLI will take care of adding +the plugin code to the appropriate place for each platform. (If you are following the +Native Project Dev Workflow, you will have to add plugins using Plugman (guide link here), +multiple times for each platform.) + +Here are examples of how you might use the CLI to add features to the app: + +* Basic device information (Device API): + + $ cordova plugin add org.apache.cordova.device + +* Network Connection and Battery Events: + + $ cordova plugin add org.apache.cordova.network-information + $ cordova plugin add org.apache.cordova.battery-status + +* Accelerometer, Compass, and Geolocation: + + $ cordova plugin add org.apache.cordova.device-motion + $ cordova plugin add org.apache.cordova.device-orientation + $ cordova plugin add org.apache.cordova.geolocation + +* Camera, Media playback and Capture: + + $ cordova plugin add org.apache.cordova.camera + $ cordova plugin add org.apache.cordova.media-capture + $ cordova plugin add org.apache.cordova.media + +* Access files on device or network (File API): + + $ cordova plugin add org.apache.cordova.file + $ cordova plugin add org.apache.cordova.file-transfer + +* Notification via dialog box or vibration: + + $ cordova plugin add org.apache.cordova.dialogs + $ cordova plugin add org.apache.cordova.vibration + +* Contacts: + + $ cordova plugin add org.apache.cordova.contacts + +* Globalization: + + $ cordova plugin add org.apache.cordova.globalization + +* Splashscreen: + + $ cordova plugin add org.apache.cordova.splashscreen + +* Open new browser windows (InAppBrowser): + + $ cordova plugin add org.apache.cordova.inappbrowser + +* Debug console: + + $ cordova plugin add org.apache.cordova.console + +Use `plugin ls` (or `plugin list`, or `plugin` by itself) to view +currently installed plugins. Each displays by its identifier: + + $ cordova plugin ls # or 'plugin list' + [ 'org.apache.cordova.console' ] + +To remove a plugin, refer to it by the same identifier that appears in +the listing. For example, here is how you would remove support for a +debug console from a release version: + + $ cordova plugin rm org.apache.cordova.console + $ cordova plugin remove org.apache.cordova.console # same + +You can batch-remove or add plugins by specifying more than one +argument for each command: + + $ cordova plugin add org.apache.cordova.console org.apache.cordova.device + +## Advanced Plugin Options + +When adding a plugin, several options allow you to specify from where +to fetch the plugin. The examples above use a well-known +`registry.cordova.io` registry, and the plugin is specified by the +`id`: + + $ cordova plugin add org.apache.cordova.console + +The `id` may also include the plugin's version number, appended after +an `@` character. The `latest` version is an alias for the most recent +version. For example: + + $ cordova plugin add org.apache.cordova.console@latest + $ cordova plugin add org.apache.cordova.console@0.2.1 + +If the plugin is not registered at `registry.cordova.io` but is located in +another git repository, you can specify an alternate URL: + + $ cordova plugin add https://github.com/apache/cordova-plugin-console.git + +The git example above fetches the plugin from the end of the master +branch, but an alternate git-ref such as a tag or branch can be +appended after a `#` character: + + $ cordova plugin add https://github.com/apache/cordova-plugin-console.git#r0.2.0 + +If the plugin (and its `plugin.xml` file) is in a subdirectory within +the git repo, you can specify it with a `:` character. Note that the +`#` character is still needed: + + $ cordova plugin add https://github.com/someone/aplugin.git#:/my/sub/dir + +You can also combine both the git-ref and the subdirectory: + + $ cordova plugin add https://github.com/someone/aplugin.git#r0.0.1:/my/sub/dir + +Alternately, specify a local path to the plugin directory that +contains the `plugin.xml` file: + + $ cordova plugin add ../my_plugin_dir + +## Using _merges_ to Customize Each Platform + +While Cordova allows you to easily deploy an app for many different +platforms, sometimes you need to add customizations. In that case, +you don't want to modify the source files in various `www` directories +within the top-level `platforms` directory, because they're regularly +replaced with the top-level `www` directory's cross-platform source. + +Instead, the top-level `merges` directory offers a place to specify +assets to deploy on specific platforms. Each platform-specific +subdirectory within `merges` mirrors the directory structure of the +`www` source tree, allowing you to override or add files as needed. +For example, here is how you might uses `merges` to boost the default +font size for Android and Amazon Fire OS devices: + +* Edit the `www/index.html` file, adding a link to an additional CSS + file, `overrides.css` in this case: + + + +* Optionally create an empty `www/css/overrides.css` file, which would + apply for all non-Android builds, preventing a missing-file error. + +* Create a `css` subdirectory within `merges/android`, then add a + corresponding `overrides.css` file. Specify CSS that overrides the + 12-point default font size specified within `www/css/index.css`, for + example: + + body { font-size:14px; } + +When you rebuild the project, the Android version features the custom +font size, while others remain unchanged. + +You can also use `merges` to add files not present in the original +`www` directory. For example, an app can incorporate a _back button_ +graphic into the iOS interface, stored in +`merges/ios/img/back_button.png`, while the Android version can +instead capture `backbutton` events from the corresponding hardware +button. + +## Help Commands + +Cordova features a couple of global commands, which may help you if +you get stuck or experience a problem. The `help` command displays +all available Cordova commands and their syntax: + + $ cordova help + $ cordova # same + +The `info` command produces a listing of potentially useful details, +such as currently installed platforms and plugins, SDK versions for +each platform, and versions of the CLI and `node.js`: + + $ cordova info + +It both presents the information to screen and captures the output in +a local `info.txt` file. + +__NOTE__: Currently, only details on iOS and Android platforms are +available. + +## Updating Cordova and Your Project + +After installing the `cordova` utility, you can always update it to +the latest version by running the following command: + + $ sudo npm update -g cordova + +Use this syntax to install a specific version: + + $ sudo npm install -g cordova@3.1.0-0.2.0 + +Run `cordova -v` to see which version is currently running. Run the `npm +info` command for a longer listing that includes the current version +along with other available version numbers: + + $ npm info cordova + +Cordova 3.0 is the first version to support the command-line interface +described in this section. If you are updating from a version prior to +3.0, you need to create a new project as described above, then copy +the older application's assets into the top-level `www` directory. +Where applicable, further details about upgrading to 3.0 are available +in the Platform Guides. Once you upgrade to the `cordova` +command-line interface and use `npm update` to stay current, the more +time-consuming procedures described there are no longer relevant. + +Cordova 3.0+ may still require various changes to +project-level directory structures and other dependencies. After you +run the `npm` command above to update Cordova itself, you may need to +ensure your project's resources conform to the latest version's +requirements. Run a command such as the following for each platform +you're building: + + $ cordova platform update android + $ cordova platform update ios + ...etc. + diff --git a/docs/jp/3.4.0/guide/hybrid/plugins/index.md b/docs/jp/3.4.0/guide/hybrid/plugins/index.md new file mode 100644 index 0000000000..b8dd5eab20 --- /dev/null +++ b/docs/jp/3.4.0/guide/hybrid/plugins/index.md @@ -0,0 +1,211 @@ +--- +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. +--- + +# Plugin Development Guide + +A _plugin_ is a package of injected code that allows the Cordova webview within +which your app renders to communicate with the native platform on +which it runs. Plugins provide access to device and platform +functionality that is ordinarily unavailable to web-based apps. All +the main Cordova API features are implemented as plugins, and many +others are available that enable features such as bar code scanners, +NFC communication, or to tailor calendar interfaces. + +Plugins comprise a single JavaScript interface along with +corresponding native code libraries for each supported platform. This +section steps through a simple _echo_ plugin that passes a string from +JavaScript to the native platform and back, one that you can use as a +model to build far more complex features. This section discusses the +basic plugin structure and the outward-facing JavaScript interface. +For each corresponding native interface, see the list at the end of +this section. + +In addition to these instructions, when preparing to write a plugin it +is best to look over +[existing plugins](https://github.com/apache/cordova-android/tree/master/framework/src/org/apache/cordova) +for guidance. + +## Building a Plugin + +Application developers use the CLI's `plugin add` command (discussed +in The Command-Line Interface) to apply a plugin to a project. The +argument to that command is the URL for a _git_ repository containing +the plugin code. This example implements Cordova's Device API: + + $ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git + +The plugin repository must feature a top-level `plugin.xml` manifest +file. There are many ways to configure this file, details for which +are available in the Plugin Specification. This abbreviated version of +the `Device` plugin provides a simple example to use as a model: + + + + Device + Cordova Device Plugin + Apache 2.0 + cordova,device + + + + + + + + + + + + + + +The top-level `plugin` tag's `id` attribute uses the same +reverse-domain format to identify the plugin package as the apps to +they're added. The `js-module` tag specifies the path to the common +JavaScript interface. The `platform` tag specifies a corresponding +set of native code, for the `ios` platform in this case. The +`config-file` tag encapsulates a `feature` tag that is injected into +the platform-specific `config.xml` file to make the platform aware of +the additional code library. The `header-file` and `source-file` tags +specify the path to the library's component files. + +## Validating a Plugin + +You can use the `plugman` utility to check whether the plugin installs +correctly for each platform. Install `plugman` with the following +[node](http://nodejs.org/) command: + + $ npm install -g plugman + +You need an valid app source directory, such as the top-level `www` +directory included in a default CLI-generated project as described in +The Command-Line Interface. Make sure the app's `index.html` home +page reference the name of the plugin's JavaScript interface, as if it +were in the same source directory: + + + +Then run a command such as the following to test whether iOS +dependencies load properly: + + $ plugman -platform ios /path/to/my/project/www /path/to/my/plugin + +For details on `plugman` options, see Using Plugman to Manage Plugins. +For information on how to actually _debug_ plugins, see each +platform's native interface listed at the bottom of this page. + +## The JavaScript Interface + +The JavaScript provides the front-facing interface, making it perhaps +the most important part of the plugin. You can structure your +plugin's JavaScript however you like, but you need to call +`cordova.exec` to communicate with the native platform, using the +following syntax: + + cordova.exec(function(winParam) {}, + function(error) {}, + "service", + "action", + ["firstArgument", "secondArgument", 42, false]); + +Here is how each parameter works: + +- `function(winParam) {}`: A success callback function. Assuming your + `exec` call completes successfully, this function executes along + with any parameters you pass to it. + +- `function(error) {}`: An error callback function. If the operation + does not complete successfully, this function executes with an + optional error parameter. + +- `"service"`: The service name to call on the native side. This + corresponds to a native class, for which more information is + available in the native guides listed below. + +- `"action"`: The action name to call on the native side. This + generally corresponds to the native class method. See the native + guides listed below. + +- `[/* arguments */]`: An array of arguments to pass into the native + environment. + +## Sample JavaScript + +This example shows one way to implement the plugin's JavaScript +interface: + + window.echo = function(str, callback) { + cordova.exec(callback, function(err) { + callback('Nothing to echo.'); + }, "Echo", "echo", [str]); + }; + +In this example, the plugin attaches itself to the `window` object as +the `echo` function, which plugin users would call as follows: + + window.echo("echome", function(echoValue) { + alert(echoValue == "echome"); // should alert true. + }); + +Look at the last three arguments to the `cordova.exec` function. The +first calls the `Echo` _service_, a class name. The second requests +the `echo` _action_, a method within that class. The third is an array +of arguments containing the echo string, which is the `window.echo` +function's the first parameter. + +The success callback passed into `exec` is simply a reference to the +callback function `window.echo` takes. If the native platform fires +the error callback, it simply calls the success callback and passes it +a default string. + +## Native Interfaces + +Once you define JavaScript for your plugin, you need to complement it +with at least one native implementation. Details for each platform are +listed below, and each builds on the simple Echo Plugin example above: + +- Amazon Fire OS Plugins +- Android Plugins +- iOS Plugins +- BlackBerry 10 Plugins +- Windows Phone Plugins + +The Tizen platform does not support plugins. + +## Publishing Plugins + +Once you develop your plugin, you may want to publish and share it +with the community. You can publish your plugin to the cordova +registry (based on [`npmjs`](https://github.com/isaacs/npmjs.org)) or +to any other `npmjs`-based registry. Other developers can install it +automatically using either `plugman` or the Cordova CLI. (For details +on each development path, see Using Plugman to Manage Plugins and The +Command-Line Interface.) + +To publish a plugin you need to use the `plugman` tool and go through +the following steps: + + $ plugman adduser # that is if you don't have an account yet + $ plugman publish /path/to/your/plugin + +That is it! + +Running `plugman --help` lists other available registry-based +commands. diff --git a/docs/jp/3.4.0/guide/hybrid/webviews/index.md b/docs/jp/3.4.0/guide/hybrid/webviews/index.md new file mode 100644 index 0000000000..e08b25b391 --- /dev/null +++ b/docs/jp/3.4.0/guide/hybrid/webviews/index.md @@ -0,0 +1,36 @@ +--- +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. +--- + +# Embedding WebViews + +Cordova applications are ordinarily implemented as a browser-based +_WebView_ within the native mobile platform. This section shows how, +for supporting platforms, to create your own WebView components that +make full use of Cordova APIs. You can then deploy these Cordova +application components along with native components in a hybrid +application. + +To deploy a WebView, you need to be familiar with each native +programming environment. The following provides instructions for +supported platforms: + +- Amazon Fire OS WebViews +- Android WebViews +- iOS WebViews + diff --git a/docs/jp/3.4.0/guide/overview/index.md b/docs/jp/3.4.0/guide/overview/index.md new file mode 100644 index 0000000000..2ceb5c83a8 --- /dev/null +++ b/docs/jp/3.4.0/guide/overview/index.md @@ -0,0 +1,139 @@ +--- +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. + +--- + +# Overview + +Cordova is an open-source mobile development framework. It allows you +to use standard web technologies such as HTML5, CSS3, and JavaScript +for cross-platform development, avoiding each mobile platforms' native +development language. Applications execute within wrappers targeted +to each platform, and rely on standards-compliant API bindings to +access each device's sensors, data, and network status. + +Use Cordova if you are: + +* a mobile developer and want to extend an application across more + than one platform, without having to re-implement it with each + platform's language and tool set. + +* a web developer and want to deploy a web app that's packaged for + distribution in various app store portals. + +* a mobile developer interested in mixing native application + components with a _WebView_ (browser window) that can access + device-level APIs, or if you want to develop a plugin interface + between native and WebView components. + +## Basic Components + +Cordova applications rely on a common `config.xml` file that provides +information about the app and specifies parameters affecting how it +works, such as whether it responds to orientation shifts. This file +adheres to the W3C's +[Packaged Web App](http://www.w3.org/TR/widgets/), +or _widget_, specification. + +The application itself is implemented as a web page, named +_index.html_ by default, that references whatever CSS, JavaScript, +images, media files, or other resources are necessary for it to run. +The app executes as a _WebView_ within the native application wrapper, +which you distribute to app stores. For the web app to interact with +various device features the way native apps do, it must also reference +a `cordova.js` file, which provides API bindings. + +The Cordova-enabled WebView may provide the application with its +entire user interface. It can also be a component within a larger, +hybrid application that mixes the WebView with native application +components. Cordova provides a _plugin_ interface for these +components to communicate with each other. + +## Development Paths + +As of version 3.0, you can use two basic workflows to create +a mobile application. While you can accomplish the same +thing using both workflows, certain tasks are better suited to using one workflow +over the other. For this reason, you should understand both workflows so +that you can use the best tool for the best situation. + +The two main workflows that are supported are the _Web Project Dev_ workflow and the _Native Platform Dev_ workflow. + +### Web Project Dev + +You can think of the first workflow as the _Web Project Dev_ workflow. You should use +this workflow when you want to create a Cordova application that runs on +as many mobile operating systems as possible with as little platform-specific +development work as possible. This workflow came into existence with Cordova 3.0 +and the creation of the Cordova _Command-line Interface_ (CLI). The CLI abstracts +away a lot of the functionality of lower-level shell scripts that take care of the +details involved with building your app, such as copying your web assets into +the correct folders for each mobile platform, making platform specific configuration +changes, or running specific build scripts to generate application binaries. You can read +more about the _Web Project Dev_ workflow in The Command-line Interface. Please note +that often when people speak of the "CLI," they are talking about this _Web Project Dev_ +workflow. + +### Native Platform Dev + +The second workflow can be thought of as a _Native Platform Dev_ workflow. You should use it +when you want to focus on building an application for a single platform and are +interested in changing the lower-level platform details. While you can still use this workflow +to build cross-platform apps, the lack of tools to abstract away the various build steps will +make it more difficult. For example, you will have to use Plugman to +install the same plugin once for each platform that you want to support. The +benefit to using this _Native Platform Dev_ workflow is that it gives you access to the lower-level +shell scripts to build and test the application, so if you are hacking on the native +side of things, this workflow is the most efficient way to test your changes. This workflow +is also appropriate if you want to use the CordovaWebView as a small part in a larger native +application (See the Embedding WebViews guide.) You can read about this workflow in the different +Shell Tool guides, for instance, Android Shell Tool Guide and iOS Shell Tool Guide. + +When first starting out, it might be easiest to use the _Web Project Dev_ workflow +to create an application. (To install the CLI, see The Command-line Interface.) +Depending on the set of platforms you wish to target, you can rely on +the CLI for progressively greater shares of the development cycle: + +* In the most basic scenario, you can use the CLI simply to create a + new project that is populated with default configuration for you to + modify. + +* For many mobile platforms, you can also use the CLI to set up + additional project files required to compile within each SDK. For + this to work, you must install each targeted platform's SDK. + (See the Platform Guides for instructions.) + As indicated in the Platform Support table, you may need to + run the CLI on different operating systems depending on the targeted + platform. + +* For supporting platforms, the CLI can compile executable + applications and run them in an SDK-based device emulator. + For comprehensive testing, you can also generate application files + and install them directly on a device. + +At any point in the development cycle, you can switch to using more of the _Native Platform +Dev_ workflow. The platform-specific SDK tools provided may provide a richer set of +options. (See the Platform Guides for details about each platform's SDK tool set.) + +An SDK environment is more appropriate if you want implement a hybrid +app that mixes web-based and native application components. +You may use the command-line utility to initially generate the app, or +iteratively thereafter to feed updated code to SDK tools. You may +also build the app's configuration file yourself. +(See The config.xml File for details.) + diff --git a/docs/jp/3.4.0/guide/platforms/amazonfireos/config.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/config.md new file mode 100644 index 0000000000..436d292573 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/amazonfireos/config.md @@ -0,0 +1,66 @@ +--- +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. +--- + +# Amazon Fire OS Configuration + +The `config.xml` file controls an app's basic settings that apply +across each application and CordovaWebView instance. This section +details preferences that only apply to Amazon Fire OS builds. See The +config.xml File for information on global configuration options. + +- `KeepRunning` (boolean, defaults to `true`): Determines whether the + application stays running in the background even after a `pause` + event fires. + + + +- `ErrorUrl`: Specifies an error page that displays in response to + standard HTTP errors in the 400-500 range. Place the specified file + in the top-level directory containing the home page and other web + assets. + + + +- `LoadingDialog`: Display a native dialog when loading the app. The + value's format is _Title, Message_ + + + +- `LoadingPageDialog`: Display a native dialog when loading sub-pages + within an app. The value's format is _Title, Message_ + + + +- `LoadUrlTimeoutValue` (number, default is `20000`): When loading a + page, the amount of time to wait before throwing a timeout error. + This example specifies 10 seconds rather than 20: + + + +- `SplashScreen`: The name of the file minus its extension in the + `res/drawable` directory. Various assets must share this common + name in various subdirectories. + + + +- `SplashScreenDelay` (number, defaults to `5000`): The amount of + time the splash screen image displays. + + + diff --git a/docs/jp/3.4.0/guide/platforms/amazonfireos/index.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/index.md new file mode 100644 index 0000000000..f4b81accee --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/amazonfireos/index.md @@ -0,0 +1,145 @@ +--- +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. +--- + +# Amazon Fire OS Platform Guide + +This guide shows how to set up your SDK development environment to +deploy Cordova apps for Amazon Fire OS devices, such as the Kindle Fire HDX. + +See the following for more detailed platform-specific information: + +* Amazon Fire OS Configuration +* Amazon Fire OS WebViews +* Amazon Fire OS Plugins + +## Requirements and Support + +Developing Cordova apps for Amazon Fire OS requires the Android SDK and the Amazon WebView SDK. Check the requirements for these SDKs at the links below: + +* [Android SDK System](http://developer.android.com/sdk/) + +* [Amazon WebView SDK](https://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv) + +## Installation + + +### Android SDK + +Install the Android SDK from +[developer.android.com/sdk](http://developer.android.com/sdk/). You +may be presented with a choice of where to install the SDK, otherwise +move the downloaded `adt-bundle` tree to wherever you store +development tools. + +For Cordova command-line tools to work, you need to include the SDK's +`tools` and `platform-tools` directories in your PATH environment. + +On Mac, Linux or other Unix-like platforms, you can use a text editor to create or modify the +`~/.bash_profile` file, adding a line such as the following, depending +on where the SDK installs: + + export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools + +This exposes SDK tools in newly opened terminal windows. Otherwise run +this to make them available in the current session: + + $ source ~/.bash_profile + +To modify the PATH environment on Windows 7: + +* Click on the __Start__ menu in the lower-left corner of the desktop, + right-click on __Computer__, then click __Properties__. + +* Click __Advanced System Settings__ in the column on the left. + +* In the resulting dialog box, press __Environment Variables__. + +* Select the __PATH__ variable and press __Edit__. + +* Append the following to the PATH based on where you installed the + SDK, for example: + + ;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools + +* Save the value and close both dialog boxes. + +You may also need to enable Java and Ant. Open a command prompt and +type `java`, and also type `ant`. Append to the PATH whichever fail to +run: + + ;%JAVA_HOME%\bin;%ANT_HOME%\bin + +### Amazon WebView SDK + +Download the Amazon WebView SDK from the [Amazon Developer Portal](https://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv). + +* Create a `libs/` folder in `~/.cordova/lib/amazon-fireos/cordova/3.1.0/` folder. +* Add the `awv_interface.jar` from the downloaded SDK to `~/.cordova/lib/amazon-fireos/cordova/3.1.0/libs/` + + +## Open a Project in the SDK + +Use the `cordova` utility to set up a new project, as described in The +Cordova The Command-line Interface. For example, in a source-code directory: + + $ cordova create hello com.example.hello "HelloWorld" + $ cd hello + $ cordova platform add amazon-fireos + $ cordova build + +Once created, you can use the Eclipse that comes along with the Android SDK to modify it: + +* Launch the __Eclipse__ application. + +* Select the __New Project__ menu item. + +* Choose __Android Project from Existing Code__ from the resulting dialog box, and press __Next__: + ![](img/guide/platforms//eclipse_new_project.png) + +* Navigate to `hello`, or whichever directory you created for the project, then to the `platforms/amazon-fireos` subdirectory. + +* Press __Finish__. + +Once the Eclipse window opens, a red __X__ may appear to indicate +unresolved problems. If so, follow these additional steps: + +* Right-click on the project directory. + +* In the resulting __Properties__ dialog, select __Android__ from the navigation pane. + +* For the project build target, select the highest Android API level you have installed. + +* Click __OK__. + +* Select __Clean__ from the __Project__ menu. This should correct all the errors in the project. + +## Deploy to Device + +To push an app directly to the device, make sure USB debugging is enabled on your device as described on the +[Android Developer Site](http://developer.android.com/tools/device.html), +and use a mini USB cable to plug it into your system. + +You can push the app to the device from the command line: + + $ cordova run amazon-fireos + +Alternately within Eclipse, right-click the project and choose __Run +As → Android Application__. + +__Note__: Currently, testing via an emulator is not supported for Amazon WebView based apps. diff --git a/docs/jp/3.4.0/guide/platforms/amazonfireos/plugin.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/plugin.md new file mode 100644 index 0000000000..3fc5ca9a2f --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/amazonfireos/plugin.md @@ -0,0 +1,100 @@ +--- +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. +--- + +# Amazon Fire OS Plugins + +Follow the instructions provided in the Android Plugins Guide for an overview of developing custom plugins. + +## Echo Amazon Fire OS Plugin Example + +To match the JavaScript interface's _echo_ feature described in +Application Plugins, use the `plugin.xml` to inject a `feature` +specification to the local platform's `config.xml` file: + + + + + + + + + +Then add the following to the +`src/org/apache/cordova/plugin/Echo.java` file: + + package org.apache.cordova.plugin; + + import org.apache.cordova.CordovaPlugin; + import org.apache.cordova.CallbackContext; + + import org.json.JSONArray; + import org.json.JSONException; + import org.json.JSONObject; + + /** + * This class echoes a string called from JavaScript. + */ + public class Echo extends CordovaPlugin { + + @Override + public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { + if (action.equals("echo")) { + String message = args.getString(0); + this.echo(message, callbackContext); + return true; + } + return false; + } + + private void echo(String message, CallbackContext callbackContext) { + if (message != null && message.length() > 0) { + callbackContext.success(message); + } else { + callbackContext.error("Expected one non-empty string argument."); + } + } + } + +If you want to reuse Android Plugin code for the Amazon Fire OS platform then modify the plugin.xml to point to the `android` specific source file. For example, + + + + + + + + + + +If you want to write a customized plugin for the Amazon Fire OS platform then create a folder named `amazon` under your plugin src/ folder and modify the plugin.xml to point to the `amazon` specific source file. For example, + + + + + + + + + + +## Using Amazon WebView in your plugin + +Cordova for Amazon Fire OS makes use of custom Amazon WebView that is built on the open-source Chromium project. It is GPU accelerated and optimized for fluid performance on Kindle Fire. + +To understand how to best use Amazon WebView in your project, check out the [Amazon Developer Portal](https://developer.amazon.com/sdk/fire/IntegratingAWV.html). diff --git a/docs/jp/3.4.0/guide/platforms/amazonfireos/webview.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/webview.md new file mode 100644 index 0000000000..87fda43cc1 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/amazonfireos/webview.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. +--- + +# Amazon Fire OS WebViews + +Beginning with 3.0.0, you can use Cordova as a component in Amazon Fire OS applications. Amazon Fire OS refers to this component as `CordovaWebView`. `CordovaWebView` extends Amazon WebView that is built on the open source Chromium Project. By leveraging this feature, your web apps can utilize the latest HTML5 web standards running in a modern web runtime engine. + +## Prerequisites + +* Cordova 3.0.0 or greater + +* Android SDK updated to the latest SDK + +* Amazon WebView SDK + +## Guide to using CordovaWebView in a Amazon Fire OS Project + +1. Download and expand the [Amazon WebView SDK](https://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv) , then copy the awv_interface.jar into `/framework/libs` directory. Create a libs/ folder if it doesn't exist. + +2. `cd` into `/framework` and run `ant jar` to build the cordova jar. It creates the .jar file formed as `cordova-3.4.0.jar` in the `/framework` directory. + +3. Edit your application's `main.xml` file (under `/res/layout`) to look like the following, with the `layout_height`, `layout_width` and `id` modified to suit your application: + + + +4. Modify your activity so that it implements the `CordovaInterface`. You should implement the included methods. You may wish to copy them from `/framework/src/org/apache/cordova/CordovaActivity.java`, or implement them on your own. The code fragment below shows a basic application that uses the interface. Note how the referenced view id matches the `id` attribute specified in the XML fragment shown above: + + public class CordovaViewTestActivity extends Activity implements CordovaInterface { + CordovaWebView cwv; + /* Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + cwv = (CordovaWebView) findViewById(R.id.tutorialView); + Config.init(this); + cwv.loadUrl(Config.getStartUrl()); + } + +If you use the camera, you should also implement this: + + @Override + public void setActivityResultCallback(CordovaPlugin plugin) { + this.activityResultCallback = plugin; + } + /** + * Launch an activity for which you would like a result when it finished. When this activity exits, + * your onActivityResult() method is called. + * + * @param command The command object + * @param intent The intent to start + * @param requestCode The request code that is passed to callback to identify the activity + */ + public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) { + this.activityResultCallback = command; + this.activityResultKeepRunning = this.keepRunning; + + // If multitasking turned on, then disable it for activities that return results + if (command != null) { + this.keepRunning = false; + } + + // Start activity + super.startActivityForResult(intent, requestCode); + } + + @Override + /** + * Called when an activity you launched exits, giving you the requestCode you started it with, + * the resultCode it returned, and any additional data from it. + * + * @param requestCode The request code originally supplied to startActivityForResult(), + * allowing you to identify who this result came from. + * @param resultCode The integer result code returned by the child activity through its setResult(). + * @param data An Intent, which can return result data to the caller (various data can be attached to Intent "extras"). + */ + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { + super.onActivityResult(requestCode, resultCode, intent); + CordovaPlugin callback = this.activityResultCallback; + if (callback != null) { + callback.onActivityResult(requestCode, resultCode, intent); + } + } + +Finally, remember to add the thread pool, otherwise the plugins have no threads to run on: + + @Override + public ExecutorService getThreadPool() { + return threadPool; + } + +6. Copy your application's HTML and JavaScript files to your Amazon Fire OS project's `/assets/www` directory. + +7. Copy `config.xml` from `/framework/res/xml` to your project's `/res/xml` directory. diff --git a/docs/jp/3.4.0/guide/platforms/android/config.md b/docs/jp/3.4.0/guide/platforms/android/config.md new file mode 100644 index 0000000000..fdf1744f16 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/android/config.md @@ -0,0 +1,93 @@ +--- +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. +--- + +# Android Configuration + +The `config.xml` file controls an app's basic settings that apply +across each application and CordovaWebView instance. This section +details preferences that only apply to Android builds. See The +config.xml File for information on global configuration options. + +- `KeepRunning` (boolean, defaults to `true`): Determines whether the + application stays running in the background even after a `pause` + event fires. Note: setting this to false will not kill the app after + a pause event, it will only halt execution of code in the cordova + webview while the app is in the background. + + + +- `LoadUrlTimeoutValue` (number in milliseconds, default to `20000`, + 20 seconds): When loading a page, the amount of time to wait before throwing + a timeout error. This example specifies 10 seconds rather than 20: + + + +- `SplashScreen` (string, defaults to `splash`): The name of the file minus + its extension in the `res/drawable` directory. Various assets must share + this common name in various subdirectories. + + + +- `SplashScreenDelay` (number in milliseconds, defaults to `3000`): The amount + of time the splash screen image displays. + + + +- `InAppBrowserStorageEnabled` (boolean, defaults to `true`): Controls + whether pages opened within an InAppBrowser can access the same + localStorage and WebSQL storage as pages opened with the default + browser. + + + +- `LoadingDialog` (string, defaults to `null`): If set, displays a dialog with + the specified title and message, and a spinner, when loading the first + page of an application. The title and message are separated by a comma + in this value string, and that comma is removed before the dialog is + displayed. + + + +- `LoadingPageDialog` (string, defaults to `null`): The same as `LoadingDialog`, + but for loading every page after the first page in the application. + + + +- `ErrorUrl` (URL, defaults to `null`): + If set, will display the referenced page upon an error in the application + instead of a dialog with the title "Application Error". + + + +- `ShowTitle` (boolean, defaults to `false`): Show the title at the top + of the screen. + + + +- `LogLevel` (string, defaults to `ERROR`): Sets the minimum log level + through which log messages from your application will be filtered. Valid + values are `ERROR`, `WARN`, `INFO`, `DEBUG`, and `VERBOSE`. + + + +- `SetFullscreen` (boolean, defaults to `false`): Same as the `Fullscreen` + parameter in the global configuration of this xml file. This Android-specific + element is deprecated in favor of the global `Fullscreen` element, and will + be removed in a future version. + diff --git a/docs/jp/3.4.0/guide/platforms/android/index.md b/docs/jp/3.4.0/guide/platforms/android/index.md new file mode 100644 index 0000000000..1bb1ec1613 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/android/index.md @@ -0,0 +1,244 @@ +--- +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. +--- + +# Android Platform Guide + +This guide shows how to set up your SDK development environment to +deploy Cordova apps for Android devices. It walks you through the process +of installing the Android SDK, opening an Android project in Eclipse SDK, +and deploying to an emulator or device. You will need to follow this guide +to at least Install the Android SDK, regardless of which workflow you +are following. (Both the _Web Project Dev_ and _Native Platform Dev_ workflows +require the Android SDK to be installed and accessible via your PATH.) + +See the following for more detailed platform-specific information: + +* Android Configuration +* Android WebViews +* Android Plugins +* Upgrading Android +* Android Command-line Tools + +The command-line tools above refer to versions prior to Cordova 3.0. +See The Command-Line Interface for information about the +current interface. + +## Requirements and Support + +See the [System Requirements](http://developer.android.com/sdk/index.html) +for the Android SDK. + +Cordova supports Android 2.2, 2.3, and 4.x. As a general rule, +platforms are deprecated as they dip below 5% on Google's +[distribution dashboard](http://developer.android.com/about/dashboards/index.html). + + + +Developers should use the `cordova` utility in conjunction with +the Android SDK. See The Command-Line Interface for +information how to install it, add projects, then build and deploy a +project. + +Install the Android SDK from +[developer.android.com/sdk](http://developer.android.com/sdk/). The android sdk +is distributed as an 'adt-bundle---' file. +On windows, the adt-bundle is packaged with an installer. +On OSX and Linux, simply unpack the 'adt-bundle' in the location you store development tools. +[More detailed information on Android SDK setup can be found here](http://developer.android.com/sdk/installing/bundle.html) + + +For Cordova command-line tools to work, you need to include the SDK's +`tools` and `platform-tools` directories in your PATH environment. On +Mac, you can use a text editor to create or modify the +`~/.bash_profile` file, adding a line such as the following, depending +on where the SDK installs: + + export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools + +This exposes SDK tools in newly opened terminal windows. Otherwise run +this to make them available in the current session: + + $ source ~/.bash_profile + +To modify the PATH environment on Windows 7: + +* Click on the __Start__ menu in the lower-left corner of the desktop, + right-click on __Computer__, then click __Properties__. + +* Click __Advanced System Settings__ in the column on the left. + +* In the resulting dialog box, press __Environment Variables__. + +* Select the __PATH__ variable and press __Edit__. + +* Append the following to the PATH based on where you installed the + SDK, for example: + + ;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools + +* Save the value and close both dialog boxes. + +You may also need to enable Java and Ant. Open a command prompt and +type `java`, and also type `ant`. Append to the PATH whichever fail to +run: + + ;%JAVA_HOME%\bin;%ANT_HOME%\bin + +## Open a Project in the SDK + +Use the `cordova` utility to set up a new project, as described in The +Cordova The Command-Line Interface. For example, in a source-code directory: + + $ cordova create hello com.example.hello "HelloWorld" + $ cd hello + $ cordova platform add android + $ cordova build + +Once created, you can use the Eclipse that comes along with the Android SDK to modify it: + +* Launch the __Eclipse__ application. + +* Select the __New Project__ menu item. + +* Choose __Android Project from Existing Code__ from the resulting dialog box, and press __Next__: + ![](img/guide/platforms/android/eclipse_new_project.png) + +* Navigate to `hello`, or whichever directory you created for the project, then to the `platforms/android` subdirectory. + +* Make sure both `hello` and `hello-CordovaLib` projects are selected to be imported. The `hello-CordovaLib` project is needed as of Cordova 3.3.0 because Cordova is now used as an Android Library instead of a .jar file. + +* Press __Finish__. + +Once the Eclipse window opens, a red __X__ may appear to indicate +unresolved problems. If so, follow these additional steps: + +* Right-click on the project directory. + +* In the resulting __Properties__ dialog, select __Android__ from the navigation pane. + +* For the project build target, select the highest Android API level you have installed. + +* Click __OK__. + +* Select __Clean__ from the __Project__ menu. This should correct all the errors in the project. + +## Deploy to Emulator + +You can use the `cordova` utility to run an app in an emulator, or you +can run it within the SDK. Either way, the SDK must first be +configured to display at least one device. To do so, use the Android +SDK Manager, a Java application that runs separately from Eclipse. +There are two ways to open it: + +* Run `android` on the command line. + +* From within Eclipse, press this toolbar icon: + + ![](img/guide/platforms/android/eclipse_android_sdk_button.png) + +Once open, the Android SDK Manager displays various runtime libraries: + +![](img/guide/platforms/android/asdk_window.png) + +Choose __Tools → Manage AVDs__ (Android Virtual Devices), then +choose any item from __Device Definitions__ in the resulting dialog +box: + +![](img/guide/platforms/android/asdk_device.png) + +Press __Create AVD__, optionally modifying the name, then press __OK__ +to accept the changes: + +![](img/guide/platforms/android/asdk_newAVD.png) + +The AVD then appears in the __Android Virtual Devices__ list: + +![](img/guide/platforms/android/asdk_avds.png) + +To open the emulator as a separate application, select the AVD and +press __Start__. It launches much as it would on the device, with +additional controls available for hardware buttons: + +![](img/guide/platforms/android/asdk_emulator.png) + +At this point you can use the `cordova` utility to deploy the +application to the emulator from the command line: + + $ cordova emulate android + +If instead you work within Eclipse, right-click the project and +choose __Run As → Android Application__. You may be asked to +specify an AVD if none are already open. + +For a faster experience, you can use the `Virtual Machine Acceleration` to improve +the execution speed. +Many modern CPUs provide extensions to execute Virtual Machines more efficiently. +Before attempting to use this type of acceleration, you need to determine if your +current development system's CPU, supports one the following virtualization technologies: + +* __Intel Virtualization Technology__ (VT-x, vmx) → [Intel VT-x supported processor list](http://ark.intel.com/products/virtualizationtechnology) +* __AMD Virtualization__ (AMD-V, SVM), only supported for Linux (Since May 2006, all CPUs AMD include AMD-V, except Sempron). + +Another way to find out if your Intel processor supports VT-x Technology, it's by executing the +`Intel Processor Identification Utility`, for `Windows`you can download it from the Intel [Download Center](https://downloadcenter.intel.com/Detail_Desc.aspx?ProductID=1881&DwnldID=7838), +or you can use the [booteable utility](https://downloadcenter.intel.com/Detail_Desc.aspx?ProductID=1881&DwnldID=7840&lang=eng), which is `OS Independent`. + +After install and execute the `Intel Processor Identification Utility` over Windows, you will get the following window, +in order to check if your CPU supports the Virtualization Technologies: + +![](img/guide/platforms/android/intel_pid_util_620px.png) + +In order to speed up the emulator, you need to download and install one or more `Intel x86 Atom` System Images, +as well as the `Intel Hardware Accelerated Execution Manager (HAXM)`. + +Open your Android SDK Manager, and select the `Intel x86 Atom` System Image, for whichever version that you want to test. Then go to `Extras` +and select `Intel x86 Emulator Accelerator (HAXM)`, and install those packages: + +![](img/guide/platforms/android/asdk_man_intel_image_haxm.png) + +After download, run the Intel installer, which is available within your +Android SDK at `extras/intel/Hardware_Accelerated_Execution_Manager`. +__Note__:`If you have any problems installing the package, you can find more information and step by step guidance check this` +[Intel Article](http://software.intel.com/en-us/android/articles/speeding-up-the-android-emulator-on-intel-architecture). + +Once installed, in order to test it, create new a AVD with the `CPU/ABI` set to an `Intel (Atom) x86` Image: + +![](img/guide/platforms/android/asdk_new_and_dev_intel.png) + +If you are using `Linux-based system`, follow the instructions in the [Android Developer Site](http://developer.android.com/tools/devices/emulator.html#vm-linux). + +When starting the emulator, ensure there are no error messages indicating a failure to load HAXM modules. + +## Deploy to Device + +To push an app directly to the device, make sure USB debugging is +enabled on your device as described on the +[Android Developer Site](http://developer.android.com/tools/device.html), +and use a mini USB cable to plug it into your system. + +You can push the app to the device from the command line: + + $ cordova run android + +Alternately within Eclipse, right-click the project and choose __Run +As → Android Application__. diff --git a/docs/jp/3.4.0/guide/platforms/android/plugin.md b/docs/jp/3.4.0/guide/platforms/android/plugin.md new file mode 100644 index 0000000000..55e0fe1e8b --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/android/plugin.md @@ -0,0 +1,240 @@ +--- +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. +--- + +# Android Plugins + +This section provides details for how to implement native plugin code +on the Android platform. Before reading this, see Application Plugins +for an overview of the plugin's structure and its common JavaScript +interface. This section continues to demonstrate the sample _echo_ +plugin that communicates from the Cordova webview to the native +platform and back. For another sample, see also the comments in +[CordovaPlugin.java](https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/CordovaPlugin.java). + +Android plugins are based on Cordova-Android, which consists of an +Android WebView with hooks attached to it. Plugins are represented as +class mappings in the `config.xml` file. A plugin consists of at +least one Java class that extends the `CordovaPlugin` class, +overriding one of its `execute` methods. As best practice, the plugin +should also handle `pause` and `resume` events, along with any message +passing between plugins. Plugins with long-running requests, +background activity such as media playback, listeners, or internal +state should implement the `onReset()` method as well. It executes +when the `WebView` navigates to a new page or refreshes, which reloads +the JavaScript. + +## Plugin Class Mapping + +The plugin's JavaScript interface uses the `cordova.exec` method as +follows: + + exec(, , , , []); + +This marshals a request from the WebView to the Android native side, +effectively calling the `action` method on the `service` class, with +additional arguments passed in the `args` array. + +Whether you distribute a plugin as Java file or as a _jar_ file of its +own, the plugin must be specified in your Cordova-Android +application's `res/xml/config.xml` file. See Application Plugins for +more information on how to use the `plugin.xml` file to inject this +`feature` element: + + + + + +The service name matches the one used in the JavaScript `exec` call. +The value is the Java class's fully qualified namespace identifier. +Otherwise, the plugin may compile but still be unavailable to Cordova. + +## Plugin Initialization and Lifetime + +One instance of a plugin object is created for the life of each +`WebView`. Plugins are not instantiated until they are first +referenced by a call from JavaScript, unless `` with an `onload` +`name` attribute is set to `"true"` in `config.xml`. E.g.: + + + + + + +Plugins should use the `initialize` method for their start-up logic. + + @override + public void initialize(CordovaInterface cordova, CordovaWebView webView) { + super.initialize(cordova, webView); + // your init code here + } + +## Writing an Android Java Plugin + +A JavaScript call fires off a plugin request to the native side, and +the corresponding Java plugin is mapped properly in the `config.xml` +file, but what does the final Android Java Plugin class look like? +Whatever is dispatched to the plugin with JavaScript's `exec` function +is passed into the plugin class's `execute` method. Most `execute` +implementations look like this: + + @Override + public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { + if ("beep".equals(action)) { + this.beep(args.getLong(0)); + callbackContext.success(); + return true; + } + return false; // Returning false results in a "MethodNotFound" error. + } + +The JavaScript `exec` function's `action` parameter corresponds to a +private class method to dispatch with optional parameters. + +When catching exceptions and returning errors, it's important for the +sake of clarity that errors returned to JavaScript match Java's +exception names as much as possible. + +## Threading + +The plugin's JavaScript does _not_ run in the main thread of the +`WebView` interface; instead, it runs on the `WebCore` thread, as +does the `execute` method. If you need to interact with the user +interface, you should use the following variation: + + @Override + public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException { + if ("beep".equals(action)) { + final long duration = args.getLong(0); + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + ... + callbackContext.success(); // Thread-safe. + } + }); + return true; + } + return false; + } + +Use the following if you do not need to run on the main interface's +thread, but do not want to block the `WebCore` thread either: + + @Override + public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException { + if ("beep".equals(action)) { + final long duration = args.getLong(0); + cordova.getThreadPool().execute(new Runnable() { + public void run() { + ... + callbackContext.success(); // Thread-safe. + } + }); + return true; + } + return false; + } + +## Echo Android Plugin Example + +To match the JavaScript interface's _echo_ feature described in +Application Plugins, use the `plugin.xml` to inject a `feature` +specification to the local platform's `config.xml` file: + + + + + + + + + +Then add the following to the +`src/org/apache/cordova/plugin/Echo.java` file: + + package org.apache.cordova.plugin; + + import org.apache.cordova.CordovaPlugin; + import org.apache.cordova.CallbackContext; + + import org.json.JSONArray; + import org.json.JSONException; + import org.json.JSONObject; + + /** + * This class echoes a string called from JavaScript. + */ + public class Echo extends CordovaPlugin { + + @Override + public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { + if (action.equals("echo")) { + String message = args.getString(0); + this.echo(message, callbackContext); + return true; + } + return false; + } + + private void echo(String message, CallbackContext callbackContext) { + if (message != null && message.length() > 0) { + callbackContext.success(message); + } else { + callbackContext.error("Expected one non-empty string argument."); + } + } + } + +The necessary imports at the top of the file extends the class from +`CordovaPlugin`, whose `execute()` method it overrides to receive +messages from `exec()`. The `execute()` method first tests the value +of `action`, for which in this case there is only one valid `echo` +value. Any other action returns `false` and results in an +`INVALID_ACTION` error, which translates to an error callback invoked +on the JavaScript side. + +Next, the method retrieves the echo string using the `args` object's +`getString` method, specifying the first parameter passed to the +method. After the value is passed to a private `echo` method, it is +parameter-checked to make sure it is not `null` or an empty string, in +which case `callbackContext.error()` invokes JavaScript's error +callback. If the various checks pass, the `callbackContext.success()` +passes the original `message` string back to JavaScript's success +callback as a parameter. + +## Android Integration + +Android features an `Intent` system that allows processes to +communicate with each other. Plugins have access to a +`CordovaInterface` object, which can access the Android `Activity` +that runs the application. This is the `Context` required to launch a +new Android `Intent`. The `CordovaInterface` allows plugins to start +an `Activity` for a result, and to set the callback plugin for when +the `Intent` returns to the application. + +As of Cordova 2.0, Plugins can no longer directly access the +`Context`, and the legacy `ctx` member is deprecated. All `ctx` +methods exist on the `Context`, so both `getContext()` and +`getActivity()` can return the required object. + +## Debugging Android Plugins + +Eclipse allows you to debug plugins as Java source included in the +project. Only the latest version of the Android Developer Tools +allows you to attach source code to _JAR_ dependencies, so this +feature is not yet fully supported. diff --git a/docs/jp/3.4.0/guide/platforms/android/tools.md b/docs/jp/3.4.0/guide/platforms/android/tools.md new file mode 100644 index 0000000000..e62408906a --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/android/tools.md @@ -0,0 +1,85 @@ +--- +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. +--- + +# Android Command-line Tools + +The `cordova` command-line utility is a high-level tool that allows +you to build applications across several platforms at once. An older +version of the Cordova framework provides sets of command-line tools +specific to each platform. To use them as an alternative to the CLI, +you need to download this version of Cordova from +[cordova.apache.org](http://cordova.apache.org). The download contains +separate archives for each platform. Expand the platform you wish to +target. The tools described here are typically available in the +top-level `bin` directory, otherwise consult the __README__ file for +more detailed directions. + +For information on the low-level command-line interface that enables +plugins, see Using Plugman to Manage Plugins. See Application Plugins +for an overview. + +## Create a Project + +Run the `create` command, specifying the existing path to the project, +the reverse-domain-style package identifier, and the app's display +name. Here is the syntax for both Mac and Windows: + + $ /path/to/cordova-android/bin/create /path/to/project com.example.project_name ProjectName + $ C:\path\to\cordova-android\bin\create.bat C:\path\to\project com.example.project_name ProjectName + +## Build + +This cleans then builds a project. + +Debug, on Mac or Windows: + + $ /path/to/project/cordova/build --debug + $ C:\path\to\project\cordova\build.bat --debug + +Release, on Mac or Windows: + + $ /path/to/project/cordova/build --release + $ C:\path\to\project\cordova\build.bat --release + +## Run the App + +The `run` command accepts the following _optional_ parameters: + +* Target specification. This includes `--emulator`, `--device`, or `--target=`. + +* Build specification. This includes `--debug`, `--release`, or `--nobuild`. + + $ /path/to/project/cordova/run [Target] [Build] + $ C:\path\to\project\cordova\run.bat [Target] [Build] + +Make sure you create at least one Android Virtual Device, otherwise +you're prompted to do so with the `android` command. If more than one +AVD is available as a target, you're prompted to select one. By +default the `run` command detects a connected device, or a currently +running emulator if no device is found. + +## Logging + + $ /path/to/project/cordova/log + $ C:\path\to\project\cordova\log.bat + +### Cleaning + + $ /path/to/project/cordova/clean + $ C:\path\to\project\cordova\clean.bat diff --git a/docs/jp/3.4.0/guide/platforms/android/upgrading.md b/docs/jp/3.4.0/guide/platforms/android/upgrading.md new file mode 100644 index 0000000000..2509ba3382 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/android/upgrading.md @@ -0,0 +1,454 @@ +--- +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. +--- + +# Upgrading Android + +This guide shows how to modify Android projects to upgrade from older versions of Cordova. +Most of these instructions apply to projects created with an older set +of command-line tools that precede the `cordova` CLI utility. See The Command-Line Interface for information how to update the +version of the CLI. + +## Upgrading to 3.3.0 from 3.2.0 + +Follow the same instructions as for `3.2.0`. + +Starting with 3.3.0, the Cordova runtime is now compiled as an Android Library +instead of a Jar. This should have no effect for command-line usage, but IDE +users will need to import the newly added `MyProject-CordovaLib` project into +their workspace. + +## Upgrading to 3.2.0 from 3.1.0 + +For projects that were created with the cordova CLI: + +1. Update the `cordova` CLI version. See The Command-Line Interface. + +2. Run `cordova platform update android` + +For projects not created with the cordova CLI, run: + + bin/update + +**WARNING:** Starting on Android 4.4, creating a file input element with type="file" will not open the file picker dialog. +This is a regression with Chromium on Android and the problem can be reproduced in the standalone Chrome browser on Android (see http://code.google.com/p/android/issues/detail?id=62220) The suggested workaround is to use the FileTransfer and File plugins for Android 4.4. You can listen for an onClick event from the input type="file" and then pop up a file picker UI. In order to tie the form data with the upload, you can use JavaScript to attach form values to the multi-part POST request that FileTransfer makes. This bug still exists as of Android 4.4.2 + + +## Upgrading to 3.1.0 from 3.0.0 + +For projects that were created with the cordova CLI: + +1. Update the `cordova` CLI version. See The Command-Line Interface. + +2. Run `cordova platform update android` + +For projects not created with the cordova CLI, run: + + bin/update + +## Upgrade to the CLI (3.0.0) from 2.9.0 + +1. Create a new Apache Cordova 3.0.0 project using the cordova CLI, as + described in The Command-Line Interface. + +2. Add your platforms the cordova project, for example: `cordova + platform add android`. + +3. Copy the contents of your project's `www` directory to the `www` directory + at the root of the cordova project you just created. + +4. Copy any native assets from your old project into the appropriate + directories under `platforms/android`: this directory is where your + native cordova-android project exists. + +5. Use the cordova CLI tool to install any plugins you need. Note that + the CLI handles all core APIs as plugins, so they may need to be + added. Only 3.0.0 plugins are compatible with the CLI. + +## Upgrade to 3.0.0 from 2.9.0 + +1. Create a new Apache Cordova Android project. + +2. Copy the contents of your `www` directory to the new project. + +3. Copy any native Android assets from your `res` directory to the new project. + +4. Copy over any plugins you installed from the `src` subdirectories into the new project. + +5. Make sure to upgrade any deprecated `` references from your old `config.xml` file to the new `` specification. + +6. Update any references to the `org.apache.cordova.api` package to be `org.apache.cordova`. + + __NOTE__: all core APIs have been removed and must be installed as plugins. Please see the Using Plugman to Manage Plugins Guide for details. + +## Upgrade to 2.9.0 from 2.8.0 + +1. Run `bin/update `. + +## Upgrade to 2.8.0 from 2.7.0 + +1. Remove `cordova-2.7.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.8.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + + + +4. Copy the new `cordova.js` into your project. + +5. Update your HTML to use the new `cordova.js` file. + +6. Copy the `res/xml/config.xml` file to match `framework/res/xml/config.xml`. + +7. Update `framework/res/xml/config.xml` to have similar settings as it did previously. + +8. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +## Upgrade to 2.7.0 from 2.6.0 + +1. Remove `cordova-2.6.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.7.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.7.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.7.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +7. Update `framework/res/xml/config.xml` to have similar settings as it did previously. + +8. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +## Upgrade to 2.6.0 from 2.5.0 + +1. Remove `cordova-2.5.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.6.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.6.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.6.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +7. Update `framework/res/xml/config.xml` to have similar settings as it did previously. + +8. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +Run `bin/update ` with the project path listed in the Cordova Source directory. + +## Upgrade to 2.5.0 from 2.4.0 + +1. Remove `cordova-2.4.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.5.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.5.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.5.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +7. Update `framework/res/xml/config.xml` to have similar settings as it did previously. + +8. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +## Upgrade to 2.4.0 from 2.3.0 + +1. Remove `cordova-2.3.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.4.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.4.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.4.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +7. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +## Upgrade to 2.3.0 from 2.2.0 + +1. Remove `cordova-2.2.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.3.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.3.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.3.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +7. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +## Upgrade to 2.2.0 from 2.1.0 + +1. Remove `cordova-2.1.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.2.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.2.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.2.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +7. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +## Upgrade to 2.1.0 from 2.0.0 + +1. Remove `cordova-2.0.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.1.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.1.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.1.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +7. Copy files from `bin/templates/cordova` to the project's `cordova` directory. + +## Upgrade to 2.0.0 from 1.9.0 + +1. Remove `cordova-1.9.0.jar` from the project's `libs` directory. + +2. Add `cordova-2.0.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-2.0.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.0.0.js` file. + +6. Copy the `res/xml/config.xml` to match `framework/res/xml/config.xml`. + +In the 2.0.0 release, the `config.xml` file combines and replaces +`cordova.xml` and `plugins.xml`. The old files are deprecated, and +while they still work in 2.0.0, will stop working in a future release. + +## Upgrade to 1.9.0 from 1.8.1 + +1. Remove `cordova-1.8.0.jar` from the project's `libs` directory. + +2. Add `cordova-1.9.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.9.0.js` into your project. + +5. Update your HTML to use the new `cordova-1.9.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +Due to the introduction of the `CordovaWebView` in the 1.9.0 release, +third-party plugins may not work. These plugins need to get a context +from the `CordovaInterface` using `getContext()` or `getActivity()`. +If you are not an experienced Android developer, please contact the +plugin maintainer and add this task to their bug tracker. + +## Upgrade to 1.8.0 from 1.8.0 + +1. Remove `cordova-1.8.0.jar` from the project's `libs` directory. + +2. Add `cordova-1.8.1.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.8.1.js` into your project. + +5. Update your HTML to use the new `cordova-1.8.1.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +## Upgrade to 1.8.0 from 1.7.0 + +1. Remove `cordova-1.7.0.jar` from the project's `libs` directory. + +2. Add `cordova-1.8.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.8.0.js` into your project. + +5. Update your HTML to use the new `cordova-1.8.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +## Upgrade to 1.8.0 from 1.7.0 + +1. Remove `cordova-1.7.0.jar` from the project's `libs` directory. + +2. Add `cordova-1.8.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.8.0.js` into your project. + +5. Update your HTML to use the new `cordova-1.8.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +## Upgrade to 1.7.0 from 1.6.1 + +1. Remove `cordova-1.6.1.jar` from the project's `libs` directory. + +2. Add `cordova-1.7.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.7.0.js` into your project. + +5. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +## Upgrade to 1.6.1 from 1.6.0 + +1. Remove `cordova-1.6.0.jar` from the project's `libs` directory. + +2. Add `cordova-1.6.1.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.6.1.js` into your project. + +5. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +## Upgrade to 1.6.0 from 1.5.0 + +1. Remove `cordova-1.5.0.jar` from the project's `libs` directory. + +2. Add `cordova-1.6.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.6.0.js` into your project. + +5. Update your HTML to use the new `cordova-1.6.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +7. Replace `res/xml/phonegap.xml` with `res/xml/cordova.xml` to match `framework/res/xml/cordova.xml`. + +## Upgrade to 1.5.0 from 1.4.0 + +1. Remove `phonegap-1.4.0.jar` from the project's `libs` directory. + +2. Add `cordova-1.5.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `cordova-1.5.0.js` into your project. + +5. Update your HTML to use the new `cordova-1.5.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +7. Replace `res/xml/phonegap.xml` with `res/xml/cordova.xml` to match `framework/res/xml/cordova.xml`. + +## Upgrade to 1.4.0 from 1.3.0 + +1. Remove `phonegap-1.3.0.jar` from the project's `libs` directory. + +2. Add `phonegap-1.4.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `phonegap-1.4.0.js` into your project. + +5. Update your HTML to use the new `phonegap-1.4.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +7. Update `res/xml/phonegap.xml` to match `framework/res/xml/phonegap.xml`. + +## Upgrade to 1.3.0 from 1.2.0 + +1. Remove `phonegap-1.2.0.jar` from the project's `libs` directory. + +2. Add `phonegap-1.3.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `phonegap-1.3.0.js` into your project. + +5. Update your HTML to use the new `phonegap-1.2.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +7. Update `res/xml/phonegap.xml` to match `framework/res/xml/phonegap.xml`. + +## Upgrade to 1.2.0 from 1.1.0 + +1. Remove `phonegap-1.1.0.jar` from the project's `libs` directory. + +2. Add `phonegap-1.2.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `phonegap-1.2.0.js` into your project. + +5. Update your HTML to use the new `phonegap-1.2.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +7. Update `res/xml/phonegap.xml` to match `framework/res/xml/phonegap.xml`. + +## Upgrade to 1.1.0 from 1.0.0 + +1. Remove `phonegap-1.0.0.jar` from the project's `libs` directory. + +2. Add `phonegap-1.1.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `phonegap-1.1.0.js` into your project. + +5. Update your HTML to use the new `phonegap-1.1.0.js` file. + +6. Update `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + +## Upgrade to 1.0.0 from 0.9.6 + +1. Remove `phonegap-0.9.6.jar` from the project's `libs` directory. + +2. Add `phonegap-1.0.0.jar` to the project's `libs` directory. + +3. If you use Eclipse, please refresh your Eclipse project and do a clean. + +4. Copy the new `phonegap-1.0.0.js` into your project. + +5. Update your HTML to use the new `phonegap-1.0.0.js` file. + +6. Add the `res/xml/plugins.xml` to match `framework/res/xml/plugins.xml`. + diff --git a/docs/jp/3.4.0/guide/platforms/android/webview.md b/docs/jp/3.4.0/guide/platforms/android/webview.md new file mode 100644 index 0000000000..bb3a7138c3 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/android/webview.md @@ -0,0 +1,131 @@ +--- +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. +--- + +# Android WebViews + +This section shows how to embed a Cordova-enabled WebView component +within a larger Android application. For details on how these +components can communicate with each other, see Application Plugins. + +If you're unfamiliar with Android, you should first familiarize +yourself with the Android Platform Guide and have the latest Android +SDK installed before you attempt the more unusual development option +of embedding a WebView. Starting with Cordova 1.9, the Android +platform relies on a `CordovaWebView` component, which builds on a +legacy `CordovaActivity` component that pre-dates the 1.9 release. + +1. To follow these instructions, make sure you have the latest Cordova + distribution. Download it from + [cordova.apache.org](http://cordova.apache.org) and unzip its + Android package. + +1. Navigate to the Android package's `/framework` directory and run + `ant jar`. It creates the Cordova `.jar` file, formed as + `/framework/cordova-3.4.0.jar`. + +1. Copy the `.jar` file into the Android project's `/libs` directory. + +1. Add the following to the application's `/res/xml/main.xml` file, + with the `layout_height`, `layout_width` and `id` modified to suit + the application: + + + +1. Modify the activity so that it implements the `CordovaInterface`. + It should implement the included methods. You may wish to copy + them from `/framework/src/org/apache/cordova/CordovaActivity.java`, + or else implement them on your own. The following code fragment + shows a basic application that relies on the interface. Note how + the referenced view id matches the `id` attribute specified in the + XML fragment shown above: + + public class CordovaViewTestActivity extends Activity implements CordovaInterface { + CordovaWebView cwv; + /* Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + cwv = (CordovaWebView) findViewById(R.id.tutorialView); + Config.init(this); + cwv.loadUrl(Config.getStartUrl()); + } + +1. If the application needs to use the camera, implement the + following: + + @Override + public void setActivityResultCallback(CordovaPlugin plugin) { + this.activityResultCallback = plugin; + } + /** + * Launch an activity for which you would like a result when it finished. When this activity exits, + * your onActivityResult() method is called. + * + * @param command The command object + * @param intent The intent to start + * @param requestCode The request code that is passed to callback to identify the activity + */ + public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) { + this.activityResultCallback = command; + this.activityResultKeepRunning = this.keepRunning; + + // If multitasking turned on, then disable it for activities that return results + if (command != null) { + this.keepRunning = false; + } + + // Start activity + super.startActivityForResult(intent, requestCode); + } + + @Override + /** + * Called when an activity you launched exits, giving you the requestCode you started it with, + * the resultCode it returned, and any additional data from it. + * + * @param requestCode The request code originally supplied to startActivityForResult(), + * allowing you to identify who this result came from. + * @param resultCode The integer result code returned by the child activity through its setResult(). + * @param data An Intent, which can return result data to the caller (various data can be attached to Intent "extras"). + */ + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { + super.onActivityResult(requestCode, resultCode, intent); + CordovaPlugin callback = this.activityResultCallback; + if (callback != null) { + callback.onActivityResult(requestCode, resultCode, intent); + } + } + +1. Finally, remember to add the thread pool, otherwise plugins + have no threads on which to run: + + @Override + public ExecutorService getThreadPool() { + return threadPool; + } + +1. Copy the application's HTML and JavaScript files to the Android + project's `/assets/www` directory. + +1. Copy the `config.xml` file from `/framework/res/xml` to the + project's `/res/xml` directory. diff --git a/docs/jp/3.4.0/guide/platforms/blackberry10/config.md b/docs/jp/3.4.0/guide/platforms/blackberry10/config.md new file mode 100644 index 0000000000..0749eb6a86 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/blackberry10/config.md @@ -0,0 +1,51 @@ +--- +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. +--- + +# BlackBerry 10 Configuration + +The `config.xml` file controls an app's basic settings that apply +across each application and CordovaWebView instance. This section +details preferences that only apply to BlackBerry 10 builds. See The +config.xml File for information on global configuration options. + +- `ChildBrowser` (`disable` or the default `enable`): Disables child + browser windows. By default, apps launch a secondary browser window + to display resources accessed via `window.open()` or by specifying a + `_blank` anchor target. Specify `disable` to override this default + behavior. + + + +- `PopupBlocker` (`enable` or the default `disable`): Enables the + popup blocker, which prevents calls to `window.open()`. By default, + popups display in a child browser window. Setting the preference to + `enable` prevents it from displaying at all. + + + +- `WebSecurity` (`disable` or the default `enable`): Set to `disable` + to override web security settings, allowing access to remote content + from unknown sources. This preference is intended as a development + convenience only, so remove it before packaging your app for + distribution. For the released app, all URIs should be known and + whitelisted using the `` element, described in the Domain + Whitelist Guide. + + + diff --git a/docs/jp/3.4.0/guide/platforms/blackberry10/index.md b/docs/jp/3.4.0/guide/platforms/blackberry10/index.md new file mode 100644 index 0000000000..5e6bed79a9 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/blackberry10/index.md @@ -0,0 +1,199 @@ +--- +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. +--- + +# BlackBerry 10 Platform Guide + +This guide shows how to set up your development environment to build +and deploy Cordova apps for BlackBerry 10 devices. For previous +versions of BlackBerry, you need to use a different set of +command-line tools, described in BlackBerry Platform Guide. + +## Requirements + +The development environment is available on Windows, Mac and Linux. + +Developers should use the `cordova` utility in conjunction with the +Blackberry Native SDK. See The Command-Line Interface for information +how to install `cordova`, add projects, then build and deploy for each +platform. + +Blackberry 10 Device Simulator: + + * `Processor:`Intel dual core 2.0 GHz/AMD Athlon 4200+ or higher + * `Disk space: 10 GB` + * `RAM Memory: 4 GB` + * `Virtualization: + * __Intel Virtualization Technology__ (VT, VT-x, vmx) → [Intel VT-x supported processor list](http://ark.intel.com/products/virtualizationtechnology) + * __AMD Virtualization__ (AMD-V, SVM) (Since May 2006, all CPUs AMD include AMD-V, except Sempron). + +More information about requirements: [BB10 Simulator requeriments](http://developer.blackberry.com/devzone/develop/simulator/simulator_systemrequirements.html). + +## Install the BlackBerry Native SDK + +In order to get the BlackBerry Native SDK, download and install the IDE for Blackberry available from +[developer.blackberry.com](http://developer.blackberry.com/native/download/), then using the IDE, install the Blackberry Native SDK. +Following installation, you need to add its command-line tools to your +system path. + +On Windows: + +* Go to __My Computer → Properties → Advanced → Environment Variables__. + +* Append the Native SDK's install directory to the PATH, for example: + + ;C:\bbndk\host_10_2_0_132\darwin\x86\usr\bin\ + +On Mac and Linux: + +* Edit the `~/.bash_profile` file, adding a line such as the + following, depending on where the Native SDK was installed: + + $ export PATH=${PATH}:/Applications/Momentics.app/host_10_2_0_15/darwin/x86/usr/bin/ + +* Run the following to apply the change in the current session: + + $ source ~/.bash_profile + +If you got any environmental problem, using the Native SDK from the command line, execute the appropriate file for your platform, located within the installation path: + + * On Windows: + $ `\bbndk\bbndk-env_xx_xx_xx_xxxx.bat` + + * On Linux → Installed as root user: + $ `./opt/bbndk/bbndk-env_xx_xx_xx_xxxx.sh` + + * On Linux → Installed as non-root user: + $ `./home/username/bbndk/bbndk-env_xx_xx_xx_xxxx.sh` + + * On Mac: + $ `/Developer/SDKs/bbndk/bbndk-env_xx_xx_xx_xxxx.sh` + + +## Set up for Signing + +If you wish to test on a device or distribute apps through BlackBerry +World, your system must be setup for code signing. + +To obtain a signing key, go to the [BlackBerry Keys Order Form] (https://www.blackberry.com/SignedKeys/codesigning.html). + +Select the first checkbox: "for BlackBerry10 apps developed using BlackBerry +NDK" and then sign in or create a BBID. + +Enter a password and click "Get Token" to download bbidtoken.csk. Save this +file to the default location for your OS which will be displayed on the +download page. + +The final step is to generate a signing certificate: + + $ blackberry-keytool -genkeypair -storepass -author 'Your Name’ + +## Create a Project + +Use the `cordova` utility to set up a new project, as described in The +Command-Line Interface. For example, in a source-code directory: + + $ cordova create hello com.example.hello + $ cd hello + $ cordova platform add blackberry10 + $ cordova build + +## Deploy to Emulator + +If you wish to run a device emulator, download and install the +BlackBerry 10 Simulator. + +* [Download](http://developer.blackberry.com/native/download/) +* [Getting Started](http://developer.blackberry.com/devzone/develop/simulator/blackberry_10_simulator_start.html) + +Before testing an app on either an emulator or a device, you need to +enable development mode. + +Launch the emulator image, then choose __Settings__ from the home screen: + +![](img/guide/platforms/blackberry10/bb_home.png) + +Navigate to the __Security and Privacy → Development Mode__ +section and enable the option: + +![](img/guide/platforms/blackberry10/bb_devel.png) + +Then, run the `emulate` command to view the app: + + $ cordova emulate blackberry10 --devicepass + +## Deploy to Device + +To deploy to a device, make sure it is plugged into your computer and +development mode is enabled. + +Then, run the `run` command to view the app: + + $ cordova run blackberry10 --devicepass + +If a debug token is not yet set up for the device, an error message +prompts you to provide the password you defined when configuring your +computer to sign applications. + + $ cordova run blackberry10 --devicepass --keystorepass + +## Debugging with WebInspector + +When debugging on the device or an emulator, you may run WebInspector +remotely to view the application's internal state. A prompt displays +the URL that allows you to connect to your app with a standard web +browser. For more information, see +[Debugging using WebInspector](http://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html). + +## Building a Release Version + +By default, running the `cordova build` command creates an unsigned +_.bar_ package file suitable for testing on a device or simulator. + +Use `--release` to create a release version suitable for distribution +through BlackBerry World. + + $ cordova build --release --keystorepass + +The `--keystorepass` option specifies the password you defined when +configuring your computer to sign applications. + + +## Deploy to Other Locations + +The instructions above assume a device is plugged in via USB or a +simulator is running on the local machine. It is also possible to +deploy to other locations. + +An additional set of command-line utilities are included when you set +up the BlackBerry 10 platform for your project. The following +command, in this case invoked from the project top-level directory, +associates a target named _emu_ with an IP address. + +* On Windows: + + $ platforms\blackberry10\cordova\target.bat add emu 192.168.2.24 -t simulator + +* On Mac/Linux: + + $ platforms/blackberry10/cordova/target add emu 192.168.2.24 -t simulator + +Once the target is defined, you can provide it to the run command using +`--target`: + + $ cordova run blackberry10 --target=emu diff --git a/docs/jp/3.4.0/guide/platforms/blackberry10/plugin.md b/docs/jp/3.4.0/guide/platforms/blackberry10/plugin.md new file mode 100644 index 0000000000..8dd06beb50 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/blackberry10/plugin.md @@ -0,0 +1,255 @@ +--- +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. +--- + +# BlackBerry 10 Plugins + +This section provides details for how to implement native plugin code +on the BlackBerry 10 platform. Before reading this, see Application +Plugins for an overview of the plugin's structure and its common +JavaScript interface. This section continues to demonstrate the sample +_echo_ plugin that communicates from the Cordova webview to the native +platform and back. + +The Echo plugin basically returns whatever string the `window.echo` +function sends from JavaScript: + + window.echo = function(str, callback) { + cordova.exec(callback, function(err) { + callback('Nothing to echo.'); + }, "Echo", "echo", [str]); + }; + +A Cordova plugin for BlackBerry 10 contains both JavaScript and native +code, which communicate with each other through a framework provided +by JNEXT. Every plugin must also include a `plugin.xml` file. + +## Creating the Native Class + +To create the native portion of your plugin, open the BlackBerry 10 +NDK IDE and select __File → New → BlackBerry Project → +Native Extension → BlackBerry 10__. Enter the desired +project name and location, then press __Finish__. + +The project created by the IDE contains sample code for a memory +plugin. You may replace or modify these files to implement your own +functionality: + +- `*name*_js.hpp`: C++ header for the JNEXT code. + +- `*name*_js.cpp`: C++ code for JNEXT. + +The native interface for the JNEXT extension can be viewed in the +plugin header file located in the project's public directory. It also +features constants and utility functions available from within native +code. The plugin must be derived from `JSExt`, which is defined in +`plugin.h`. That is, you must implement the following class: + + class JSExt + { + public: + virtual ~JSExt() {}; + virtual string InvokeMethod( const string& strCommand ) = 0; + virtual bool CanDelete( void ) = 0; + private: + std::string m_id; + }; + +The extension should include the `plugin.h` header file. In the `Echo` +example, you use `JSExt` as follows in the `echo_js.hpp` file: + + #include "../public/plugin.h" + #include + + #ifndef ECHO_JS_H_ + #define ECHO_JS_H_ + + class Echo : public JSExt + { + public: + explicit Echo(const std::string& id); + virtual ~Echo(); + virtual std::string InvokeMethod(const std::string& command); + virtual bool CanDelete(); + private: + std::string m_id; + }; + + #endif // ECHO_JS_H_ + +The `m_id` attribute contains the `JNEXT` id for the object, which is +passed to the class as an argument to the constructor. It is needed +for the native side to trigger events on the JavaScript side. The +`CanDelete` method determines whether the native object can be +deleted. The `InvokeMethod` function is called as a result from a +request from JavaScript to invoke a method of this particular +object. The only argument to this function is a string passed from +JavaScript that this method parses to determine which of the native +object's methods should execute. These methods are implemented in +`echo_js.cpp`. Here is the `InvokeMethod` function for the `Echo` +example: + + string Echo::InvokeMethod(const string& command) { + + //parse command and args from string + int index = command.find_first_of(" "); + string strCommand = command.substr(0, index); + string strValue = command.substr(index + 1, command.length()); + + // Determine which function should be executed + if (strCommand == "echo") { + return strValue; + } else { + return "Unsupported Method"; + } + } + +The native plugin must also implement the following callback +functions: + +- `extern char* onGetObjList( void );` + +- `extern JSExt* onCreateObject( const string& strClassName, const string& strObjId );` + +The `onGetObjList` function returns a comma-separated list of classes +supported by JNEXT. JNEXT uses this function to determine the set of +classes that JNEXT can instantiate. The `Echo` plugin implements the +following in `echo_js.cpp`: + + char* onGetObjList() { + static char name[] = "Echo"; + return name; + } + +The `onCreateObject ` function takes two parameters. The first is the +name of the requested class to be created from the JavaScript side, +with valid names as those returned in `onGetObjList`. The second +parameter is the class's unique object id. This method returns a +pointer to the created plugin object. The `Echo` plugin implements the +following in `echo_js.cpp`: + + JSExt* onCreateObject(const string& className, const string& id) { + if (className == "Echo") { + return new Echo(id); + } + return NULL; + } + +## Creating the Plugin's JavaScript + +The plugin must contain the following JavaScript files: + +- `client.js`: This is considered the client side and contains the API + available to a Cordova application. The API in `client.js` calls + makes calls to `index.js`. The API in `client.js` also connects + callback functions to the events that fire the callbacks. + +- `index.js`: Cordova loads `index.js` and makes it accessible through + the cordova.exec bridge. The `client.js` file makes calls to the API + in the `index.js` file, which in turn makes call to JNEXT to + communicate with the native side. + +The client and server side (`client.js` and `index.js`) interacts +through the `Cordova.exec` function. The `client.js` needs to invoke +the `exec` function and provide the necessary arguments. The `Echo` +plugin implements the following in the `client.js` file: + + var service = "org.apache.cordova.blackberry.echo", + exec = cordova.require("cordova/exec"); + + module.exports = { + echo: function (data, success, fail) { + exec(success, fail, service, "echo", { data: data }); + } + }; + +The `index.js` component uses JNEXT to interact with the native +side. Attaching a constructor function named `Echo` to JNEXT allows +you to perform the following key operations using the `init` function: + +- Specify the required module exported by the native side. The name of + the required module must match the name of a shared library file + (`.so` file): + + JNEXT.require("libecho") + +- Create an object by using an acquired module and save the ID that's + returned by the call: + + self.m_id = JNEXT.createObject("libecho.Echo"); + + When the application calls the `echo` function in `client.js`, that + call in turn calls the `echo` function in `index.js`, where the + `PluginResult` object sends data as a response back to `client.js`. + Since the `args` argument passed into the functions was converted by + `JSON.stringfy()` and encoded as a `URIcomponent`, you must call the + following: + + data = JSON.parse(decodeURIComponent(args.data)); + +You can now send the data back, as in the following: + + module.exports = { + echo: function (success, fail, args, env) { + var result = new PluginResult(args, env), + data = JSON.parse(decodeURIComponent(args.data)), + response = echo.getInstance().echo(data); + result.ok(response, false); + } + }; + +## Plugin Architecture + +You can place the plugin's artifacts, including the `plugin.xml` file, +the JavaScript and C++ source files, and the `.so` binary files within +any directory structure, as long as you correctly specify the file +locations in the `plugin.xml` file. Here is a typical structure: + +***project_directory*** (>plugin.xml) + +- **www** (>client.js) +- **src** + - **blackberry10** (>index.js, **native** >*.cpp, *.hpp) + - **device** (>*binary file* *.so) + - **simulator** (>*binary file* *.so) + +The list shows the hierarchical relationship among the top-level +folders. The parenthesis shows the contents of a given directory. All +directory names appear in bold text. File names are preceded by the `>` +sign. + +## The _plugin.xml_ file + +The `plugin.xml` file contains the extension's namespace and other +metadata. Set up the `Echo` plugin as follows: + + + + + + + + + + + + + + diff --git a/docs/jp/3.4.0/guide/platforms/blackberry10/tools.md b/docs/jp/3.4.0/guide/platforms/blackberry10/tools.md new file mode 100644 index 0000000000..5c364b5f3e --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/blackberry10/tools.md @@ -0,0 +1,178 @@ +--- +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. +--- + +# BlackBerry 10 Command-line Tools + +The `cordova` command-line utility is a high-level tool that allows +you to build applications across several platforms at once. An older +version of the Cordova framework provides sets of command-line tools +specific to each platform. To use them as an alternative to the CLI, +you need to download this version of Cordova from +[cordova.apache.org](http://cordova.apache.org). The download contains +separate archives for each platform. Expand the platform you wish to +target. The tools described here are typically available in the +top-level `bin` directory, otherwise consult the __README__ file for +more detailed directions. + +For information on the low-level command-line interface that enables +plugins, see Using Plugman to Manage Plugins. See Application Plugins +for an overview. + +If you need help with any command listed below, type the command along +with the `-h` or `-help` arguments, which are supported by all +commands and which provide descriptions for each of the available +arguments. + +## Create an App + +The `create` command creates a new project: + + bin/create + +where + +- `` specifies the directory you want the project created in + +- `` specifies a reverse domain style identifier + +- `` specifies the apps display name + +__NOTE__: the `create` command bootstraps dependency installation +through the `npm install` command. Depending on the installation +directory and system permissions, this may require administrator +privileges. If there's problem on OSX/Linux, run `sudo npm install` +before using the `create` command. On Windows, run `npm install` in a +command-line utility opened with administrator privileges. + +## Create a Target + +The `target` command allows you to manage the emulator or BlackBerry +devices that you use to test your app. You can add or remove a target, +or set a target as the default target. + +### Add a Target + + /cordova/target add [-t | --type ] [-p | --password ] [--pin ] + +where + +- `` specifies a unique name for the target. + +- `` specifies the ip address of the BlackBerry device or + simulator. + +- `-p | --password ` specifies the password for the device or + emulator. This is required only if the device or emulator is + password protected. + +- `--pin ` specifies the PIN of the BlackBerry device, + which identifies that device as a valid host for the debug + token. This argument is required only when creating a debug + token. + +### Remove a Target + + /cordova/target remove + +### Set a Target as the Default + + /cordova/target default + +## Build the App + +The `build` command builds the project as a .bar file. You can build +your app in either release mode (which produces a signed .bar file) or +in debug mode (which produces an unsigned .bar file). + +### Build the App in Release Mode + + /cordova/build release [-k | --keystorepass ] [-b | --buildId ] [-p | --params ] + +where + +- `-k | --keystorepass ` specifies the password you defined when you configured your computer to sign applications. + +- `-b | --buildId ` specifies the build version number of your application. Typically, this number should be incremented from the previous signed version. This argument is optional. + +- `-p | --params ` specifies a JSON file containing additional parameters to pass to downstream tools. This argument is optional. + +### Build the Project in Debug Mode + + /cordova/build debug [] [-k | --keystorepass ] [-p | --params ] [-ll | --loglevel ] + +where + +- `` specifies the name of a previously added target. If + `` is not specified, the default target is used, if one has + been created. This argument is only required if you want the script + to deploy your app to a BlackBerry device or emulator and you have + not created a default target. Additionally, if `` is a + device, then that device must be connected to your computer by USB + connection or be connected to the same Wi-Fi network as your + computer. + +- `-k | --keystorepass ` specifies the password you defined + when you configured your computer to sign applications. This + password is also used to create your debug token. This argument is + only required if you want the script to create and install the debug + token for you. + +- `-p | --params ` specifies a JSON file containing + additional parameters to pass to downstream tools. + +- `-ll | --loglevel ` specifies the log level. The log level may + be one of `error`, `warn`, or `verbose`. + +If you have previously defined a default target (and previously +installed a debug token, if that target is a BlackBerry device), you +can run the script with no arguments, and the script packages your +app and deploys it to the default target. For example: + + /cordova/build debug + +## Run the App + +The `run` command deploys the app's most recent build on the specified +BlackBerry device or an emulator. To deploy your app, you need to +specify a target for the device or emulator: + + /cordova/run + +...where ` `specifies the name of a previously added target. +If `` is a device, then it must be connected to your computer +via USB cable, or else over the same Wi-Fi network as your computer. + +## Handle Plugins + +The `target` command allows you to add and remove plugins. To fetch a +locally hosted plugin: + + /cordova/plugin fetch + +View a list of installed plugins: + + /cordova/plugin ls + +Add a plugin: + + /cordova/plugin add + +Remove a plugin: + + /cordova/plugin rm diff --git a/docs/jp/3.4.0/guide/platforms/blackberry10/upgrading.md b/docs/jp/3.4.0/guide/platforms/blackberry10/upgrading.md new file mode 100644 index 0000000000..1e96f67e7d --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/blackberry10/upgrading.md @@ -0,0 +1,490 @@ +--- +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. +--- + +# Upgrading BlackBerry 10 + +This guide shows how to modify BlackBerry projects to upgrade from older versions of Cordova. +Most of these instructions apply to projects created with an older set +of command-line tools that precede the `cordova` CLI utility. See The Command-Line Interface for information how to update the +version of the CLI. + +## Upgrading to 3.2.0 from 3.1.0 + +For projects that were created with the cordova CLI: + +1. Update the `cordova` CLI version. See The Command-Line Interface. + +2. Run `cordova platform update blackberry` + +For projects not created with the cordova CLI, run: + + bin/update + +## Upgrade to 3.1.0 from 3.0.0 + +1. Create a new Apache Cordova 3.1.0 project using the cordova CLI, as + described in The Command-Line Interface. + +2. Add your platforms to the cordova project, for example: `cordova + platform add blackberry10`. + +3. Copy the contents of the original project's `www` directory to the `www` directory + at the root of the cordova project you just created. + +4. Copy or overwrite any native assets from your original project + (`Resources`, etc.) + +5. Copy the `config.xml` file into the `www` directory, and remove any + plugin definitions. You need to modify settings here rather than + within the platform directory. + +6. Use the cordova CLI tool to install any plugins you need. Note that + the CLI handles all core APIs as plugins, so they may need to be + added. Only plugins marked 3.0.0 and above are compatible with the CLI. + +7. Build and test. + +Please note that the CLI supports the BlackBerry10 platform exclusively. For PlayBook and BBOS, please see Cordova version 2.9.0 and below. + +## Upgrade to the CLI (3.0.0) from 2.9.0 + +1. Create a new Apache Cordova 3.0.0 project using the cordova CLI, as + described in The Command-Line Interface. + +2. Add your platforms to the cordova project, for example: `cordova + platform add blackberry10`. + +3. Copy the contents of the original project's `www` directory to the `www` directory + at the root of the cordova project you just created. + +4. Copy or overwrite any native assets from your original project + (`Resources`, etc.) + +5. Copy the `config.xml` file into the `www` directory, and remove any + plugin definitions. You need to modify settings here rather than + within the platform directory. + +6. Use the cordova CLI tool to install any plugins you need. Note that + the CLI handles all core APIs as plugins, so they may need to be + added. Only 3.0.0 plugins are compatible with the CLI. + +7. Build and test. + +## Upgrading 2.8.0 Projects to 2.9.0 + +For BlackBerry 10: + +1. Download and extract the Cordova 2.9.0 source to a permanent directory location on your hard drive, for example to `~/Cordova-2.9.0`. + +2. Quit any running SDK tools: Eclipse, Momentics and the like. + +3. Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc. + +4. Create a new project, as described in BlackBerry Command-line Tools. This becomes the home of your updated project. + +5. Copy your projects source from the old project's `/www` directory to the new project's `/www` directory. + +6. Update the Cordova script reference in your `www/index.html` file (and any other files that contain the script reference) to point to the new `cordova.js` file. + +For BlackBerryOS/Playbook: + +1. Download and extract the Cordova 2.9.0 source to a permanent directory location on your hard drive, for example to `~/Cordova-2.9.0`. + +2. Quit any running SDK tools: Eclipse, Momentics and the like. + +3. Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc. + +4. Create a new project, as described in iOS Command-line Tools. You need the assets from this new project. + +5. Copy the `www/cordova.js` file from the new project into your `www` directory, and delete your `www/cordova.js` file. + +6. Update the Cordova script reference in your `www/index.html` file (and any other files that contain the script reference) to point to the new `cordova.js` file. + +7. Copy the `native` directory from the new project into the existing project, overwriting the old `native` directory. + +8. Copy the `lib` directory from the new project into the existing project, overwriting the old `lib` directory. + +9. Copy the `cordova` directory from the new project into the existing project, overwriting the old `cordova` directory. + +## Upgrading 2.7.0 Projects to 2.8.0 + +BlackBerry 10 uses the new CLI tooling and manages core APIs as plugins. The instructions migrate your project to a new project, rather than updating an existing project, due to the complexity of updating an old project. +Also note that the cordova js script file is now called 'cordova.js' and no longer contains a version string. + +1. Download and extract the Cordova 2.8.0 source to a permanent directory location on your hard drive, for example to `~/Cordova-2.8.0`. + +2. Quit any running SDK tools: Eclipse, Momentics and the like. + +3. Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc. + +4. Create a new project, as described in BlackBerry Command-line Tools. This becomes the home of your updated project. + +5. Copy your projects source from the old project's `/www` directory to the new project's `/www` directory. + +6. Update the Cordova script reference in your `www/index.html` file (and any other files that contain the script reference) to point to the new `cordova.js` file. + +For BlackBerryOS/Playbook: + +1. Download and extract the Cordova 2.8.0 source to a permanent directory location on your hard drive, for example to `~/Cordova-2.8.0`. + +2. Quit any running SDK tools: Eclipse, Momentics and the like. + +3. Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc. + +4. Create a new project, as described in iOS Command-line Tools. You need the assets from this new project. + +5. Copy the `www/cordova.js` file from the new project into your `www` directory, and delete your `www/cordova.js` file. + +6. Update the Cordova script reference in your `www/index.html` file (and any other files that contain the script reference) to point to the new `cordova.js` file. + +7. Copy the `native` directory from the new project into the existing project, overwriting the old `native` directory. + +8. Copy the `lib` directory from the new project into the existing project, overwriting the old `lib` directory. + +9. Copy the `cordova` directory from the new project into the existing project, overwriting the old `cordova` directory. + +## Upgrading 2.6.0 Projects to 2.7.0 + +1. Download and extract the Cordova 2.7.0 source to a permanent directory location on your hard drive, for example to `~/Cordova-2.7.0`. + +2. Quit any running SDK tools: Eclipse, Momentics and the like. + +3. Navigate to the directory where you put the downloaded source above, using a unix like terminal: Terminal.app, Bash, Cygwin, etc. + +4. Create a new project, as described in BlackBerry Command-line Tools. You need the assets from this new project. + +5. Copy the `www/cordova-2.7.0.js` file from the new project into your `www` directory, and delete your `www/cordova-2.6.0.js` file. + +6. Update the Cordova script reference in your `www/index.html` file (and any other files that contain the script reference) to point to the new `cordova-2.7.0.js` file. + +7. Copy the `native` directory from the new project into the existing project, overwriting the old `native` directory. + +8. Copy the `lib` directory from the new project into the existing project, overwriting the old `lib` directory. + +9. Copy the `cordova` directory from the new project into the existing project, overwriting the old `cordova` directory. + +## Upgrade to 2.6.0 from 2.5.0 + +Updating the PhoneGap download directory: + +It is recommended that you download a fresh copy of the entire directory. + +However, here are the new parts needed for the piecemeal update: + +1. Update the cordova.blackberry.js file in the `Phonegap-2.6.0/lib/blackberry/javascript` directory. + +2. Update the `ext`, `ext-air`, and `ext-qnx` in the `Phonegap-2.6.0/lib/blackberry/framework` directory. + +3. Update the `build.xml` file in the `Phonegap-2.6.0/lib/blackberry` directory. + +4. Update the `Phonegap-2.6.0/lib/blackberry/bin` directory. + +5. Update the `VERSION` file in the `Phonegap-2.6.0/lib/blackberry` directory. + +Updating the example/ directory or migrating an existing project: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Update the contents of the `ext-qnx/` directory. + +4. Copy the new `cordova-2.6.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.6.0.js` file. + +## Upgrade to 2.5.0 from 2.4.0 + +Updating the PhoneGap download directory: + +It is recommended that you download a fresh copy of the entire directory. + +However, here are the new parts needed for the piecemeal update: + +1. Update the cordova.blackberry.js file in the `Phonegap-2.5.0/lib/blackberry/javascript` directory. + +2. Update the `ext`, `ext-air`, and `ext-qnx` in the `Phonegap-2.5.0/lib/blackberry/framework` directory. + +3. Update the `build.xml` file in the `Phonegap-2.5.0/lib/blackberry` directory. + +4. Update the `Phonegap-2.5.0/lib/blackberry/bin` directory. + +5. Update the `VERSION` file in the `Phonegap-2.5.0/lib/blackberry` directory. + +Updating the example/ directory or migrating an existing project: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Update the contents of the `ext-qnx/` directory. + +4. Copy the new `cordova-2.5.0.js` into your project. + +5. Update your HTML to use the new `cordova-2.5.0.js` file. + +## Upgrade to 2.4.0 from 2.3.0 + +Updating just the `www` directory: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Copy the new `cordova-2.4.0.js` into your project. + - If playbook, then update the .js file in the `playbook/` directory. + - If BlackBerry 10, then update the .js file in the `qnx/` directory. + +5. Update your HTML to use the new `cordova-2.4.0.js` file. + +Updating the sample directory (i.e., updating using the ant tools): + +1. Open the `sample/lib/` directory. + +2. Update the .jar file in the `cordova.2.3.0/ext/` directory. + +3. Update the contents of the `cordova.2.3.0/ext-air/` directory. + +4. Update the contents of the `cordova.2.3.0/ext-qnx/` directory. + +5. Update the .js file in the `cordova.2.3.0/javascript/` directory. + +6. Open the `sample/lib/` directory and rename the `cordova.2.3.0/` directory to `cordova.2.4.0/`. + +7. Type `ant blackberry build` or `ant playbook build` to update the `www/` directory with updated Cordova. + +8. Open the `www/` directory and update your HTML to use the new `cordova-2.4.0.js` file. + +## Upgrade to 2.3.0 from 2.2.0 + +Updating just the `www` directory: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Copy the new `cordova-2.3.0.js` into your project. + - If playbook, then update the .js file in the `playbook/` directory. + - If BlackBerry 10, then update the .js file in the `qnx/` directory. + +5. Update your HTML to use the new `cordova-2.3.0.js` file. + +Updating the sample directory (i.e., updating using the ant tools): + +1. Open the `sample/lib/` directory. + +2. Update the .jar file in the `cordova.2.2.0/ext/` directory. + +3. Update the contents of the `cordova.2.2.0/ext-air/` directory. + +4. Update the contents of the `cordova.2.2.0/ext-qnx/` directory. + +5. Update the .js file in the `cordova.2.2.0/javascript/` directory. + +6. Open the `sample/lib/` directory and rename the `cordova.2.2.0/` directory to `cordova.2.3.0/`. + +7. Type `ant blackberry build` or `ant playbook build` to update the `www/` directory with updated Cordova. + +8. Open the `www/` directory and update your HTML to use the new `cordova-2.3.0.js` file. + +## Upgrade to 2.2.0 from 2.1.0 + +Updating just the www directory: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Copy the new `cordova-2.2.0.js` into your project. + - If playbook, then update the .js file in the `playbook/` directory. + - If BlackBerry 10, then update the .js file in the `qnx/` directory. + +5. Update your HTML to use the new `cordova-2.2.0.js` file. + +Updating the sample directory (i.e., updating using the ant tools): + +1. Open the `sample/lib/` directory. + +2. Update the .jar file in the `cordova.2.1.0/ext/` directory. + +3. Update the contents of the `cordova.2.1.0/ext-air/` directory. + +4. Update the contents of the `cordova.2.1.0/ext-qnx/` directory. + +5. Update the .js file in the `cordova.2.1.0/javascript/` directory. + +6. Open the `sample/lib/` directory and rename the `cordova.2.1.0/` directory to `cordova.2.2.0/`. + +7. Type `ant blackberry build` or `ant playbook build` to update the `www/` directory with updated Cordova. + +8. Open the `www/` directory and update your HTML to use the new `cordova-2.2.0.js` file. + +## Upgrade to 2.1.0 from 2.0.0 + +Updating just the `www` directory: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Copy the new `cordova-2.1.0.js` into your project. + - If playbook, then update the .js file in the `playbook/` directory. + +5. Update your HTML to use the new `cordova-2.1.0.js` file. + +Updating the sample directory (i.e., updating using the ant tools): + +1. Open the `sample/lib/` directory. + +2. Update the .jar file in the `cordova.2.0.0/ext/` directory. + +3. Update the contents of the `cordova.2.0.0/ext-air/` directory. + +4. Update the .js file in the `cordova.2.0.0/javascript/` directory. + +5. Open the `sample/lib/` directory and rename the `cordova.2.0.0/` directory to `cordova.2.1.0/`. + +6. Type `ant blackberry build` or `ant playbook build` to update the `www/` directory with updated Cordova. + +7. Open the `www/` directory and update your HTML to use the new `cordova-2.1.0.js` file. + +## Upgrade to 2.0.0 from 1.9.0 + +Updating just the `www` directory: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Copy the new `cordova-2.0.0.js` into your project. + - If playbook, then update the .js file in the `playbook/` directory. + +5. Update your HTML to use the new `cordova-2.0.0.js` file. + +6. Update your `www/plugins.xml` file. Two plugins changed their + namespace/service label. Change the old entries for the Capture and + Contact plugins from: + + + + + To: + + + + +Updating the sample directory (i.e., updating using the ant tools): + +1. Open the `sample/lib/` directory. + +2. Update the .jar file in the `cordova.1.9.0/ext/` directory. + +3. Update the contents of the `cordova.1.9.0/ext-air/` directory. + +4. Update the .js file in the `cordova.1.9.0/javascript/` directory. + +5. Open the `sample/lib/` directory and rename the `cordova.1.9.0/` directory to `cordova.2.0.0/`. + +6. Type `ant blackberry build` or `ant playbook build` to update the `www/` directory with updated Cordova. + +7. Open the `www/` directory and update your HTML to use the new `cordova-2.0.0.js` file. + +8. Open the `www/` directory and update the `plugins.xml` file. Two plugins + changed their namespace/service label. Change the old entries for the + Capture and Contact plugins from: + + + + + To: + + + + +- To upgrade to 1.8.0, please go from 1.7.0 + +## Upgrade to 1.8.0 from 1.7.0 + +Updating just the `www` directory: + +1. Open your `www/` directory, which contains your app. + +2. Remove and update the .jar file in the `ext/` directory. + +3. Update the contents of the `ext-air/` directory. + +4. Copy the new `cordova-1.8.0.js` into your project. + - If playbook, then update the .js file in the `playbook/` directory. + +5. Update your HTML to use the new `cordova-1.8.0.js` file. + +6. Update your `www/plugins.xml` file. Two plugins changed their + namespace/service label. Change the old entries for the Capture and + Contact plugins from: + + + + + To: + + + + +Updating the sample directory (i.e., updating using the ant tools): + +1. Open the `sample/lib/` directory. + +2. Update the .jar file in the `cordova.1.7.0/ext/` directory. + +3. Update the contents of the `cordova.1.7.0/ext-air/` directory. + +4. Update the .js file in the `cordova.1.7.0/javascript/` directory. + +5. Open the `sample/lib/` directory and rename the `cordova.1.7.0/` directory to `cordova.1.8.0/`. + +6. Type `ant blackberry build` or `ant playbook build` to update the `www/` directory with updated Cordova. + +7. Open the `www/` directory and update your HTML to use the new `cordova-1.8.0.js` file. + +8. Open the `www/` directory and update the `plugins.xml` file. Two plugins + changed their namespace/service label. Change the old entries for the + Capture and Contact plugins from: + + + + + To: + + + + diff --git a/docs/jp/3.4.0/guide/platforms/firefoxos/index.md b/docs/jp/3.4.0/guide/platforms/firefoxos/index.md new file mode 100644 index 0000000000..84cb148612 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/firefoxos/index.md @@ -0,0 +1,87 @@ +--- +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. +--- + +# Firefox OS Platform Guide + +This guide describes how to set up your development environment to +create Cordova apps for Firefox OS devices, then test and publish those apps. + +## Requirements and Support + +Firefox OS apps are basically just web apps, with the addition of a manifest.webapp file that defines metadata about the app and allows it to be installed on Firefox OS devices. Any platform that Cordova supports can be used.To find out more about building web apps, consult the [App Center](https://developer.mozilla.org/en-US/Apps) on [MDN](https://developer.mozilla.org/en-US/). + +## Installation and Environment Setup + +First install [Node.js](http://nodejs.org/), then install the Cordova package like so: + + $ npm install -g cordova + +Next, create a sample Cordova app then navigate into the newly created directory: + + $ cordova create test-app + $ cd test-app + +Add Firefox OS as a supported platform to the app with the following: + + $ cordova platform add firefoxos + +This creates a Firefox OS app in platforms/firefoxos/www directory, which currently looks the same except that it has a Firefox manifest file (manifest.webapp) inside the www directory. + +##Developing your app + +At this point you are ready to go — change the code inside test-app/www to whatever you want your app to be. You can add [supported plugins]() to the app using "cordova plugin add", for example: + + cordova plugin add org.apache.cordova.device + cordova plugin add org.apache.cordova.vibration + +You also need to add a custom manifest.webapp file into your test-app/www directory, which should include at least the following: + + { + "launch_path":"/index.html", + "installs_allowed_from":["*"], + "version":"0.0.1", + "name":"My app", + "pkgName":"io.cordova.hellocordova", + "icons": { + "128": "/img/logo.png" + } + } + +For more information about Firefox App manifests, read [App manifest](https://developer.mozilla.org/en-US/Apps/Developing/Manifest) on MDN. + +When your app code is written, deploy your changes to the Firefox OS app you've added to your project with + + $ cordova prepare + +Note that a build step (i.e. cordova build) is not required when deploying to the Firefox OS platform, as Firefox OS apps are HTML-based, and therefore not compiled. + +##Testing and Debugging + +The app can be tested using the Firefox OS [App Manager](https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager). + +When you have connected the App Manager to your test device/simulator, select the "Add Packaged App" option, then make sure you point to the test-app/platforms/firefoxos/www/ directory to include the App in the Manager interface. + +For here you can install the app on your test device/simulator (with the "Update" button). Using the "Debug" button you can then debug the app and edit its code live. + +Note: Before attempting to publish your app you should consider validating it using the [App validator](https://marketplace.firefox.com/developers/validator). + +##Publishing your app on the Firefox Marketplace + +You can submit your app to the Firefox Marketplace, or publish it yourself. Visit the [Firefox Marketplace Zone](https://developer.mozilla.org/en-US/Marketplace) on MDN to find out more about how to do this; [App publishing options](https://developer.mozilla.org/en-US/Marketplace/Publishing/Publish_options) is the best place to start. + diff --git a/docs/jp/3.4.0/guide/platforms/index.md b/docs/jp/3.4.0/guide/platforms/index.md new file mode 100644 index 0000000000..3ad781ca34 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/index.md @@ -0,0 +1,98 @@ +--- +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. +--- + +# Platform Guides + +Before developing for any of the platforms listed below, install +cordova's command-line interface (CLI). +(For details, see The Command-Line Interface.) + +To develop Cordova applications, you must install SDKs for each mobile +platform you are targeting. This installation is necessary regardless +of whether you do the majority of your work in the SDK or use the CLI +for your build cycle. + +Each _Platform Guide_ listed below tells you what you need to know to +set up each platform's development environment: where to obtain the +SDK, how to set up device emulators, how to connect devices for direct +testing, and how to manage signing key requirements. Additional +guides provide information on each platform's unique set of +configuration options, instructions to add plugins, how to upgrade +each platform, and platform-specific command-line tools that serve as +a lower-level alternative to the `cordova` command-line utility. + +## Amazon Fire OS + +* Amazon Fire OS Platform Guide +* Amazon Fire OS Configuration +* Amazon Fire OS WebViews +* Amazon Fire OS Plugins + +## Android + +* Android Platform Guide +* Android Configuration +* Android WebViews +* Android Plugins +* Android Command-line Tools +* Upgrading Android + +## BlackBerry 10 + +* BlackBerry 10 Platform Guide +* BlackBerry 10 Configuration +* BlackBerry 10 Plugins +* BlackBerry 10 Command-line Tools +* Upgrading BlackBerry 10 + +## Firefox OS + +* Firefox OS Platform Guide + +## iOS + +* iOS Platform Guide +* iOS Configuration +* iOS WebViews +* iOS Plugins +* iOS Command-line Tools +* Upgrading iOS + +## Ubuntu + +* Ubuntu Platform Guide + +## Windows Phone + +* Windows Phone 8 Platform Guide +* Windows Phone 7 Platform Guide +* Windows Phone Configuration +* Windows Phone Command-line Tools +* Upgrading Windows Phone + +## Windows 8 + +* Windows 8 Platform Guide +* Windows 8 Command-line Tools +* Upgrading Windows 8 + +## Tizen + +* Tizen Platform Guide + diff --git a/docs/jp/3.4.0/guide/platforms/ios/config.md b/docs/jp/3.4.0/guide/platforms/ios/config.md new file mode 100644 index 0000000000..860221f9e7 --- /dev/null +++ b/docs/jp/3.4.0/guide/platforms/ios/config.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. +--- + +# iOS Configuration + +The `config.xml` file controls an app's basic settings that apply +across each application and CordovaWebView instance. This section +details preferences that only apply to iOS builds. See The config.xml +File for information on global configuration options. + +- `EnableViewportScale` (boolean, defaults to `false`): Set to `true` + to allow a viewport meta tag to either disable or restrict the range + of user scaling, which is enabled by default. + + + + Place a viewport such as the following in the HTML to disable + scaling and fit content flexibly within the rendering WebView: + + + +- `MediaPlaybackRequiresUserAction` (boolean, defaults to `false`): + Set to `true` to prevent HTML5 videos or audios from playing + automatically with the `autoplay` attribute or via JavaScript. + + + +- `AllowInlineMediaPlayback` (boolean, defaults to `false`): Set to + `true` to allow HTML5 media playback to appear _inline_ within the + screen layout, using browser-supplied controls rather than native + controls. For this to work, add the `webkit-playsinline` attribute + to any ` From 1244929e22e3f14c761b2f22b8a7b4cc0ea85bba Mon Sep 17 00:00:00 2001 From: Watabe Date: Tue, 1 Apr 2014 20:07:15 +0900 Subject: [PATCH 4/5] the first updates --- docs/jp/3.4.0/cordova/accelerometor/index.md | 25 +- docs/jp/3.4.0/cordova/battery-status/index.md | 16 +- docs/jp/3.4.0/cordova/camera/index.md | 287 ++++++++---------- docs/jp/3.4.0/cordova/compass/index.md | 112 ++++--- docs/jp/3.4.0/cordova/connection/index.md | 105 +++---- docs/jp/3.4.0/cordova/contacts/index.md | 96 +++--- docs/jp/3.4.0/cordova/device/index.md | 38 +-- docs/jp/3.4.0/cordova/dialogs/index.md | 42 +-- .../3.4.0/cordova/events/events.backbutton.md | 28 +- .../cordova/events/events.deviceready.md | 38 +-- .../cordova/events/events.endcallbutton.md | 29 +- docs/jp/3.4.0/cordova/events/events.md | 10 +- .../3.4.0/cordova/events/events.menubutton.md | 28 +- docs/jp/3.4.0/cordova/events/events.pause.md | 38 ++- docs/jp/3.4.0/cordova/events/events.resume.md | 56 ++-- .../cordova/events/events.searchbutton.md | 28 +- .../cordova/events/events.startcallbutton.md | 28 +- .../cordova/events/events.volumedownbutton.md | 28 +- .../cordova/events/events.volumeupbutton.md | 28 +- docs/jp/3.4.0/cordova/file-transfer/index.md | 20 +- docs/jp/3.4.0/cordova/file/index.md | 10 +- docs/jp/3.4.0/cordova/geolocation/index.md | 36 +-- docs/jp/3.4.0/cordova/globalization/index.md | 98 +++--- docs/jp/3.4.0/cordova/inappbrowser/index.md | 32 +- docs/jp/3.4.0/cordova/media-capture/index.md | 106 +++---- docs/jp/3.4.0/cordova/media/index.md | 58 ++-- docs/jp/3.4.0/cordova/splashscreen/index.md | 12 +- docs/jp/3.4.0/cordova/vibration/index.md | 8 +- 28 files changed, 667 insertions(+), 773 deletions(-) diff --git a/docs/jp/3.4.0/cordova/accelerometor/index.md b/docs/jp/3.4.0/cordova/accelerometor/index.md index 79d3b47f54..0dad4637b4 100644 --- a/docs/jp/3.4.0/cordova/accelerometor/index.md +++ b/docs/jp/3.4.0/cordova/accelerometor/index.md @@ -19,16 +19,13 @@ # org.apache.cordova.device-motion -This plugin provides access to the device's accelerometer. The accelerometer is -a motion sensor that detects the change (_delta_) in movement relative to the -current device orientation, in three dimensions along the _x_, _y_, and _z_ -axis. +このプラグインを使用して、デバイス内臓の加速度センサーが持つ情報を取得します。加速度センサーは、 _x_, _y_, _z_ 軸の3 次元で、デバイスの傾きの変化 ( _delta_ ) を検知するモーションセンサーの 1 種です。 -## Installation +## インストール cordova plugin add org.apache.cordova.device-motion -## Supported Platforms +## サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -38,13 +35,13 @@ axis. - Windows Phone 7 and 8 - Windows 8 -## Methods +## メソッド - navigator.accelerometer.getCurrentAcceleration - navigator.accelerometer.watchAcceleration - navigator.accelerometer.clearWatch -## Objects +## オブジェクト - Acceleration @@ -58,7 +55,7 @@ callback function. navigator.accelerometer.getCurrentAcceleration(accelerometerSuccess, accelerometerError); -### Example +### 例 function onSuccess(acceleration) { alert('Acceleration X: ' + acceleration.x + '\n' + @@ -73,7 +70,7 @@ callback function. navigator.accelerometer.getCurrentAcceleration(onSuccess, onError); -### iOS Quirks +### iOS 特有の動作 - iOS doesn't recognize the concept of getting the current acceleration at any given point. @@ -99,7 +96,7 @@ accelerometer. - __frequency__: How often to retrieve the `Acceleration` in milliseconds. _(Number)_ (Default: 10000) -### Example +### 例 function onSuccess(acceleration) { alert('Acceleration X: ' + acceleration.x + '\n' + @@ -116,7 +113,7 @@ accelerometer. var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); -### iOS Quirks +### iOS 特有の動作 The API calls the success callback function at the interval requested, but restricts the range of requests to the device between 40ms and @@ -132,7 +129,7 @@ Stop watching the `Acceleration` referenced by the `watchID` parameter. - __watchID__: The ID returned by `navigator.accelerometer.watchAcceleration`. -### Example +### 例 var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); @@ -147,7 +144,7 @@ Acceleration values include the effect of gravity (9.81 m/s^2), so that when a device lies flat and facing up, _x_, _y_, and _z_ values returned should be `0`, `0`, and `9.81`. -### Properties +### プロパティ - __x__: Amount of acceleration on the x-axis. (in m/s^2) _(Number)_ - __y__: Amount of acceleration on the y-axis. (in m/s^2) _(Number)_ diff --git a/docs/jp/3.4.0/cordova/battery-status/index.md b/docs/jp/3.4.0/cordova/battery-status/index.md index 9d946f9cf0..eaaa7edb68 100644 --- a/docs/jp/3.4.0/cordova/battery-status/index.md +++ b/docs/jp/3.4.0/cordova/battery-status/index.md @@ -27,7 +27,7 @@ It adds the following three `window` events: * batterycritical * batterylow -## Installation +## インストール cordova plugin add org.apache.cordova.battery-status @@ -46,7 +46,7 @@ properties: Applications typically should use `window.addEventListener` to attach an event listener once the `deviceready` event fires. e.g.: -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - iOS @@ -55,13 +55,13 @@ attach an event listener once the `deviceready` event fires. e.g.: - Windows Phone 7 and 8 - Tizen -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 Windows Phone 7 does not provide native APIs to determine battery level, so the `level` property is unavailable. The `isPlugged` parameter _is_ supported. -### Example +### 例 window.addEventListener("batterystatus", onBatteryStatus, false); @@ -85,7 +85,7 @@ properties: Applications typically should use `window.addEventListener` to attach an event listener once the `deviceready` event fires. -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - iOS @@ -93,7 +93,7 @@ an event listener once the `deviceready` event fires. - BlackBerry 10 - Tizen -### Example +### 例 window.addEventListener("batterycritical", onBatteryCritical, false); @@ -117,7 +117,7 @@ properties: Applications typically should use `window.addEventListener` to attach an event listener once the `deviceready` event fires. -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - iOS @@ -125,7 +125,7 @@ attach an event listener once the `deviceready` event fires. - BlackBerry 10 - Tizen -### Example +### 例 window.addEventListener("batterylow", onBatteryLow, false); diff --git a/docs/jp/3.4.0/cordova/camera/index.md b/docs/jp/3.4.0/cordova/camera/index.md index c36d6cbb40..61b6c2ec20 100644 --- a/docs/jp/3.4.0/cordova/camera/index.md +++ b/docs/jp/3.4.0/cordova/camera/index.md @@ -19,61 +19,43 @@ # org.apache.cordova.camera -This plugin provides an API for taking pictures and for choosing images from -the system's image libarary. +このプラグインを使用して、写真撮影およびシステムのイメージライブラリからのイメージの選択を行うことができます。 cordova plugin add org.apache.cordova.camera ## navigator.camera.getPicture -Takes a photo using the camera, or retrieves a photo from the device's -image gallery. The image is passed to the success callback as a -base64-encoded `String`, or as the URI for the image file. The method -itself returns a `CameraPopoverHandle` object that can be used to -reposition the file selection popover. +デバイスのカメラでの写真撮影、または、デバイスの画像ギャラリー内の画像検索を行います。画像は Base64 形式の文字列として、または、画像ファイルの URI を、Success コールバック関数に引き渡します。このメソッド自体は `CameraPopoverHandle` オブジェクトを返します。このオブジェクトを使用して、ファイル選択用のポップオーバー ( popover ) の位置を変更できます。 navigator.camera.getPicture( cameraSuccess, cameraError, [ cameraOptions ] ); -### Description +### 解説 -The `camera.getPicture` function opens the device's default camera -application that allows users to snap pictures. This behavior occurs -by default, when `Camera.sourceType` equals -`Camera.PictureSourceType.CAMERA`. Once the user snaps the photo, the -camera application closes and the application is restored. +The `camera.getPicture` 関数を使用して、デバイス搭載のカメラアプリを起動して、写真撮影を行います。デフォルトでは、 `Camera.sourceType` と `Camera.PictureSourceType.CAMERA` が等しいときに、この処理を実行します。 -If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or -`Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays -that allows users to select an existing image. The -`camera.getPicture` function returns a `CameraPopoverHandle` object, -which can be used to reposition the image selection dialog, for -example, when the device orientation changes. +写真の撮影後、カメラアプリを終了して、アプリケーションに戻ります。 +`Camera.sourceType` が `Camera.PictureSourceType.PHOTOLIBRARY` の場合、または、 `Camera.PictureSourceType.SAVEDPHOTOALBUM` の場合、写真選択用のダイアログが表示され、既存の写真を選択できます。 `camera.getPicture` 関数は `CameraPopoverHandle` オブジェクトを返します。このオブジェクトを使用して、画像選択用のダイアログの位置を変更できます。例えば、端末の向きを変えた場合に使用します。 -The return value is sent to the `cameraSuccess` callback function, in -one of the following formats, depending on the specified -`cameraOptions`: +返り値は `cameraSuccess` 関数に送信されます。値は `cameraOptions` の設定に従い、以下のいずれかのフォーマットで送られます。 -- A `String` containing the base64-encoded photo image. -- A `String` representing the image file location on local storage (default). -You can do whatever you want with the encoded image or URI, for -example: +- Base64 形式でエンコードされたフォトイメージを表す `文字列` -- Render the image in an `` tag, as in the example below +- ローカルストレージ内の画像ファイルの場所を表す `文字列` (デフォルト) -- Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.) +エンコードされたイメージまたは URI を使用して、さまざまな処理を行うことができます。以下に例を示します。 -- Post the data to a remote server +- `` タグで画像を表示。使用例を次のセクションで示します。 -__NOTE__: Photo resolution on newer devices is quite good. Photos -selected from the device's gallery are not downscaled to a lower -quality, even if a `quality` parameter is specified. To avoid common -memory problems, set `Camera.destinationType` to `FILE_URI` rather -than `DATA_URL`. +- ローカルにデータを保存 ( `LocalStorage` 、 [Lawnchair](http://brianleroux.github.com/lawnchair/) など ) -### Supported Platforms +- リモートサーバーにデータを送信 + +__注意:__ 最新のデバイスで撮影した写真は高い解像度を持っています。デバイスのギャラリーから取得する画像は `quality` パラメーターで画質を指定しても、縮小されません。メモリーの問題を回避するために、 `Camera.destinationType` を `DATA_URL` ではなく、 `FILE_URI` に設定してください。 + +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -84,54 +66,41 @@ than `DATA_URL`. - Windows Phone 7 and 8 - Windows 8 -### Amazon Fire OS Quirks +### Amazon Fire OS 特有の動作 -Amazon Fire OS uses intents to launch the camera activity on the device to capture -images, and on phones with low memory, the Cordova activity may be killed. In this -scenario, the image may not appear when the cordova activity is restored. +写真を撮影するために、Amazon Fire OS はインテント群 ( intent ) を使用して、デバイスのカメラ アクティビティを起動します。メモリーが少ないデバイスでは、Cordova アクティビティが停止することがあります。この場合、Cordova アクティビティがリストアされても、画像が表示されない可能性があります。 -### Android Quirks -*Android 4.4 only*: Android 4.4 introduced a new [Storage Access Framework](https://developer.android.com/guide/topics/providers/document-provider.html) that makes it -easier for users to browse and open documents across all of their preferred document storage providers. -Cordova has not yet been fully integrated with this new Storage Access Framework. Because of this, the `getPicture()` -method will not correctly return pictures when the user selects from the "Recent", "Drive", "Images", or "External -Storage" folders when the `destinationType` is `FILE_URI`. However, the user will be able to correctly select any pictures -if they go through the "Gallery" app first. Potential workarounds for this issue are documented on [this StackOverflow question](http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content/20177611). Please see [CB-5398](https://issues.apache.org/jira/browse/CB-5398) to track this issue. +### Android 特有の動作 -Android uses intents to launch the camera activity on the device to capture -images, and on phones with low memory, the Cordova activity may be killed. In this -scenario, the image may not appear when the Cordova activity is restored. +*Android 4.4 のみが対象*: Android 4.4 では、新しい [ ストレージ アクセス フレームワーク](https://developer.android.com/guide/topics/providers/document-provider.html) を導入しました。このフレームワークを使用して、各ドキュメント ストレージ プロバイダー が保有するドキュメントの検索と表示が簡単に行えるようになりました。Cordova では、 `destinationType` を `FILE_URI` に設定して、ユーザが "Recent" 、 "Drive" 、 "Images" 、 "External Storage" のいずれかを選択したとき、 `getPicture()` メソッドが写真を適当に返さないため、このストレージ アクセス フレームワークを完全には実装していません。ただし、"Gallery" アプリを最初に使用した場合、写真の選択を適当に行うことができます。 +この問題に対する一時的な回避策として [StackOverflow 問題解決策](http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content/20177611) をご確認ください。また、この問題の途中経過は [CB-5398](https://issues.apache.org/jira/browse/CB-5398) をご確認ください。 -### Firefox OS Quirks +写真を撮影するために、Android はインテント群 ( intent ) を使用して、デバイスのカメラ アクティビティを起動します。メモリーが少ないデバイスでは、Cordova アクティビティが停止することがあります。この場合、Cordova アクティビティがリストアされても、画像が表示されない可能性があります。 -Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/). +### Firefox OS 特有の動作 -### iOS Quirks +カメラ用プラグインは、現在、 [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/) を使用します。 -Including a JavaScript `alert()` in either of the callback functions -can cause problems. Wrap the alert within a `setTimeout()` to allow -the iOS image picker or popover to fully close before the alert -displays: +### iOS 特有の動作 + +コールバック関数のいづれかに JavaScript の `alert()` を記述すると、問題が生じることがあります。この場合、alert を `setTimeout()` 内に記述します。これにより、alert が表示される前に、iOS の image picker または ポップオーバー ( popover ) を完全に閉じることができます。 setTimeout(function() { - // do your thing here! + // ここに処理を記述 }, 0); -### Windows Phone 7 Quirks +### Windows Phone 7 特有の動作 -Invoking the native camera application while the device is connected -via Zune does not work, and triggers an error callback. +Zune 経由でデバイスが接続している間は、ネーティブのカメラアプリを起動することはできず、代わりに、エラーを返すコールバックが呼ばれます。 -### Tizen Quirks +### Tizen 特有の動作 -Tizen only supports a `destinationType` of -`Camera.DestinationType.FILE_URI` and a `sourceType` of -`Camera.PictureSourceType.PHOTOLIBRARY`. +Tizen では、 `Camera.DestinationType.FILE_URI` の `destinationType` と `Camera.PictureSourceType.PHOTOLIBRARY` の `sourceType` のみサポートします。 -### Example +### 例 -Take a photo and retrieve it as a base64-encoded image: +写真を撮影し、 Base64 形式のイメージとして取得します。 navigator.camera.getPicture(onSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.DATA_URL @@ -146,7 +115,7 @@ Take a photo and retrieve it as a base64-encoded image: alert('Failed because: ' + message); } -Take a photo and retrieve the image's file location: +写真を撮影し、イメージファイルの位置を取得します。 navigator.camera.getPicture(onSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI }); @@ -162,7 +131,7 @@ Take a photo and retrieve the image's file location: ## CameraOptions -Optional parameters to customize the camera settings. +カメラの設定をカスタマイズするオプションのパラメーターです。 { quality : 75, destinationType : Camera.DestinationType.DATA_URL, @@ -174,19 +143,19 @@ Optional parameters to customize the camera settings. popoverOptions: CameraPopoverOptions, saveToPhotoAlbum: false }; -### Options +### オプション -- __quality__: Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. _(Number)_ (Note that information about the camera's resolution is unavailable.) +- __quality__: 保存したイメージの画質を指定します。 範囲は 0 から 100 まであり、100 を指定すると非圧縮時の解像度となります。_(Number)_ ( カメラ解像度に関する情報を利用することはできません ) -- __destinationType__: Choose the format of the return value. Defined in `navigator.camera.DestinationType` _(Number)_ +- __destinationType__: 返り値のフォーマットを指定します。フォーマットは `navigator.camera.DestinationType` で定義します。 _(Number)_ Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) + DATA_URL : 0, // 画像を Base64 形式の文字列で返す + FILE_URI : 1, // 画像ファイルの URI を返す + NATIVE_URI : 2 // 画像のネイティブ URI を返す ( 例 : iOS であれば assets-library:// 、Android であれば content:// ) }; -- __sourceType__: Set the source of the picture. Defined in `navigator.camera.PictureSourceType` _(Number)_ +- __sourceType__: 写真の取得先のソースを設定します。ソースは `navigator.camera.PictureSourceType` で定義します。 _(Number)_ Camera.PictureSourceType = { PHOTOLIBRARY : 0, @@ -194,124 +163,123 @@ Optional parameters to customize the camera settings. SAVEDPHOTOALBUM : 2 }; -- __allowEdit__: Allow simple editing of image before selection. _(Boolean)_ +- __allowEdit__: イメージ選択の前に、簡単な編集を許可します。 _(Boolean)_ -- __encodingType__: Choose the returned image file's encoding. Defined in `navigator.camera.EncodingType` _(Number)_ +- __encodingType__: 返される画像ファイルのエンコード形式を選択します。形式は `navigator.camera.EncodingType` で定義します。_(Number)_ Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image + JPEG : 0, // JPEG 形式の画像を返す + PNG : 1 // PNG 形式の画像を返す }; -- __targetWidth__: Width in pixels to scale image. Must be used with __targetHeight__. Aspect ratio remains constant. _(Number)_ +- __targetWidth__: 画像を拡大・縮小するための幅をピクセルで指定します。 __targetHeight__ と共に使用しなければなりません。 アスペクト比は一定に保持されます。 _(Number)_ -- __targetHeight__: Height in pixels to scale image. Must be used with __targetWidth__. Aspect ratio remains constant. _(Number)_ +- __targetHeight__: 画像を拡大・縮小するための高さをピクセルで指定します。 __targetWidth__ と共に使用しなければなりません。アスペクト比は一定に保持されます。 _(Number)_ -- __mediaType__: Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`. Defined in `nagivator.camera.MediaType` _(Number)_ +- __mediaType__: 画像の取得元のメディアの種類を指定します。 `PictureSourceType` に `PHOTOLIBRARY` または `SAVEDPHOTOALBUM` が指定されている場合のみ有効です。メディアの種類は `nagivator.camera.MediaType` で定義します。 _(Number)_ Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types + PICTURE: 0, // 静止画像のみ。デフォルトはこちらの設定です。返り値のフォーマットは DestinationType で指定したものになります。 + VIDEO: 1, // ビデオのみ。返り値は常に FILE_URI となります。 + ALLMEDIA : 2 // 全種類のメディアが対象。 }; -- __correctOrientation__: Rotate the image to correct for the orientation of the device during capture. _(Boolean)_ +- __correctOrientation__: 写真を撮影したときと同じデバイスの向きになるよう写真を回転させます。 _(Boolean)_ -- __saveToPhotoAlbum__: Save the image to the photo album on the device after capture. _(Boolean)_ +- __saveToPhotoAlbum__: 写真を撮影した後、デバイスのフォトアルバムに画像を保存します。 _(Boolean)_ -- __popoverOptions__: iOS-only options that specify popover location in iPad. Defined in `CameraPopoverOptions`. +- __popoverOptions__: iOS 専用のオプションです。iPad でのポップオーバー ( popover ) の位置を指定します。 `CameraPopoverOptions` で定義します。 -- __cameraDirection__: Choose the camera to use (front- or back-facing). Defined in `navigator.camera.Direction` _(Number)_ +- __cameraDirection__: 使用するカメラを選択します ( 前面か背面のカメラ )。 `navigator.camera.Direction` で定義します。 _(Number)_ Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera + BACK : 0, // 背面のカメラを使用 + FRONT : 1 // 前面のカメラを使用 }; -### Amazon Fire OSQuirks - -- Any `cameraDirection` value results in a back-facing photo. +### Amazon Fire OS 特有の動作 -- Ignores the `allowEdit` parameter. +- `cameraDirection` を指定しても、背面のカメラで写真を撮ります。 -- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album. +- `allowEdit` パラメータを無視します。 -### Android Quirks +- `Camera.PictureSourceType.PHOTOLIBRARY` と `Camera.PictureSourceType.SAVEDPHOTOALBUM` は、共に、同じフォトアルバムを表示します。 -- Any `cameraDirection` value results in a back-facing photo. +### Android 特有の動作 -- Ignores the `allowEdit` parameter. +- `cameraDirection` を指定しても、背面のカメラで写真を撮ります。 -- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album. +- `allowEdit` パラメータを無視します。 -### BlackBerry 10 Quirks +- `Camera.PictureSourceType.PHOTOLIBRARY` と `Camera.PictureSourceType.SAVEDPHOTOALBUM` は、共に、同じフォトアルバムを表示します。 -- Ignores the `quality` parameter. +### BlackBerry 10 特有の動作 -- Ignores the `sourceType` parameter. +- `quality` パラメータを無視します。 -- Ignores the `allowEdit` parameter. +- `sourceType` パラメータを無視します。 -- `Camera.MediaType` is not supported. +- `allowEdit` パラメータを無視します。 -- Ignores the `correctOrientation` parameter. +- `Camera.MediaType` をサポートしません。 -- Ignores the `cameraDirection` parameter. +- `correctOrientation` パラメータを無視します。 -### Firefox OS Quirks +- `cameraDirection` パラメータを無視します。 -- Ignores the `quality` parameter. +### Firefox OS 特有の動作 -- `Camera.DestinationType` is ignored and equals `1` (image file URI) +- `quality` パラメータを無視します。 -- Ignores the `allowEdit` parameter. +- `Camera.DestinationType` を無視します。設定値が `1` と同様の動作をします ( 画像ファイルの URI )。 -- Ignores the `PictureSourceType` parameter (user chooses it in a dialog window) +- `allowEdit` パラメータを無視します。 -- Ignores the `encodingType` +- `PictureSourceType` パラメータを無視します ( ダイアログ ウィンドウ上でユーザが種類を選択 )。 -- Ignores the `targetWidth` and `targetHeight` +- `encodingType` パラメータを無視します。 -- `Camera.MediaType` is not supported. +- `targetWidth` と `targetHeight` を無視します。 -- Ignores the `correctOrientation` parameter. +- `Camera.MediaType` をサポートしません。 -- Ignores the `cameraDirection` parameter. +- `correctOrientation` パラメータを無視します。 -### iOS Quirks +- `cameraDirection` パラメータを無視します。 -- Set `quality` below 50 to avoid memory errors on some devices. +### iOS 特有の動作 -- When using `destinationType.FILE_URI`, photos are saved in the application's temporary directory. You may delete the contents of this directory using the `navigator.fileMgr` APIs if storage space is a concern. +- いくつかのデバイスで発生するメモリーエラーを防ぐため、 `quality` を 50 以下に設定してください。 -### Tizen Quirks +- `destinationType.FILE_URI` を使用した場合、アプリケーションの temporary ディレクトリに写真は保存されます。ストレージの空きが少ない場合、 `navigator.fileMgr` API を使用して、ディレクトリ内のコンテンツを消去できます。 -- options not supported +### Tizen 特有の動作 -- always returns a FILE URI +- オプション群をサポートしません。 -### Windows Phone 7 and 8 Quirks +- FILE URI を常に返します。 -- Ignores the `allowEdit` parameter. +### Windows Phone 7 と 8 特有の動作 -- Ignores the `correctOrientation` parameter. +- `allowEdit` パラメータを無視します。 -- Ignores the `cameraDirection` parameter. +- `correctOrientation` パラメータを無視します。 -- Ignores the `mediaType` property of `cameraOptions` as the Windows Phone SDK does not provide a way to choose videos from PHOTOLIBRARY. +- `cameraDirection` パラメータを無視します。 +- `cameraOptions` の `mediaType` プロパティを無視します。これは、Windows Phone SDK では、PHOTOLIBRARY からビデオを選択する方法を提供していないためです。 ## CameraError -onError callback function that provides an error message. +エラーメッセージを表示する、onError コールバック関数です。 function(message) { - // Show a helpful message + // エラーメッセージを表示 } -### Parameters +### パラメータ -- __message__: The message is provided by the device's native code. _(String)_ +- __message__: デバイスのネイティブコードが提供するメッセージ _(String)_ ## cameraSuccess @@ -322,11 +290,11 @@ onSuccess callback function that provides the image data. // Do something with the image } -### Parameters +### パラメータ - __imageData__: Base64 encoding of the image data, _or_ the image file URI, depending on `cameraOptions` in effect. _(String)_ -### Example +### 例 // Show image // @@ -338,25 +306,25 @@ onSuccess callback function that provides the image data. ## CameraPopoverHandle -A handle to the popover dialog created by `navigator.camera.getPicture`. +`navigator.camera.getPicture` で生成したポップオーバー ( popover ) ダイアログへのハンドルです。 -### Methods +### メソッド -- __setPosition__: Set the position of the popover. +- __setPosition__: ポップオーバー ( popover ) の位置を設定します。 -### Supported Platforms +### サポート対象のプラットフォーム - iOS ### setPosition -Set the position of the popover. +ポップオーバー ( popover ) の位置を設定します。 __Parameters__: -- `cameraPopoverOptions`: the `CameraPopoverOptions` that specify the new position +- `cameraPopoverOptions`: `CameraPopoverOptions` で、新しい位置を指定します。 -### Example +### 例 var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, { destinationType: Camera.DestinationType.FILE_URI, @@ -364,7 +332,7 @@ __Parameters__: popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) }); - // Reposition the popover if the orientation changes. + // デバイスの向きが変わったら、ポップオーバーの位置を再設定します。 window.onorientationchange = function() { var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); cameraPopoverHandle.setPosition(cameraPopoverOptions); @@ -373,9 +341,7 @@ __Parameters__: ## CameraPopoverOptions -iOS-only parameters that specify the anchor element location and arrow -direction of the popover when selecting images from an iPad's library -or album. +iOS 専用のパラメーターです。iPad のライブラリまたはアルバムから画像を選択するときのポップオーバー ( popover ) の固定位置と矢印の方向を指定します。 { x : 0, y : 32, @@ -386,48 +352,41 @@ or album. ### CameraPopoverOptions -- __x__: x pixel coordinate of screen element onto which to anchor the popover. _(Number)_ +- __x__: 画面上に表示するポップオーバー ( popover ) の x 座標をピクセルで表します。 _(Number)_ -- __y__: y pixel coordinate of screen element onto which to anchor the popover. _(Number)_ +- __y__: 画面上に表示するポップオーバー ( popover ) の y 座標をピクセルで表します。 _(Number)_ -- __width__: width, in pixels, of the screen element onto which to anchor the popover. _(Number)_ +- __width__: 画面上に表示するポップオーバー ( popover ) の幅をピクセルで表します。 _(Number)_ -- __height__: height, in pixels, of the screen element onto which to anchor the popover. _(Number)_ +- __height__: 画面上に表示するポップオーバー ( popover ) の高さをピクセルで表します。 _(Number)_ -- __arrowDir__: Direction the arrow on the popover should point. Defined in `Camera.PopoverArrowDirection` _(Number)_ +- __arrowDir__: ポップオーバー ( popover ) の矢印の向きを表します。 `Camera.PopoverArrowDirection` で定義します。 _(Number)_ Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants + ARROW_UP : 1, // iOS の UIPopoverArrowDirection 定数と同様 ARROW_DOWN : 2, ARROW_LEFT : 4, ARROW_RIGHT : 8, ARROW_ANY : 15 }; -Note that the size of the popover may change to adjust to the -direction of the arrow and orientation of the screen. Make sure to -account for orientation changes when specifying the anchor element -location. +注意 : ポップオーバーのサイズは矢印の方向や画面の向きによって調節され、変化することがあります。位置を固定するとき、画面の向きの変化を考慮に入れてください。 ## navigator.camera.cleanup -Removes intermediate photos taken by the camera from temporary -storage. +一時的なストレージに保存されている処理前の写真を削除します。 navigator.camera.cleanup( cameraSuccess, cameraError ); -### Description +### 解説 -Removes intermediate image files that are kept in temporary storage -after calling `camera.getPicture`. Applies only when the value of -`Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the -`Camera.destinationType` equals `Camera.DestinationType.FILE_URI`. +`camera.getPicture` を呼び出した後に取得し、一時的なストレージに保存されている処理前の画像ファイルを削除します。`Camera.sourceType` の値と `Camera.PictureSourceType.CAMERA` が等しく、また、 `Camera.destinationType` が `Camera.DestinationType.FILE_URI` と等しい場合のみ有効です。 -### Supported Platforms +### サポート対象のプラットフォーム - iOS -### Example +### 例 navigator.camera.cleanup(onSuccess, onFail); diff --git a/docs/jp/3.4.0/cordova/compass/index.md b/docs/jp/3.4.0/cordova/compass/index.md index 37d2f288a3..bde90efaad 100644 --- a/docs/jp/3.4.0/cordova/compass/index.md +++ b/docs/jp/3.4.0/cordova/compass/index.md @@ -19,16 +19,13 @@ # org.apache.cordova.device-orientation -This plugin provides access to the device's compass. The compass is a sensor -that detects the direction or heading that the device is pointed, typically -from the top of the device. It measures the heading in degrees from 0 to -359.99, where 0 is north. +このプラグインを使用して、デバイスのコンパスにアクセスします。コンパスは、デバイスが指し示す方向・方位を検知するセンサーの 1 種です。通常、デバイストップを起点とします。0 から 359.99 度の角度で方位を計算します。0 は、北を意味します。 -## Installation +## インストール cordova plugin add org.apache.cordova.device-orientation -## Supported Platforms +## サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -39,7 +36,7 @@ from the top of the device. It measures the heading in degrees from 0 to - Windows Phone 7 and 8 (if available in hardware) - Windows 8 -## Methods +## メソッド - navigator.compass.getCurrentHeading - navigator.compass.watchHeading @@ -47,12 +44,11 @@ from the top of the device. It measures the heading in degrees from 0 to ## navigator.compass.getCurrentHeading -Get the current compass heading. The compass heading is returned via a `CompassHeading` -object using the `compassSuccess` callback function. +コンパスの現在の方位を取得します。 `compassSuccess` コールバック関数を使用して、 `CompassHeading` オブジェクト経由でコンパスの方位を返します。 navigator.compass.getCurrentHeading(compassSuccess, compassError); -### Example +### 例 function onSuccess(heading) { alert('Heading: ' + heading.magneticHeading); @@ -66,20 +62,19 @@ object using the `compassSuccess` callback function. ## navigator.compass.watchHeading -Gets the device's current heading at a regular interval. Each time the heading -is retrieved, the `headingSuccess` callback function is executed. +デバイスの方位を一定の間隔で取得します。方位を取得するたび、 `headingSuccess` コールバック関数を実行します。 -The returned watch ID references the compass watch interval. The watch -ID can be used with `navigator.compass.clearWatch` to stop watching the navigator.compass. +返された watch ID を使用して、コンパスを監視する間隔を参照します。 `navigator.compass.clearWatch` に watch ID を使用して、navigator.compass の監視を停止できます。 var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]); -`compassOptions` may contain the following keys: +`compassOptions` には、以下のオプションを格納できます。 -- __frequency__: How often to retrieve the compass heading in milliseconds. _(Number)_ (Default: 100) -- __filter__: The change in degrees required to initiate a watchHeading success callback. When this value is set, __frequency__ is ignored. _(Number)_ +- __frequency__: コンパスの方位の取得頻度をミリ秒で表します。 _(Number)_ ( デフォルト : 100 ) -### Example +- __filter__: watchHeading の成功時のコールバック関数を実行する際に必要となる、角度の変化です。値を設定した場合、 __frequency:__ を無視します。 _(Number)_ + +### 例 function onSuccess(heading) { var element = document.getElementById('heading'); @@ -92,101 +87,98 @@ ID can be used with `navigator.compass.clearWatch` to stop watching the navigato var options = { frequency: 3000 - }; // Update every 3 seconds + }; // 3 秒間隔で更新 var watchID = navigator.compass.watchHeading(onSuccess, onError, options); -### iOS Quirks +### iOS 特有の動作 -Only one `watchHeading` can be in effect at one time in iOS. If a -`watchHeading` uses a filter, calling `getCurrentHeading` or -`watchHeading` uses the existing filter value to specify heading -changes. Watching heading changes with a filter is more efficient than -with time intervals. +iOS では、1 度に 1 つの `watchHeading` のみ有効です。 +`watchHeading` が filter を使用する場合、`getCurrentHeading` または `watchHeading` を呼び出す際、方位の変化を特定するため、既存の filter 値を使用します。filter を使用した方位の変化の監視は、時間の間隔を使用するより、効率的です。 -### Amazon Fire OS Quirks +### Amazon Fire OS 特有の動作 -- `filter` is not supported. +- `filter` はサポートしません。 -### Android Quirks +### Android 特有の動作 -- No support for `filter`. +- `filter` はサポートしません。 -### Firefox OS Quirks +### Firefox OS 特有の動作 -- No support for `filter`. +- `filter` はサポートしません。 -### Tizen Quirks +### Tizen 特有の動作 -- No support for `filter`. +- `filter` はサポートしません。 -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 -- No support for `filter`. +- `filter` はサポートしません。 ## navigator.compass.clearWatch -Stop watching the compass referenced by the watch ID parameter. +watch ID パラメーターを使用して参照を行っている、方位の監視を停止します。 navigator.compass.clearWatch(watchID); -- __watchID__: The ID returned by `navigator.compass.watchHeading`. +- __watchID__: `navigator.compass.watchHeading` が返す ID. -### Example +### 例 var watchID = navigator.compass.watchHeading(onSuccess, onError, options); - // ... later on ... + // ... 後から ... navigator.compass.clearWatch(watchID); ## CompassHeading -A `CompassHeading` object is returned to the `compassSuccess` callback function. +`compassSuccess` コールバック関数に `CompassHeading` オブジェクトを返します。 -### Properties +### プロパティ -- __magneticHeading__: The heading in degrees from 0-359.99 at a single moment in time. _(Number)_ +- __magneticHeading__: ある瞬間の磁方位 ( 磁北を基準 ) を 0 から 359.99 度の範囲で表します。 _(Number)_ -- __trueHeading__: The heading relative to the geographic North Pole in degrees 0-359.99 at a single moment in time. A negative value indicates that the true heading can't be determined. _(Number)_ +- __trueHeading__: ある瞬間の真方位 ( 真北を基準 ) を 0 から 359.99 度の範囲で表します。負の値は、真方位の値が定まっていないことを示します。 _(Number)_ -- __headingAccuracy__: The deviation in degrees between the reported heading and the true heading. _(Number)_ +- __headingAccuracy__: 取得した磁方位と真方位との角度の差 ( 偏角 ) を表します。 _(Number)_ -- __timestamp__: The time at which this heading was determined. _(milliseconds)_ +- __timestamp__: 方位を取得した時間を表します。 _(milliseconds)_ -### Amazon Fire OS Quirks +### Amazon Fire OS 特有の動作 -- `trueHeading` is not supported, but reports the same value as `magneticHeading` +- `trueHeading` プロパティをサポートしません。 `magneticHeading` と同じ値を取得します。 -- `headingAccuracy` is always 0 because there is no difference between the `magneticHeading` and `trueHeading` +- `trueHeading` と `magneticHeading` が同じ値になるため、 `headingAccuracy` プロパティは常に 0 となります。 -### Android Quirks +### Android 特有の動作 -- The `trueHeading` property is not supported, but reports the same value as `magneticHeading`. +- `trueHeading` プロパティをサポートしません。 `magneticHeading` と同じ値を取得します。 -- The `headingAccuracy` property is always 0 because there is no difference between the `magneticHeading` and `trueHeading`. +- `trueHeading` と `magneticHeading` が同じ値になるため、 `headingAccuracy` プロパティは常に 0 となります。 -### Firefox OS Quirks +### Firefox OS 特有の動作 -- The `trueHeading` property is not supported, but reports the same value as `magneticHeading`. +- `trueHeading` プロパティをサポートしません。 `magneticHeading` と同じ値を取得します。 -- The `headingAccuracy` property is always 0 because there is no difference between the `magneticHeading` and `trueHeading`. +- `trueHeading` と `magneticHeading` が同じ値になるため、 `headingAccuracy` プロパティは常に 0 となります。 -### iOS Quirks +### iOS 特有の動作 -- The `trueHeading` property is only returned for location services enabled via `navigator.geolocation.watchLocation()`. +- `navigator.geolocation.watchLocation()` 経由で、位置情報サービスが使用できる場合のみ、`trueHeading` を返します。 -- For iOS 4 devices and above, heading factors in the device's current orientation, and does not reference its absolute position, for apps that supports that orientation. +- デバイスの傾きをアプリ側で許容する場合には、それも方位の要素に組み入れて計算を行い、絶対位置を参照しません。 ## CompassError -A `CompassError` object is returned to the `compassError` callback function when an error occurs. +エラーが起きたとき、 `compassError` コールバック関数に `CompassError` オブジェクトを返します。 -### Properties +### プロパティ -- __code__: One of the predefined error codes listed below. +- __code__: 事前に定義された以下のエラーコードのうちの 1 つ ### Constants diff --git a/docs/jp/3.4.0/cordova/connection/index.md b/docs/jp/3.4.0/cordova/connection/index.md index d2834838ac..41cf641dcc 100644 --- a/docs/jp/3.4.0/cordova/connection/index.md +++ b/docs/jp/3.4.0/cordova/connection/index.md @@ -24,11 +24,11 @@ This plugin provides an implementation of an old version of the It provides information about the device's cellular and wifi connection, and whether the device has an internet connection. -## Installation +## インストール cordova plugin add org.apache.cordova.network-information -## Supported Platforms +## サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -40,9 +40,9 @@ wifi connection, and whether the device has an internet connection. # Connection -> The `connection` object, exposed via `navigator.connection`, provides information about the device's cellular and wifi connection. +> `navigator.connection` 経由で提供される `connection` オブジェクトを使用して、デバイスの携帯電話ネットワークと wifi 接続情報にアクセスできます。 -## Properties +## プロパティ - connection.type @@ -59,10 +59,9 @@ wifi connection, and whether the device has an internet connection. ## connection.type -This property offers a fast way to determine the device's network -connection state, and type of connection. +このプロパティを使用して、デバイスのネットワーク接続の状態および接続のタイプを確認します。 -### Quick Example +### 例 function checkConnection() { var networkState = navigator.connection.type; @@ -83,108 +82,92 @@ connection state, and type of connection. checkConnection(); -### API Change +### API の変更点 -Until Cordova 2.3.0, the `Connection` object was accessed via -`navigator.network.connection`, after which it was changed to -`navigator.connection` to match the W3C specification. It's still -available at its original location, but is deprecated and will -eventually be removed. +Cordova 2.3.0 までは、 `navigator.network.connection` 経由で `Connection` オブジェクトにアクセスしましたが、W3C の仕様に準拠するため、 `navigator.connection` 経由に変更しました。 `navigator.network.connection` は利用できますが、推奨しません。将来、削除する予定です。 -### iOS Quirks +### iOS 特有の動作 -- iOS can't detect the type of cellular network connection. - - `navigator.connection.type` is set to `Connection.CELL` for all cellular data. +- iOS では、携帯ネットワーク接続のタイプを特定できません。 + - すべての携帯ネットワークデータにおいて、 `navigator.connection.type` を `Connection.CELL` に設定します。 -### Windows Phone Quirks +### Windows Phone 特有の動作 -- When running in the emulator, always detects `navigator.connection.type` as `Connection.UNKNOWN`. +- エミュレーターで実行しているとき、 `navigator.connection.type` を `Connection.UNKNOWN` として常に認識します。 -- Windows Phone can't detect the type of cellular network connection. - - `navigator.connection.type` is set to `Connection.CELL` for all cellular data. +- Windows Phone では、ネットワーク接続のタイプを認識することが出来ません。 + - すべての携帯ネットワークデータにおいて、 `navigator.connection.type` を `Connection.CELL` に設定します。 -### Tizen Quirks +### Tizen 特有の動作 -- Tizen can only detect a WiFi or cellular connection. - - `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. +- Tizen では、WiFi または 携帯電話ネットワーク接続のみ認識できます。 + - すべての携帯ネットワークデータにおいて、 `navigator.connection.type` を `Connection.CELL_2G` に設定します。 -# Network-related Events +# ネットワーク関連のイベント ## offline -The event fires when an application goes offline, and the device is -not connected to the Internet. +アプリがオフラインになったときに、このイベントが発火して、インターネット接続が切れます。 document.addEventListener("offline", yourCallbackFunction, false); -### Details +### 詳細 -The `offline` event fires when a previously connected device loses a -network connection so that an application can no longer access the -Internet. It relies on the same information as the Connection API, -and fires when the `connection.type` changes from `NONE` to any other -value. +デバイスのネットワーク接続が切れたときに、 `offline` イベントが発火します。ネットワーク接続が切れているため、アプリは、インターネットへアクセスできません。Connection API と同じ情報を使用して、 `connection.type` が `NONE` から他の値に変わったときに発火します。 -Applications typically should use `document.addEventListener` to -attach an event listener once the `deviceready` event fires. +`deviceready` イベントの発火後、イベントリスナーをアタッチ ( attach ) するには、通常、 `document.addEventListener` を使用しなければなりません。 -### Quick Example +### 例 document.addEventListener("offline", onOffline, false); function onOffline() { - // Handle the offline event + // offline イベントの処理 } -### iOS Quirks +### iOS 特有の動作 -During initial startup, the first offline event (if applicable) takes at least a second to fire. +初回起動 ( initial startup ) 中は、最初の offline イベント ( 発火の条件が揃った場合 ) が発火するまで、最低 1 秒かかります。 -### Windows Phone 7 Quirks +### Windows Phone 7 特有の動作 -When running in the Emulator, the `connection.status` is always unknown, so this event does _not_ fire. +エミュレーターで実行するとき、 `connection.status` は、常に、unknown になっています。よって、このイベントは、 _発火しません_ 。 -### Windows Phone 8 Quirks +### Windows Phone 8 特有の動作 -The Emulator reports the connection type as `Cellular`, which does not change, so the event does _not_ fire. +エミュレーターを使用すると、常に、接続タイプ ( connection type ) を `Cellular` と認識します。 よって、このイベントは、 _発火しません_ 。 ## online -This event fires when an application goes online, and the device -becomes connected to the Internet. +アプリが、オンラインになったとき、このイベントが発火し、インターネットに接続します。 document.addEventListener("online", yourCallbackFunction, false); -### Details +### 詳細 -The `online` event fires when a previously unconnected device receives -a network connection to allow an application access to the Internet. -It relies on the same information as the Connection API, and fires -when the value of `connection.type` becomes `NONE`. +アプリからのインターネットへの接続を行うため、ネットワーク接続を行っていないデバイスがネットワーク接続を行うとき、 `online` イベントが発火します。Connection API と同じ情報を使用して、 `connection.type` が `NONE` に変わったときに発火します。 -Applications typically should use `document.addEventListener` to -attach an event listener once the `deviceready` event fires. +`deviceready` イベントの発火後、イベントリスナーをアタッチ ( attach ) するには、通常、 `document.addEventListener` を使用しなければなりません。 -### Quick Example +### 例 document.addEventListener("online", onOnline, false); function onOnline() { - // Handle the online event + // online イベントの処理 } -### iOS Quirks +### iOS 特有の動作 -During initial startup, the first `online` event (if applicable) takes -at least a second to fire, prior to which `connection.type` is -`UNKNOWN`. +初回起動 ( initial startup ) 中は、最初の online イベント ( 発火の条件が揃った場合 ) が発火するまで、最低 1 秒かかります。また、このイベントは、 +`connection.type` が `UNKNOWN` と認識される前に発火します。 -### Windows Phone 7 Quirks +### Windows Phone 7 特有の動作 -When running in the Emulator, the `connection.status` is always unknown, so this event does _not_ fire. +エミュレーターで実行するとき、 `connection.status` は、常に、unknown になっています。よって、このイベントは、 _発火しません_ 。 -### Windows Phone 8 Quirks +### Windows Phone 8 特有の動作 -The Emulator reports the connection type as `Cellular`, which does not change, so events does _not_ fire. +エミュレーターを使用すると、常に、接続タイプ ( connection type ) を `Cellular` と認識します。 よって、このイベントは、 _発火しません_ 。 diff --git a/docs/jp/3.4.0/cordova/contacts/index.md b/docs/jp/3.4.0/cordova/contacts/index.md index 0a78d4c463..dbc53546a9 100644 --- a/docs/jp/3.4.0/cordova/contacts/index.md +++ b/docs/jp/3.4.0/cordova/contacts/index.md @@ -38,11 +38,11 @@ clear and easy-to-understand user experience surrounding the use of contact data helps avoid user confusion and perceived misuse of contact data. For more information, please see the Privacy Guide. -## Installation +## インストール cordova plugin add org.apache.cordova.contacts -### Firefox OS Quirks +### Firefox OS 特有の動作 Create __www/manifest.webapp__ as described in [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). @@ -60,12 +60,12 @@ __WARNING__: All privileged apps enforce [Content Security Policy](https://devel ## navigator.contacts -### Methods +### メソッド - navigator.contacts.create - navigator.contacts.find -### Objects +### オブジェクト - Contact - ContactName @@ -82,7 +82,7 @@ The `navigator.contacts.create` method is synchronous, and returns a new `Contac This method does not retain the Contact object in the device contacts database, for which you need to invoke the `Contact.save` method. -### Supported Platforms +### サポート対象のプラットフォーム - Android - BlackBerry 10 @@ -90,7 +90,7 @@ database, for which you need to invoke the `Contact.save` method. - iOS - Windows Phone 7 and 8 -### Example +### 例 var myContact = navigator.contacts.create({"displayName": "Test User"}); @@ -114,7 +114,7 @@ case-insensitive, partial value match is applied to each field specified in the __contactFields__ parameter. If there's a match for _any_ of the specified fields, the contact is returned. -### Parameters +### パラメータ - __contactFields__: Contact fields to use as a search qualifier. The resulting `Contact` object only features values for these fields. _(DOMString[])_ [Required] @@ -128,7 +128,7 @@ _any_ of the specified fields, the contact is returned. - __multiple__: Determines if the find operation returns multiple navigator.contacts. _(Boolean)_ (Default: `false`) -### Supported Platforms +### サポート対象のプラットフォーム - Android - BlackBerry 10 @@ -137,7 +137,7 @@ _any_ of the specified fields, the contact is returned. - Windows Phone 7 and 8 - Windows 8 -### Example +### 例 function onSuccess(contacts) { alert('Found ' + navigator.contacts.length + ' navigator.contacts.'); @@ -167,7 +167,7 @@ every device platform. Please check each platform's _Quirks_ section for details. -### Properties +### プロパティ - __id__: A globally unique identifier. _(DOMString)_ @@ -197,7 +197,7 @@ for details. - __urls__: An array of web pages associated with the contact. _(ContactField[])_ -### Methods +### メソッド - __clone__: Returns a new `Contact` object that is a deep copy of the calling object, with the `id` property set to `null`. @@ -205,7 +205,7 @@ for details. - __save__: Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same __id__ already exists. -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -215,7 +215,7 @@ for details. - Windows Phone 7 and 8 - Windows 8 -### Save Example +### 保存 ( Save ) の例 function onSuccess(contact) { alert("Save Success"); @@ -239,7 +239,7 @@ for details. // save to device contact.save(onSuccess,onError); -### Clone Example +### 複写 ( Clone ) の例 // clone the contact object var clone = contact.clone(); @@ -247,7 +247,7 @@ for details. console.log("Original contact name = " + contact.name.givenName); console.log("Cloned contact name = " + clone.name.givenName); -### Remove Example +### 削除 ( Remove ) の例 function onSuccess() { alert("Removal Success"); @@ -261,11 +261,11 @@ for details. contact.remove(onSuccess,onError); -### Android 2.X Quirks +### Android 2.X 特有の動作 - __categories__: Not supported on Android 2.X devices, returning `null`. -### BlackBerry 10 Quirks +### BlackBerry 10 特有の動作 - __id__: Supported. Assigned by the device when saving the contact. @@ -289,7 +289,7 @@ for details. - __urls__: Partially supported. The first URL is stored in BlackBerry __webpage__ field. -### FirefoxOS Quirks +### FirefoxOS 特有の動作 - __categories__: Partially supported. Fields __pref__ and __type__ are returning `null` @@ -298,7 +298,7 @@ for details. - __photos__: Not supported -### iOS Quirks +### iOS 特有の動作 - __displayName__: Not supported on iOS, returning `null` unless there is no `ContactName` specified, in which case it returns the composite name, __nickname__ or `""`, respectively. @@ -308,7 +308,7 @@ for details. - __categories__: This property is currently not supported, returning `null`. -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 - __displayName__: When creating a contact, the value provided for the display name parameter differs from the display name retrieved when finding the contact. @@ -338,7 +338,7 @@ of a contact. A `Contact` object may include more than one address in a `ContactAddress[]` array. -### Properties +### プロパティ - __pref__: Set to `true` if this `ContactAddress` contains the user's preferred value. _(boolean)_ @@ -356,7 +356,7 @@ a `ContactAddress[]` array. - __country__: The country name. _(DOMString)_ -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -366,7 +366,7 @@ a `ContactAddress[]` array. - Windows Phone 7 and 8 - Windows 8 -### Example +### 例 // display the address information for all contacts @@ -395,11 +395,11 @@ a `ContactAddress[]` array. var filter = ["displayName", "addresses"]; navigator.contacts.find(filter, onSuccess, onError, options); -### Android 2.X Quirks +### Android 2.X 特有の動作 - __pref__: Not supported, returning `false` on Android 2.X devices. -### BlackBerry 10 Quirks +### BlackBerry 10 特有の動作 - __pref__: Not supported on BlackBerry devices, returning `false`. @@ -417,11 +417,11 @@ a `ContactAddress[]` array. - __country__: Supported. -### FirefoxOS Quirks +### FirefoxOS 特有の動作 - __formatted__: Currently not supported -### iOS Quirks +### iOS 特有の動作 - __pref__: Not supported on iOS devices, returning `false`. @@ -433,7 +433,7 @@ a `ContactAddress[]` array. The `ContactError` object is returned to the user through the `contactError` callback function when an error occurs. -### Properties +### プロパティ - __code__: One of the predefined error codes listed below. @@ -466,7 +466,7 @@ __url__ when the __value__ attribute contains a URL to the photo image, or _base64_ when the __value__ contains a base64-encoded image string. -### Properties +### プロパティ - __type__: A string that indicates what type of field this is, _home_ for example. _(DOMString)_ @@ -474,7 +474,7 @@ string. - __pref__: Set to `true` if this `ContactField` contains the user's preferred value. _(boolean)_ -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -484,7 +484,7 @@ string. - Windows Phone 7 and 8 - Windows 8 -### Example +### 例 // create a new contact var contact = navigator.contacts.create(); @@ -499,11 +499,11 @@ string. // save the contact contact.save(); -### Android Quirks +### Android 特有の動作 - __pref__: Not supported, returning `false`. -### BlackBerry 10 Quirks +### BlackBerry 10 特有の動作 - __type__: Partially supported. Used for phone numbers. @@ -511,7 +511,7 @@ string. - __pref__: Not supported, returning `false`. -### iOS Quirks +### iOS 特有の動作 - __pref__: Not supported, returning `false`. @@ -520,7 +520,7 @@ string. Contains different kinds of information about a `Contact` object's name. -### Properties +### プロパティ - __formatted__: The complete name of the contact. _(DOMString)_ @@ -534,7 +534,7 @@ Contains different kinds of information about a `Contact` object's name. - __honorificSuffix__: The contact's suffix (example _Esq._). _(DOMString)_ -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android 2.X @@ -544,7 +544,7 @@ Contains different kinds of information about a `Contact` object's name. - Windows Phone 7 and 8 - Windows 8 -### Example +### 例 function onSuccess(contacts) { for (var i = 0; i < navigator.contacts.length; i++) { @@ -566,11 +566,11 @@ Contains different kinds of information about a `Contact` object's name. filter = ["displayName", "name"]; navigator.contacts.find(filter, onSuccess, onError, options); -### Android Quirks +### Android 特有の動作 - __formatted__: Partially supported, and read-only. Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`. -### BlackBerry 10 Quirks +### BlackBerry 10 特有の動作 - __formatted__: Partially supported. Returns a concatenation of BlackBerry __firstName__ and __lastName__ fields. @@ -584,11 +584,11 @@ Contains different kinds of information about a `Contact` object's name. - __honorificSuffix__: Not supported, returning `null`. -### FirefoxOS Quirks +### FirefoxOS 特有の動作 - __formatted__: Partially supported, and read-only. Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`. -### iOS Quirks +### iOS 特有の動作 - __formatted__: Partially supported. Returns iOS Composite Name, but is read-only. @@ -599,7 +599,7 @@ The `ContactOrganization` object stores a contact's organization properties. A `Contact` object stores one or more `ContactOrganization` objects in an array. -### Properties +### プロパティ - __pref__: Set to `true` if this `ContactOrganization` contains the user's preferred value. _(boolean)_ @@ -612,7 +612,7 @@ properties. A `Contact` object stores one or more - __title__: The contact's title at the organization. _(DOMString)_ -### Supported Platforms +### サポート対象のプラットフォーム - Android - BlackBerry 10 @@ -621,7 +621,7 @@ properties. A `Contact` object stores one or more - Windows Phone 7 and 8 - Windows 8 -### Example +### 例 function onSuccess(contacts) { for (var i = 0; i < navigator.contacts.length; i++) { @@ -644,11 +644,11 @@ properties. A `Contact` object stores one or more filter = ["displayName", "organizations"]; navigator.contacts.find(filter, onSuccess, onError, options); -### Android 2.X Quirks +### Android 2.X 特有の動作 - __pref__: Not supported by Android 2.X devices, returning `false`. -### BlackBerry 10 Quirks +### BlackBerry 10 特有の動作 - __pref__: Not supported by BlackBerry devices, returning `false`. @@ -660,7 +660,7 @@ properties. A `Contact` object stores one or more - __title__: Partially supported. The first organization title is stored in the BlackBerry __jobTitle__ field. -### Firefox OS Quirks +### Firefox OS 特有の動作 - __pref__: Not supported @@ -670,7 +670,7 @@ properties. A `Contact` object stores one or more - Fields __name__ and __title__ stored in __org__ and __jobTitle__. -### iOS Quirks +### iOS 特有の動作 - __pref__: Not supported on iOS devices, returning `false`. diff --git a/docs/jp/3.4.0/cordova/device/index.md b/docs/jp/3.4.0/cordova/device/index.md index 9e5c677943..adc0703180 100644 --- a/docs/jp/3.4.0/cordova/device/index.md +++ b/docs/jp/3.4.0/cordova/device/index.md @@ -27,11 +27,11 @@ Although the object is in the global scope, it is not available until after the console.log(device.cordova); } -## Installation +## インストール cordova plugin add org.apache.cordova.device -## Properties +## プロパティ - device.cordova - device.model @@ -44,7 +44,7 @@ Although the object is in the global scope, it is not available until after the Get the version of Cordova running on the device. -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -61,7 +61,7 @@ The `device.model` 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. -### Supported Platforms +### サポート対象のプラットフォーム - Android - BlackBerry 10 @@ -70,7 +70,7 @@ different across versions of the same product. - Windows Phone 7 and 8 - Windows 8 -### Quick Example +### 例 // Android: Nexus One returns "Passion" (Nexus One code name) // Motorola Droid returns "voles" @@ -79,15 +79,15 @@ different across versions of the same product. // var model = device.model; -### Android Quirks +### Android 特有の動作 - Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`. -### Tizen Quirks +### Tizen 特有の動作 - Returns the device model assigned by the vendor, for example, `TIZEN` -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 - Returns the device model specified by the manufacturer. For example, the Samsung Focus returns `SGH-i917`. @@ -101,7 +101,7 @@ Get the device's operating system name. var string = device.platform; -### Supported Platforms +### サポート対象のプラットフォーム - Android - BlackBerry 10 @@ -111,7 +111,7 @@ Get the device's operating system name. - Windows Phone 7 and 8 - Windows 8 -### Quick Example +### 例 // Depending on the device, a few examples are: // - "Android" @@ -121,11 +121,11 @@ Get the device's operating system name. // - "Tizen" var devicePlatform = device.platform; -### Windows Phone 7 Quirks +### Windows Phone 7 特有の動作 Windows Phone 7 devices report the platform as `WinCE`. -### Windows Phone 8 Quirks +### Windows Phone 8 特有の動作 Windows Phone 8 devices report the platform as `Win32NT`. @@ -135,11 +135,11 @@ Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/w var string = device.uuid; -### Description +### 解説 The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model. -### Supported Platforms +### サポート対象のプラットフォーム - Android - BlackBerry 10 @@ -148,7 +148,7 @@ The details of how a UUID is generated are determined by the device manufacturer - Windows Phone 7 and 8 - Windows 8 -### Quick Example +### 例 // Android: Returns a random 64-bit integer (as a string, again!) // The integer is generated on the device's first boot @@ -166,7 +166,7 @@ The details of how a UUID is generated are determined by the device manufacturer // unique to every GSM and UMTS mobile phone. var deviceID = device.uuid; -### iOS Quirk +### iOS 特有の動作 The `uuid` on iOS is not unique to a device, but varies for each application, for each installation. It changes if you delete and @@ -174,7 +174,7 @@ re-install the app, and possibly also when you upgrade iOS, or even upgrade the app per version (apparent in iOS 5.1). The `uuid` is not a reliable value. -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 The `uuid` for Windows Phone 7 requires the permission `ID_CAP_IDENTITY_DEVICE`. Microsoft will likely deprecate this @@ -188,7 +188,7 @@ Get the operating system version. var string = device.version; -### Supported Platforms +### サポート対象のプラットフォーム - Android 2.1+ - BlackBerry 10 @@ -197,7 +197,7 @@ Get the operating system version. - Windows Phone 7 and 8 - Windows 8 -### Quick Example +### 例 // Android: Froyo OS would return "2.2" // Eclair OS would return "2.1", "2.0.1", or "2.0" diff --git a/docs/jp/3.4.0/cordova/dialogs/index.md b/docs/jp/3.4.0/cordova/dialogs/index.md index 1cb3e0969e..b6b537f112 100644 --- a/docs/jp/3.4.0/cordova/dialogs/index.md +++ b/docs/jp/3.4.0/cordova/dialogs/index.md @@ -21,11 +21,11 @@ This plugin provides access to some native dialog UI elements. -## Installation +## インストール cordova plugin add org.apache.cordova.dialogs -### Firefox OS Quirks +### Firefox OS 特有の動作 Create __www/manifest.webapp__ as described in [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). @@ -41,7 +41,7 @@ Edit __www/index.html__ and add following in `head` section: -## Methods +## メソッド - `navigator.notification.alert` - `navigator.notification.confirm` @@ -65,7 +65,7 @@ function, which is typically less customizable. - __buttonName__: Button name. _(String)_ (Optional, defaults to `OK`) -### Example +### 例 function alertDismissed() { // do something @@ -78,7 +78,7 @@ function, which is typically less customizable. 'Done' // buttonName ); -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -89,7 +89,7 @@ function, which is typically less customizable. - Windows Phone 7 and 8 - Windows 8 -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 - There is no built-in browser alert, but you can bind one as follows to call `alert()` in the global scope: @@ -97,7 +97,7 @@ function, which is typically less customizable. - Both `alert` and `confirm` are non-blocking calls, results of which are only available asynchronously. -### Firefox OS Quirks: +### Firefox OS 特有の動作 Both native-blocking `window.alert()` and non-blocking `navigator.notification.alert()` are available. @@ -125,7 +125,7 @@ The callback takes the argument `buttonIndex` _(Number)_, which is the index of the pressed button. Note that the index uses one-based indexing, so the value is `1`, `2`, `3`, etc. -### Example +### 例 function onConfirm(buttonIndex) { alert('You selected button ' + buttonIndex); @@ -138,7 +138,7 @@ indexing, so the value is `1`, `2`, `3`, etc. ['Restart','Exit'] // buttonLabels ); -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -149,7 +149,7 @@ indexing, so the value is `1`, `2`, `3`, etc. - Windows Phone 7 and 8 - Windows 8 -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 - There is no built-in browser function for `window.confirm`, but you can bind it by assigning: @@ -157,7 +157,7 @@ indexing, so the value is `1`, `2`, `3`, etc. - Calls to `alert` and `confirm` are non-blocking, so the result is only available asynchronously. -### Firefox OS Quirks: +### Firefox OS 特有の動作 Both native-blocking `window.confirm()` and non-blocking `navigator.notification.confirm()` are available. @@ -187,7 +187,7 @@ contains the following properties: - __input1__: The text entered in the prompt dialog box. _(String)_ -### Example +### 例 function onPrompt(results) { alert("You selected button number " + results.buttonIndex + " and entered " + results.input1); @@ -201,20 +201,20 @@ contains the following properties: 'Jane Doe' // defaultText ); -### Supported Platforms +### Sサポート対象のプラットフォーム - Amazon Fire OS - Android - Firefox OS - iOS -### Android Quirks +### Android 特有の動作 - Android supports a maximum of three buttons, and ignores any more than that. - On Android 3.0 and later, buttons are displayed in reverse order for devices that use the Holo theme. -### Firefox OS Quirks: +### Firefox OS 特有の動作 Both native-blocking `window.prompt()` and non-blocking `navigator.notification.prompt()` are available. @@ -226,12 +226,12 @@ The device plays a beep sound. - __times__: The number of times to repeat the beep. _(Number)_ -### Example +### 例 // Beep twice! navigator.notification.beep(2); -### Supported Platforms +### サポート対象のプラットフォーム - Amazon Fire OS - Android @@ -241,19 +241,19 @@ The device plays a beep sound. - Windows Phone 7 and 8 - Windows 8 -### Amazon Fire OS Quirks +### Amazon Fire OS 特有の動作 - Amazon Fire OS plays the default __Notification Sound__ specified under the __Settings/Display & Sound__ panel. -### Android Quirks +### Android 特有の動作 - Android plays the default __Notification ringtone__ specified under the __Settings/Sound & Display__ panel. -### Windows Phone 7 and 8 Quirks +### Windows Phone 7 と 8 特有の動作 - Relies on a generic beep file from the Cordova distribution. -### Tizen Quirks +### Tizen 特有の動作 - Tizen implements beeps by playing an audio file via the media API. diff --git a/docs/jp/3.4.0/cordova/events/events.backbutton.md b/docs/jp/3.4.0/cordova/events/events.backbutton.md index c40d00a699..02b84079fa 100644 --- a/docs/jp/3.4.0/cordova/events/events.backbutton.md +++ b/docs/jp/3.4.0/cordova/events/events.backbutton.md @@ -19,57 +19,53 @@ # backbutton -The event fires when the user presses the back button. +戻るボタンを押したときに、このイベントが発火します。 document.addEventListener("backbutton", yourCallbackFunction, false); -## Details +## 詳細 -To override the default back-button behavior, register an event -listener for the `backbutton` event, typically by calling -`document.addEventListener` once you receive the `deviceready` event. -It is no longer necessary to call any other method to override the -back-button behavior. +デフォルトの戻るボタンの挙動を上書きしたい場合、 `backbutton` イベントにイベントリスナーを登録して下さい。通常は、 `deviceready` イベントを受け取った後、 `document.addEventListener` を呼び出し、登録を行います。戻るボタンの挙動を上書きするために、他のメソッドを呼び出す必要はありません。 -## Supported Platforms +## サポート対象のプラットフォーム - Amazon Fire OS - Android - BlackBerry 10 - Windows Phone 7 and 8 -## Quick Example +## 例 document.addEventListener("backbutton", onBackKeyDown, false); function onBackKeyDown() { - // Handle the back button + // 戻るボタンを押したときの処理 } -## Full Example +## 詳細な例 - Back Button Example + 戻るボタンの使用例 diff --git a/docs/jp/3.4.0/cordova/events/events.endcallbutton.md b/docs/jp/3.4.0/cordova/events/events.endcallbutton.md index 8b3e21d229..e72a8ddd86 100644 --- a/docs/jp/3.4.0/cordova/events/events.endcallbutton.md +++ b/docs/jp/3.4.0/cordova/events/events.endcallbutton.md @@ -19,54 +19,53 @@ # endcallbutton -This event fires when the user presses the end call button. +通話終了ボタンを押したときに、このイベントが発火します。 document.addEventListener("endcallbutton", yourCallbackFunction, false); -## Details +## 詳細 -The event overrides the default end call behavior. +このイベントはデフォルトの通話終了ボタンの挙動を上書きします。 -Applications typically should use `document.addEventListener` to -attach an event listener once the `deviceready` event fires. +`deviceready` イベントの発火後、イベントリスナーをアタッチ ( attach ) するには、通常、 `document.addEventListener` を使用しなければなりません。 -## Supported Platforms + +## サポート対象のプラットフォーム - BlackBerry 10 -## Quick Example +## 例 document.addEventListener("endcallbutton", onEndCallKeyDown, false); function onEndCallKeyDown() { - // Handle the end call button - } + // 通話終了ボタンを押したときの処理 -## Full Example +## 詳細な例 - End Call Button Example + 通話終了ボタンの使用例