I am creating an application to test the capabilities of PhoneGap so that I can later use it for larger projects. I tried to get the camera API to work by creating a simple test application that just captures and displays the image. The strange thing is that when I press the capture button, which launches navigate.camera.getPicture() , I can take a picture, but not confirm the image, so that the process returns to my application and gives me the captured image. All other buttons work as expected, so I can, for example, click Cancel, and it will return to my application and run the function passed as the second parameter in navigate.camera.getPicture() (error handler).
This is what I call navigate.camera.getPicture() :
navigator.camera.getPicture( function( uri ) { // code to handle success }, function( msg ) { // code to handle error }, { quality: 100, destinationType: Camera.DestinationType.FILE_URI, encodingType: Camera.EncodingType.PNG, targetWidth: 2000, targetHeight: 2000, correctOrientation: true, saveToPhotoAlbum: false } );
I tried to comment out all the configuration options except destinationType to see if that helped.
In my config.xml, these lines are allowed for the camera:
<plugin name="Camera" value="org.apache.cordova.CameraLauncher" /> <feature name="http://api.phonegap.com/1.0/camera" />
My debugging environment is a Galaxy Nexus running Android 4.2.1.
I also run an application under Ripple that worked as early as possible.
The app is built using PhoneGap Build, not the Android SDK on my machine, if that matters.
Is there anything that I am missing here?
Thanks in advance =)