framework/src/org/apache/cordova/CameraLauncher.java
/**
     * Take a picture with the camera.
     * When an image is captured or the camera view is cancelled, the result is returned
     * in CordovaActivity.onActivityResult, which forwards the result to this.onActivityResult.
     *
     * The image can either be returned as a base64 string or a URI that points to the file.
     * To display base64 string in an img tag, set the source to:
     *      img.src="data:image/jpeg;base64,"+result;
     * or to display URI in an img tag
     *      img.src=result;
     *
     * @param quality           Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
     * @param returnType        Set the type of image to return.
     */
Take a picture with the camera.
When an image is captured or the camera view is cancelled, the result is returned
in CordovaActivity.onActivityResult, which forwards the result to this.onActivityResult.

The image can either be returned as a base64 string or a URI that points to the file.
To display base64 string in an img tag, set the source to:
img.src="data:image/jpeg;base64,"+result;
or to display URI in an img tag
img.src=result.

@param quality           Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
@param returnType        Set the type of image to return.
Take a picture with the camera . When an image is captured or the camera view is cancelled the result is returned in CordovaActivity . onActivityResult which forwards the result to this . onActivityResult . The image can either be returned as a base64 string or a URI that points to the file . To display base64 string in an img tag set the source to : img . src = " data : image / jpeg ; base64 " + result ; or to display URI in an img tag img . src = result . @param quality Compression quality hint ( 0 - 100 : 0 = low quality & high compression 100 = compress of max quality ) @param returnType Set the type of image to return .
public void takePicture(int returnType, int encodingType) {
        this.numPics = queryImgDB(whichContentStore()).getCount();
        Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
        File photo = createCaptureFile(encodingType);
        intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
        this.imageUri = Uri.fromFile(photo);
        if (this.cordova != null) {
            this.cordova.startActivityForResult((Plugin) this, intent, (CAMERA + 1) * 16 + returnType + 1);
        }
    }
public void takePicture ( int returnType , int encodingType ) { this . numPics = queryImgDB ( whichContentStore ( ) ) . getCount ( ) ; Intent intent = new Intent ( "android.media.action.IMAGE_CAPTURE" ) ; File photo = createCaptureFile ( encodingType ) ; intent . putExtra ( android . provider . MediaStore . EXTRA_OUTPUT , Uri . fromFile ( photo ) ) ; this . imageUri = Uri . fromFile ( photo ) ; if ( this . cordova != null ) { this . cordova . startActivityForResult ( ( Plugin ) this , intent , ( CAMERA + 1 ) * 16 + returnType + 1 ) ; } }
Take a picture with the camera.
Take a picture with the camera .
// Save the number of images currently on disk for later // Display camera // Specify file so that large image is captured and returned // TODO: What if there isn't any external storage? //        else //            LOG.d(LOG_TAG, "ERROR: You must use the CordovaInterface for this to work correctly. Please implement it in your activity");