public void takePicture()

in src/android/CameraLauncher.java [309:338]


    public void takePicture(int returnType, int encodingType)
    {
        // Let's use the intent and see what happens
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

        // Specify file so that large image is captured and returned
        File photo = createCaptureFile(encodingType);
        this.imageUri = FileProvider.getUriForFile(
            cordova.getActivity(),
            applicationId + ".cordova.plugin.camera.provider",
            photo
        );
        intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
        //We can write to this URI, this will hopefully allow us to write files to get to the next step
        intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);

        if (this.cordova != null) {
            // Let's check to make sure the camera is actually installed. (Legacy Nexus 7 code)
            PackageManager mPm = this.cordova.getActivity().getPackageManager();
            if(intent.resolveActivity(mPm) != null)
            {
                this.cordova.startActivityForResult((CordovaPlugin) this, intent, (CAMERA + 1) * 16 + returnType + 1);
            }
            else
            {
                LOG.d(LOG_TAG, "Error: You don't have a default camera.  Your device may not be CTS complaint.");
                throw new IllegalStateException("No camera application available.");
            }
        }
    }