Calling camera from an activity, capturing an image and uploading to a server

in my case i use this: when i click on save button pic is save and return me path in filePath variable.

String filePath =
        Environment.getExternalStorageDirectory() +"/your_image_name.jpeg";
File file = new File(filePath);
Uri output = Uri.fromFile(file);
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, output);

and in onactivityresul() i use this “filePath” .

Leave a Comment