I’m using Corodva 2.3.0 and an Android 2.3.3 virtual device. In my Cordova enabled app I am trying to take a picture and then have that picture display on the page. In my “Take Picture” button I am running the following code:
function takePicture()
{
navigator.camera.getPicture(displayPictureURI, showError, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI
});
}
function displayPictureURI(imageURI)
{
var imagePanel = document.getElementById('imagePanel').style.display = "";
document.getElementById("image").src = imageURI;
}
function showError(fail)
{
alert(fail);
}
The camera opens, I take a picture, and the app re-opens, but the picture is never displayed. In the log I get the following error: “Not allowed to load local resource: file:///mnt/sdcard/Android/data/org.apache.cordova.example/cache/1359468575251.jpg at :0”
I’m not sure what I am doing wrong here. I have the “WRITE_EXTERNAL_STORAGE” permission setup in the manifest. Any help is appreciated.
Isn’t really a proper solution, but I have found that if I use an earlier version of Phonegap, this issue doesn’t occur. It seems 1.7.0 works.