- The Command-line Interface
- Platform Guides
- Configuration Reference
- Embedding WebViews
- Plugin Development Guide
- Privacy Guide
- Domain Whitelist Guide
cameraobject provides access to the device's default camera application.
Accessing the Feature
As of version 3.0, Cordova implements device-level APIs as plugins.
Use the CLI's
plugin command, described in The Command-line
Interface, to add or remove this feature for a project:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git $ cordova plugin rm org.apache.cordova.core.camera
These commands apply to all targeted platforms, but modify the platform-specific configuration settings described below:
(in app/res/xml/config.xml) <feature name="Camera"> <param name="android-package" value="org.apache.cordova.CameraLauncher" /> </feature> (in app/AndroidManifest) <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
(in www/plugins.xml) <feature name="Camera"> <param name="blackberry-package" value="org.apache.cordova.camera.Camera" /> </feature> (in www/config.xml) <feature id="blackberry.media.camera" /> <rim:permissions> <rim:permit>use_camera</rim:permit> </rim:permissions>
<feature name="Camera"> <param name="ios-package" value="CDVCamera" /> </feature>
Windows Phone (in
<Capabilities> <Capability Name="ID_CAP_ISV_CAMERA" /> <Capability Name="ID_HW_FRONTCAMERA" /> </Capabilities>
Reference: Application Manifest for Windows Phone
<feature name="http://tizen.org/api/application" required="true"/> <feature name="http://tizen.org/api/application.launch" required="true"/>
Some platforms may support this feature without requiring any special configuration. See Platform Support for an overview.