Hi,
I have built an app that allows users to choose a photo using the phonegap camera api, and then upload it to a remote server for processing. When testing this on a samsung galaxy, however, I clicked on photos, and was given a number of photo sources (file manager etc.) only one of which was photogallery. If a user chooses a photo from the gallery, this process works fine, however, if a user selects from one of the other sources, the app crashes. Is there any way to block users from viewing any source other than the photogallery when selecting a photo? Below is the code I have used:
function getImage(index) {
// Retrieve image file location from specified source
currentIndex=index;
navigator.camera.getPicture(uploadPhoto, function(message) {
alert('get picture failed');
},{
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
correctOrientation:true,
targetWidth: 500,
targetHeight: 550
}
);
}
Thanks,
Daryl
I have built an app that allows users to choose a photo using the phonegap camera api, and then upload it to a remote server for processing. When testing this on a samsung galaxy, however, I clicked on photos, and was given a number of photo sources (file manager etc.) only one of which was photogallery. If a user chooses a photo from the gallery, this process works fine, however, if a user selects from one of the other sources, the app crashes. Is there any way to block users from viewing any source other than the photogallery when selecting a photo? Below is the code I have used:
function getImage(index) {
// Retrieve image file location from specified source
currentIndex=index;
navigator.camera.getPicture(uploadPhoto, function(message) {
alert('get picture failed');
},{
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
correctOrientation:true,
targetWidth: 500,
targetHeight: 550
}
);
}
Thanks,
Daryl

