phonegap-cordova-camera-plugin
phonegap-cordova-camera-plugin
phonegap-cordova-camera-plugin

cordova plugin camera is used for getting the picture from camera or existing gallery in cordova applications. After taking a picture we can use FILE_URI or DATA_URI for displaying picture to user or we can also store images into remote servers

Create new project & add plugin

cordova create camera
cd camera
cordova platform add android
cordova plugin add cordova-plugin-camera

Syntax

navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);

Accessing Camera

navigator.camera.getPicture(function(result){
console.log(result);
},function(error){
console.log(error);
},{
sourceType : Camera.PictureSourceType.CAMERA
});

Accessing Gallery

navigator.camera.getPicture(function(result){
console.log(result);
},function(error){
console.log(error);
},{
sourceType : Camera.PictureSourceType.SAVEDPHOTOALBUM
});

Options areĀ https://github.com/apache/cordova-plugin-camera#cameracameraoptions–object

Read More

https://github.com/apache/cordova-plugin-camera

Sundaravel M

About the author: Hey! It's me sundar. (Yea, I'm the founder of codesundar.com). I'm a passionate computer programmer who loves modern web and mobile development. feel free to reach me : Facebook - Twitter - Google+