Questions tagged [android-camera-intent]

Questions related about calling the camera app from the local device, without the camera permission.

The camera intent is a way to make photos or videos with the camera app of the device without implementing a custom camera activity.

Here is a basic example for such a call:

// create Intent to take a picture and return control to the calling application
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name

// start the image capture Intent
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

See the full code on the documentation.

971 questions
464
votes
23 answers

Why does an image captured using camera intent gets rotated on some devices on Android?

I'm capturing an image and setting it to image view. public void captureImage() { Intent intentCamera = new Intent("android.media.action.IMAGE_CAPTURE"); File filePhoto = new File(Environment.getExternalStorageDirectory(), "Pic.jpg"); …
Shirish Herwade
  • 11,461
  • 20
  • 72
  • 111
172
votes
14 answers

Android ACTION_IMAGE_CAPTURE Intent

We are trying to use the native camera app to let the user take a new picture. It works just fine if we leave out the EXTRA_OUTPUT extra and returns the small Bitmap image. However, if we putExtra(EXTRA_OUTPUT,...) on the intent before starting it,…
Drew
  • 1,769
  • 4
  • 12
  • 5
101
votes
15 answers

Camera orientation issue in Android

I am building an application that uses camera to take pictures. Here is my source code to do this: File file = new File(Environment.getExternalStorageDirectory(), imageFileName); imageFilePath = file.getPath(); Intent intent = new…
Nguyen Minh Binh
  • 23,891
  • 30
  • 115
  • 165
99
votes
7 answers

Android camera intent

I need to push an intent to default camera application to make it take a photo, save it and return an URI. Is there any way to do this?
Alexander Oleynikov
  • 19,190
  • 11
  • 37
  • 51
73
votes
9 answers

Android M Camera Intent + permission bug?

I'm trying to get my app ready for the new Android M permissions changes and found some weird behaviour. My app uses the Camera intent mechanism to allow the user to get a picture form the camera. But in another activity needs to make use of the…
73
votes
3 answers

Difference between Intent.ACTION_GET_CONTENT and Intent.ACTION_PICK

I'm trying to let the user choose any image that they want on their device to use as a wallpaper in this wallpaper application I'm building. For some reason when I write: Intent myIntent = new…
EGHDK
  • 17,818
  • 45
  • 129
  • 204
72
votes
11 answers

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1888, result=0, data=null} to activity

My app allows the user to press a button, it opens the camera, they can take a photo and it will show up in an ImageView. If the user presses back or cancel while the camera is open I get this force close - Failure delivering result…
dabious
  • 927
  • 3
  • 10
  • 15
67
votes
13 answers

Deleting a gallery image after camera intent photo taken

I know this has been asked in many different ways but I still can not seem to delete the gallery image from the default folder. I'm saving the file to the SD card correctly and I can delete that file fine, but the default gallery image file that…
android-overflow
  • 745
  • 1
  • 7
  • 10
56
votes
6 answers

Getting path of captured image in Android using camera intent

I have been trying to get path of captured image in order to delete image. Found many answers on StackOverflow but none of them are working for me. I got the following answer: private String getLastImagePath() { final String[] imageColumns = {…
Shubham
  • 1,442
  • 3
  • 16
  • 34
49
votes
6 answers

Android: Activity getting Destroyed after calling Camera Intent

I have two Activities, A1 and A2. A1 calls A2 and from A2, I am calling the camera intent as below: launchIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); launchIntent.putExtra(MediaStore.EXTRA_OUTPUT,photoPath); …
Sudarshan
  • 1,291
  • 3
  • 26
  • 35
48
votes
3 answers

Low picture/image quality when capture from camera

I have one problem. When I try to get picture from camera, the quality is very low. At first, capture the picture using camera, than save to the directory and at the same time get that picture and show in my app.The picture saved inside directory is…
ckng
  • 507
  • 1
  • 4
  • 7
43
votes
13 answers

How to compress image size?

I want to capture image in low resolution using android camera api but when I captured image it will take default resolution of device camera.So I want to capture image in low resolution or small size at time of capture or how can I compress big…
40
votes
2 answers

Android Camera Intent Saving Image Landscape When Taken Portrait

I have had a look around but there doesn't seem to be a solid answer/solution to the, very irritating, problem. I take a picture in portrait orientation and when I hit save/discard the buttons are in the correct orientation also. The problem is when…
StuStirling
  • 15,601
  • 23
  • 93
  • 150
39
votes
4 answers

android camera: onActivityResult() intent is null if it had extras

After searching a lot in all the related issues at Stack Overflow and finding nothing, please try to help me. I created an intent for capture a picture. Then I saw different behavior at onActivityResult(): if I don't put any extra in the Intent (for…
dvrm
  • 3,749
  • 4
  • 34
  • 43
37
votes
4 answers

Android 11 (R) return empty list when querying intent for ACTION_IMAGE_CAPTURE

Device: Emulator pixel 3a - Android 11 Code: final List cameraIntents = new ArrayList(); final Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); final List listCam = …
1
2 3
64 65