Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cronometro has a deprecated constructor in /home/wdrfree/public_html/model/admin/model.php on line 4
How to User Cordova Camera Plugin | wdrfree ▷

How to User Cordova Camera Plugin

Sunday 15th, Apr, 2018 | #Mobile #Plugins

Cordova Camera Plugin provides access to the device's (IOS/ANDROID) native camera application. 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

Add Plagin

cordova plugin add cordova-plugin-camera

Accessing Camera

Take a photo and retrieve it as a base64-encoded image:, onFail, { quality: 50,
    destinationType: Camera.DestinationType.DATA_URL

function onSuccess(imageData) {
    var image = document.getElementById('myImage');
    image.src = "data:image/jpeg;base64," + imageData;

function onFail(message) {
    alert('Failed because: ' + message);