From 7f8a96965254ba39f65da67b6e68d2285e22b88b Mon Sep 17 00:00:00 2001 From: kazushi Date: Fri, 30 Aug 2013 13:54:33 +0900 Subject: [PATCH 1/2] 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 e87c55c744becd48d5b6f69d83ef33fe177d3d9a Mon Sep 17 00:00:00 2001 From: Watabe Date: Wed, 26 Mar 2014 10:23:27 +0900 Subject: [PATCH 2/2] cordova and guide folders are copied --- docs/{en => jp}/3.4.0/cordova/events/events.backbutton.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.deviceready.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.endcallbutton.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.menubutton.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.pause.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.resume.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.searchbutton.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.startcallbutton.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.volumedownbutton.md | 0 docs/{en => jp}/3.4.0/cordova/events/events.volumeupbutton.md | 0 docs/{en => jp}/3.4.0/cordova/plugins/pluginapis.md | 0 docs/{en => jp}/3.4.0/cordova/storage/storage.md | 0 docs/{en => jp}/3.4.0/guide/appdev/privacy/index.md | 0 docs/{en => jp}/3.4.0/guide/appdev/whitelist/index.md | 0 docs/{en => jp}/3.4.0/guide/cli/index.md | 0 docs/{en => jp}/3.4.0/guide/hybrid/plugins/index.md | 0 docs/{en => jp}/3.4.0/guide/hybrid/webviews/index.md | 0 docs/{en => jp}/3.4.0/guide/overview/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/config.md | 0 docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/plugin.md | 0 docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/webview.md | 0 docs/{en => jp}/3.4.0/guide/platforms/android/config.md | 0 docs/{en => jp}/3.4.0/guide/platforms/android/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/android/plugin.md | 0 docs/{en => jp}/3.4.0/guide/platforms/android/tools.md | 0 docs/{en => jp}/3.4.0/guide/platforms/android/upgrading.md | 0 docs/{en => jp}/3.4.0/guide/platforms/android/webview.md | 0 docs/{en => jp}/3.4.0/guide/platforms/blackberry10/config.md | 0 docs/{en => jp}/3.4.0/guide/platforms/blackberry10/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/blackberry10/plugin.md | 0 docs/{en => jp}/3.4.0/guide/platforms/blackberry10/tools.md | 0 docs/{en => jp}/3.4.0/guide/platforms/blackberry10/upgrading.md | 0 docs/{en => jp}/3.4.0/guide/platforms/firefoxos/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/ios/config.md | 0 docs/{en => jp}/3.4.0/guide/platforms/ios/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/ios/plugin.md | 0 docs/{en => jp}/3.4.0/guide/platforms/ios/tools.md | 0 docs/{en => jp}/3.4.0/guide/platforms/ios/upgrading.md | 0 docs/{en => jp}/3.4.0/guide/platforms/ios/webview.md | 0 docs/{en => jp}/3.4.0/guide/platforms/tizen/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/ubuntu/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/win8/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/win8/tools.md | 0 docs/{en => jp}/3.4.0/guide/platforms/win8/upgrading.md | 0 docs/{en => jp}/3.4.0/guide/platforms/wp7/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/wp8/index.md | 0 docs/{en => jp}/3.4.0/guide/platforms/wp8/plugin.md | 0 docs/{en => jp}/3.4.0/guide/platforms/wp8/tools.md | 0 docs/{en => jp}/3.4.0/guide/platforms/wp8/upgrading.md | 0 docs/{en => jp}/3.4.0/guide/support/index.md | 0 53 files changed, 0 insertions(+), 0 deletions(-) rename docs/{en => jp}/3.4.0/cordova/events/events.backbutton.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.deviceready.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.endcallbutton.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.menubutton.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.pause.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.resume.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.searchbutton.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.startcallbutton.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.volumedownbutton.md (100%) rename docs/{en => jp}/3.4.0/cordova/events/events.volumeupbutton.md (100%) rename docs/{en => jp}/3.4.0/cordova/plugins/pluginapis.md (100%) rename docs/{en => jp}/3.4.0/cordova/storage/storage.md (100%) rename docs/{en => jp}/3.4.0/guide/appdev/privacy/index.md (100%) rename docs/{en => jp}/3.4.0/guide/appdev/whitelist/index.md (100%) rename docs/{en => jp}/3.4.0/guide/cli/index.md (100%) rename docs/{en => jp}/3.4.0/guide/hybrid/plugins/index.md (100%) rename docs/{en => jp}/3.4.0/guide/hybrid/webviews/index.md (100%) rename docs/{en => jp}/3.4.0/guide/overview/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/config.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/plugin.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/amazonfireos/webview.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/android/config.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/android/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/android/plugin.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/android/tools.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/android/upgrading.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/android/webview.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/blackberry10/config.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/blackberry10/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/blackberry10/plugin.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/blackberry10/tools.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/blackberry10/upgrading.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/firefoxos/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/ios/config.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/ios/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/ios/plugin.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/ios/tools.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/ios/upgrading.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/ios/webview.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/tizen/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/ubuntu/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/win8/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/win8/tools.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/win8/upgrading.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/wp7/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/wp8/index.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/wp8/plugin.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/wp8/tools.md (100%) rename docs/{en => jp}/3.4.0/guide/platforms/wp8/upgrading.md (100%) rename docs/{en => jp}/3.4.0/guide/support/index.md (100%) diff --git a/docs/en/3.4.0/cordova/events/events.backbutton.md b/docs/jp/3.4.0/cordova/events/events.backbutton.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.backbutton.md rename to docs/jp/3.4.0/cordova/events/events.backbutton.md diff --git a/docs/en/3.4.0/cordova/events/events.deviceready.md b/docs/jp/3.4.0/cordova/events/events.deviceready.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.deviceready.md rename to docs/jp/3.4.0/cordova/events/events.deviceready.md diff --git a/docs/en/3.4.0/cordova/events/events.endcallbutton.md b/docs/jp/3.4.0/cordova/events/events.endcallbutton.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.endcallbutton.md rename to docs/jp/3.4.0/cordova/events/events.endcallbutton.md diff --git a/docs/en/3.4.0/cordova/events/events.md b/docs/jp/3.4.0/cordova/events/events.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.md rename to docs/jp/3.4.0/cordova/events/events.md diff --git a/docs/en/3.4.0/cordova/events/events.menubutton.md b/docs/jp/3.4.0/cordova/events/events.menubutton.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.menubutton.md rename to docs/jp/3.4.0/cordova/events/events.menubutton.md diff --git a/docs/en/3.4.0/cordova/events/events.pause.md b/docs/jp/3.4.0/cordova/events/events.pause.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.pause.md rename to docs/jp/3.4.0/cordova/events/events.pause.md diff --git a/docs/en/3.4.0/cordova/events/events.resume.md b/docs/jp/3.4.0/cordova/events/events.resume.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.resume.md rename to docs/jp/3.4.0/cordova/events/events.resume.md diff --git a/docs/en/3.4.0/cordova/events/events.searchbutton.md b/docs/jp/3.4.0/cordova/events/events.searchbutton.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.searchbutton.md rename to docs/jp/3.4.0/cordova/events/events.searchbutton.md diff --git a/docs/en/3.4.0/cordova/events/events.startcallbutton.md b/docs/jp/3.4.0/cordova/events/events.startcallbutton.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.startcallbutton.md rename to docs/jp/3.4.0/cordova/events/events.startcallbutton.md diff --git a/docs/en/3.4.0/cordova/events/events.volumedownbutton.md b/docs/jp/3.4.0/cordova/events/events.volumedownbutton.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.volumedownbutton.md rename to docs/jp/3.4.0/cordova/events/events.volumedownbutton.md diff --git a/docs/en/3.4.0/cordova/events/events.volumeupbutton.md b/docs/jp/3.4.0/cordova/events/events.volumeupbutton.md similarity index 100% rename from docs/en/3.4.0/cordova/events/events.volumeupbutton.md rename to docs/jp/3.4.0/cordova/events/events.volumeupbutton.md diff --git a/docs/en/3.4.0/cordova/plugins/pluginapis.md b/docs/jp/3.4.0/cordova/plugins/pluginapis.md similarity index 100% rename from docs/en/3.4.0/cordova/plugins/pluginapis.md rename to docs/jp/3.4.0/cordova/plugins/pluginapis.md diff --git a/docs/en/3.4.0/cordova/storage/storage.md b/docs/jp/3.4.0/cordova/storage/storage.md similarity index 100% rename from docs/en/3.4.0/cordova/storage/storage.md rename to docs/jp/3.4.0/cordova/storage/storage.md diff --git a/docs/en/3.4.0/guide/appdev/privacy/index.md b/docs/jp/3.4.0/guide/appdev/privacy/index.md similarity index 100% rename from docs/en/3.4.0/guide/appdev/privacy/index.md rename to docs/jp/3.4.0/guide/appdev/privacy/index.md diff --git a/docs/en/3.4.0/guide/appdev/whitelist/index.md b/docs/jp/3.4.0/guide/appdev/whitelist/index.md similarity index 100% rename from docs/en/3.4.0/guide/appdev/whitelist/index.md rename to docs/jp/3.4.0/guide/appdev/whitelist/index.md diff --git a/docs/en/3.4.0/guide/cli/index.md b/docs/jp/3.4.0/guide/cli/index.md similarity index 100% rename from docs/en/3.4.0/guide/cli/index.md rename to docs/jp/3.4.0/guide/cli/index.md diff --git a/docs/en/3.4.0/guide/hybrid/plugins/index.md b/docs/jp/3.4.0/guide/hybrid/plugins/index.md similarity index 100% rename from docs/en/3.4.0/guide/hybrid/plugins/index.md rename to docs/jp/3.4.0/guide/hybrid/plugins/index.md diff --git a/docs/en/3.4.0/guide/hybrid/webviews/index.md b/docs/jp/3.4.0/guide/hybrid/webviews/index.md similarity index 100% rename from docs/en/3.4.0/guide/hybrid/webviews/index.md rename to docs/jp/3.4.0/guide/hybrid/webviews/index.md diff --git a/docs/en/3.4.0/guide/overview/index.md b/docs/jp/3.4.0/guide/overview/index.md similarity index 100% rename from docs/en/3.4.0/guide/overview/index.md rename to docs/jp/3.4.0/guide/overview/index.md diff --git a/docs/en/3.4.0/guide/platforms/amazonfireos/config.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/config.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/amazonfireos/config.md rename to docs/jp/3.4.0/guide/platforms/amazonfireos/config.md diff --git a/docs/en/3.4.0/guide/platforms/amazonfireos/index.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/amazonfireos/index.md rename to docs/jp/3.4.0/guide/platforms/amazonfireos/index.md diff --git a/docs/en/3.4.0/guide/platforms/amazonfireos/plugin.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/plugin.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/amazonfireos/plugin.md rename to docs/jp/3.4.0/guide/platforms/amazonfireos/plugin.md diff --git a/docs/en/3.4.0/guide/platforms/amazonfireos/webview.md b/docs/jp/3.4.0/guide/platforms/amazonfireos/webview.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/amazonfireos/webview.md rename to docs/jp/3.4.0/guide/platforms/amazonfireos/webview.md diff --git a/docs/en/3.4.0/guide/platforms/android/config.md b/docs/jp/3.4.0/guide/platforms/android/config.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/android/config.md rename to docs/jp/3.4.0/guide/platforms/android/config.md diff --git a/docs/en/3.4.0/guide/platforms/android/index.md b/docs/jp/3.4.0/guide/platforms/android/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/android/index.md rename to docs/jp/3.4.0/guide/platforms/android/index.md diff --git a/docs/en/3.4.0/guide/platforms/android/plugin.md b/docs/jp/3.4.0/guide/platforms/android/plugin.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/android/plugin.md rename to docs/jp/3.4.0/guide/platforms/android/plugin.md diff --git a/docs/en/3.4.0/guide/platforms/android/tools.md b/docs/jp/3.4.0/guide/platforms/android/tools.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/android/tools.md rename to docs/jp/3.4.0/guide/platforms/android/tools.md diff --git a/docs/en/3.4.0/guide/platforms/android/upgrading.md b/docs/jp/3.4.0/guide/platforms/android/upgrading.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/android/upgrading.md rename to docs/jp/3.4.0/guide/platforms/android/upgrading.md diff --git a/docs/en/3.4.0/guide/platforms/android/webview.md b/docs/jp/3.4.0/guide/platforms/android/webview.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/android/webview.md rename to docs/jp/3.4.0/guide/platforms/android/webview.md diff --git a/docs/en/3.4.0/guide/platforms/blackberry10/config.md b/docs/jp/3.4.0/guide/platforms/blackberry10/config.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/blackberry10/config.md rename to docs/jp/3.4.0/guide/platforms/blackberry10/config.md diff --git a/docs/en/3.4.0/guide/platforms/blackberry10/index.md b/docs/jp/3.4.0/guide/platforms/blackberry10/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/blackberry10/index.md rename to docs/jp/3.4.0/guide/platforms/blackberry10/index.md diff --git a/docs/en/3.4.0/guide/platforms/blackberry10/plugin.md b/docs/jp/3.4.0/guide/platforms/blackberry10/plugin.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/blackberry10/plugin.md rename to docs/jp/3.4.0/guide/platforms/blackberry10/plugin.md diff --git a/docs/en/3.4.0/guide/platforms/blackberry10/tools.md b/docs/jp/3.4.0/guide/platforms/blackberry10/tools.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/blackberry10/tools.md rename to docs/jp/3.4.0/guide/platforms/blackberry10/tools.md diff --git a/docs/en/3.4.0/guide/platforms/blackberry10/upgrading.md b/docs/jp/3.4.0/guide/platforms/blackberry10/upgrading.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/blackberry10/upgrading.md rename to docs/jp/3.4.0/guide/platforms/blackberry10/upgrading.md diff --git a/docs/en/3.4.0/guide/platforms/firefoxos/index.md b/docs/jp/3.4.0/guide/platforms/firefoxos/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/firefoxos/index.md rename to docs/jp/3.4.0/guide/platforms/firefoxos/index.md diff --git a/docs/en/3.4.0/guide/platforms/index.md b/docs/jp/3.4.0/guide/platforms/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/index.md rename to docs/jp/3.4.0/guide/platforms/index.md diff --git a/docs/en/3.4.0/guide/platforms/ios/config.md b/docs/jp/3.4.0/guide/platforms/ios/config.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/ios/config.md rename to docs/jp/3.4.0/guide/platforms/ios/config.md diff --git a/docs/en/3.4.0/guide/platforms/ios/index.md b/docs/jp/3.4.0/guide/platforms/ios/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/ios/index.md rename to docs/jp/3.4.0/guide/platforms/ios/index.md diff --git a/docs/en/3.4.0/guide/platforms/ios/plugin.md b/docs/jp/3.4.0/guide/platforms/ios/plugin.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/ios/plugin.md rename to docs/jp/3.4.0/guide/platforms/ios/plugin.md diff --git a/docs/en/3.4.0/guide/platforms/ios/tools.md b/docs/jp/3.4.0/guide/platforms/ios/tools.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/ios/tools.md rename to docs/jp/3.4.0/guide/platforms/ios/tools.md diff --git a/docs/en/3.4.0/guide/platforms/ios/upgrading.md b/docs/jp/3.4.0/guide/platforms/ios/upgrading.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/ios/upgrading.md rename to docs/jp/3.4.0/guide/platforms/ios/upgrading.md diff --git a/docs/en/3.4.0/guide/platforms/ios/webview.md b/docs/jp/3.4.0/guide/platforms/ios/webview.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/ios/webview.md rename to docs/jp/3.4.0/guide/platforms/ios/webview.md diff --git a/docs/en/3.4.0/guide/platforms/tizen/index.md b/docs/jp/3.4.0/guide/platforms/tizen/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/tizen/index.md rename to docs/jp/3.4.0/guide/platforms/tizen/index.md diff --git a/docs/en/3.4.0/guide/platforms/ubuntu/index.md b/docs/jp/3.4.0/guide/platforms/ubuntu/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/ubuntu/index.md rename to docs/jp/3.4.0/guide/platforms/ubuntu/index.md diff --git a/docs/en/3.4.0/guide/platforms/win8/index.md b/docs/jp/3.4.0/guide/platforms/win8/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/win8/index.md rename to docs/jp/3.4.0/guide/platforms/win8/index.md diff --git a/docs/en/3.4.0/guide/platforms/win8/tools.md b/docs/jp/3.4.0/guide/platforms/win8/tools.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/win8/tools.md rename to docs/jp/3.4.0/guide/platforms/win8/tools.md diff --git a/docs/en/3.4.0/guide/platforms/win8/upgrading.md b/docs/jp/3.4.0/guide/platforms/win8/upgrading.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/win8/upgrading.md rename to docs/jp/3.4.0/guide/platforms/win8/upgrading.md diff --git a/docs/en/3.4.0/guide/platforms/wp7/index.md b/docs/jp/3.4.0/guide/platforms/wp7/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/wp7/index.md rename to docs/jp/3.4.0/guide/platforms/wp7/index.md diff --git a/docs/en/3.4.0/guide/platforms/wp8/index.md b/docs/jp/3.4.0/guide/platforms/wp8/index.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/wp8/index.md rename to docs/jp/3.4.0/guide/platforms/wp8/index.md diff --git a/docs/en/3.4.0/guide/platforms/wp8/plugin.md b/docs/jp/3.4.0/guide/platforms/wp8/plugin.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/wp8/plugin.md rename to docs/jp/3.4.0/guide/platforms/wp8/plugin.md diff --git a/docs/en/3.4.0/guide/platforms/wp8/tools.md b/docs/jp/3.4.0/guide/platforms/wp8/tools.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/wp8/tools.md rename to docs/jp/3.4.0/guide/platforms/wp8/tools.md diff --git a/docs/en/3.4.0/guide/platforms/wp8/upgrading.md b/docs/jp/3.4.0/guide/platforms/wp8/upgrading.md similarity index 100% rename from docs/en/3.4.0/guide/platforms/wp8/upgrading.md rename to docs/jp/3.4.0/guide/platforms/wp8/upgrading.md diff --git a/docs/en/3.4.0/guide/support/index.md b/docs/jp/3.4.0/guide/support/index.md similarity index 100% rename from docs/en/3.4.0/guide/support/index.md rename to docs/jp/3.4.0/guide/support/index.md