I'm checking out PhoneGap API for Android and was trying out the camera sample application example and installed in my Android Phone (2.1 Galaxy S). However after running the app and taking a picture the image was not retrieved. From what I understand in the code, after taking the picture, the image would be displayed in a 60x60 below the button. I tried printing out the base64 value in an alert message but I didn't get any response as well (also no error alerts were displayed). Is there something I missed or should be doing? or did modify the camera function for Android (I'm ueing PhoneGap 0.9.2)
Aside from that, the rest of the function seem to work properly. I was able to load and display the images from the library, etc.
Sample code can be found in the url below http://docs.phonegap.com/phonegap_camera_camera.md.html
Thanks in advance.
Try 'uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"' in your manifest file and use 'destinationType: Camera.DestinationType.FILE_URI' for phonegap's getPicture call. I had the same problem and adding WRITE_EXTERNAL_STORAGE permission worked for me.
I had similar problems with HTC Desire and basic PhoneGap camera example, but when I changed getPhoto()
to use FILE_URI
:
function getPhoto() {
navigator.camera.getPicture(
onPhotoURISuccess,
onFail,
{ quality: 50, destinationType: destinationType.FILE_URI }
);
}
... it started to work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With