Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

 3 Answer(s)

  • <p>For integrating native camera feature in cordova App, you should use "Cordova camera plugin". It provides js callback to invoke native camera functionality.<br> What you need to do is follow these steps:<br> install camera plugin using cli</p> <pre>cordova plugin add cordova-plugin-camera </pre> <p>Add the js code to use camera functionality</p> <pre>function capturePhoto() { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, targetWidth:500, targetHeight: 500, allowEdit: true, correctOrientation: true, destinationType: Camera.DestinationType.DATA_URL }); } function onPhotoDataSuccess( imageData ) { var profileImage = document.getElementById( 'chat_image' ); profileImage.style.display = 'block'; profileImage.src = "data:image/jpeg;base64," + imageData; } </pre> <p>For more detail info: <a href="http://findnerd.com/account/#url=/list/view/How-to-Use-Camera-with-PhoneGap/2312/">http://findnerd.com/account/#url=/list/view/How-to-Use-Camera-with-PhoneGap/2312/</a></p>
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: