Skip to content Skip to sidebar Skip to footer

How To Use Phonegap-2.9.0 Camera And Store In Android Device?

NOTE: I was being stupid, for so many things I tried the picture DOES save into my local storage but I kept on checking my gallery (always thought gallery would scan all the images

Solution 1:

Change this

destinationType: Camera.DestinationType.DATA_URL

to

destinationType: Camera.DestinationType.FILE_URI

It will return you the imageuri,For getting the exact location you can make use of filesystem api in phonegap

window.resolveLocalFileSystemURI(imageURI, resolveOnSuccess, fsFail);
functionresolveOnSuccess(entry) {
var fileuri = entry.toURL();
//console.log(fileuri);
}

Solution 2:

1.destinationType: Camera.DestinationType.DATA_URL

DATA_URL returns base64 string only here image not store in album;

2.destinationType: Camera.DestinationType.FILE_URL

FILE_URL returns image url. here image stored in album.

if u need both i mean base64 string and image stored in album. you need do something

  • get url from camera success then use File API - FileReader (readAsDataURL) concepts in phonegap

    1. FILE_URL better for android DATA_URL crash the app sometimes for out memory error

Post a Comment for "How To Use Phonegap-2.9.0 Camera And Store In Android Device?"