Hi,
I am making use of phonegap camera plugin (3.5.0)to click a photo using the device camera.I am able to click a photo,but after clicking ,the app restarts.
Here is the piece of code:
function OnCamera(e) {
navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
quality: 50,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 300,
targetHeight: 300,
correctOrientation: true,
saveToPhotoAlbum: true,
destinationType: destinationType.FILE_URI
});
}
function onPhotoDataSuccess(imageData) {
// Uncomment to view the base64 encoded image data
// Get image handle
fileEntry.file(function (fileObj) {
// console.log("Size = " + fileObj.size);
if (fileObj.size > 2097152)//2Mb
{
DisplayAlert("Error:Image size should be less then 2MB");
} else {
var CurrentImage = document.getElementById('myImg');
// Unhide image elements
CurrentImage.style.display = 'block';
// Show the captured photo
// The inline CSS rules are used to resize the image
CurrentImage.src = imageData;
//localStorage["Img"] = imageData;
}
});
});
$("#lblPhotoText").hide();
}
I have tried using the following in the androidmanifest.xml :
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-sdk android:minSdkVersion="7"/>
How can I solve this issue????
Thanks,
Ruchin Dayal