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
5
votes
2 answers

android.hardware.camera2.CameraAccessException

I'm receiving this error message while trying get the camera ID list from a CameraManager instance using the camera2 api: UnhandledException: android.hardware.camera2.CameraAccessException Here is my code CameraManager manager = (CameraManager)…
zba
  • 103
  • 1
  • 2
  • 7
5
votes
1 answer

How can crop rectangle area?

Hi i am working on android application to detect page number using camera preview. After I received frame I draw a rectangle on surface view Using Canvas and I want to crop the rectangle area to put it in a bitmap, so please how can I do it ?
Adnan KA
  • 99
  • 1
  • 2
  • 5
5
votes
4 answers

Why is camera intent automatically saving images to disk?

I'm using a simple camera intent following the basic tutorial from Android. In this section it talks about saving the image file to disk. However, I haven't yet configured any of these steps, but after capturing the image and returning to my…
ethan123
  • 1,084
  • 2
  • 14
  • 26
5
votes
0 answers

ExifInterface not returning the correct orientation (Samsung Galaxy S3)

I'm trying to identify the orientation of the image using: ExifInterface exif = new ExifInterface(_path); int exifOrientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); I'm not sure if…
5
votes
2 answers

Android startCamera gives me null Intent and ... does it destroy my global variable?

I have the next problem: when I try to start my camera, I can take the picture, even save it on my sdcard, but when I'm going to get the path for showing it on my device I get errors. My global variables are 2 (I used 1 but 2 are better for making…
5
votes
2 answers

Intent does not set the camera parameters

I am opening camera app as external intent from my applications. I am using following code to invoke the camera and following are my conditions: It should open the front camera. Highest picture quality. Flash light has to be on Following is my…
Lost
  • 12,007
  • 32
  • 121
  • 193
5
votes
1 answer

action_image_capture restarts app

I have been several days looking for the solution to this problem and I dont know what to do :( I have an app which uses native camera to take a picture, but the problem is that, sometimes, and only in some devices when I took the picture and save…
leojg
  • 1,156
  • 3
  • 16
  • 40
5
votes
4 answers

How to capture low resolution picture using android camera

I want to capture photo and also save it to my sdcard using android camera.I know its easy but I want to store image in low resolution without telling user go to setting and set low resolution manually.
5
votes
1 answer

onActivityResult getting called as soon as camera intent is sent

I am using the camera intent to launch the camera in my app but as soon as the intent gets fired the onActivityResult gets fired and I have not even taken a picture yet. When I do take a picture, select it and return back to my activity the…
tyczj
  • 71,600
  • 54
  • 194
  • 296
5
votes
0 answers

resultcode and data null in onActivityresult

I have a code where i set the image captured from camera to an vector and then use image adapter to show the captured image.but im getting result code as 0 and data as null in OnActivityResut.Below is the code to launch a camera and it works i.e i…
5
votes
3 answers

lock your camera view to landscape mode in android

I want to lock my camera view to "Landscape" mode.When I click on the simple button in my app, that time device's camera will open and and that camera should be locked to "Landscape mode". Can anyone know the solution of this problem? I am using…
Kush Patel
  • 67
  • 1
  • 6
5
votes
1 answer

Android image resize after camera intent callback

my first question here! I have a problem with a piece of code that starts a camera intent with the extra output options and then on activity result tries to resize that image. what is happening is that a nullpointer exception gets thrown in the…
TeraTon
  • 435
  • 6
  • 15
5
votes
2 answers

android force camera to take photo in landscape mode

I want to force the default android camera to take photo in landscape mode only. I have tried following: Intent cameraIntent=new Intent("android.media.action.IMAGE_CAPTURE"); File photo = new…
Hanry
  • 5,481
  • 2
  • 40
  • 53
4
votes
0 answers

Android MediaStore.EXTRA_DURATION_LIMIT ignored

I'm using htc desire-HD. When I use the camera to capture video with Intent(MediaStore.ACTION_VIDEO_CAPTURE) I give it a duration limit with intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT,MAX_DURATION). The camera seems to ignore the duration…
TOMKA
  • 1,096
  • 13
  • 24
4
votes
2 answers

Android R - startActivity of ACTION_IMAGE_CAPTURE shows different options to choose

I'm targeting my app to support 30 (R). I've notice that some apps are missing to choose when calling this: baseActivity.startActivity(Intent(MediaStore.ACTION_IMAGE_CAPTURE)) When targeting to 29, this code shows several apps to choose before…
Udi Oshi
  • 6,787
  • 7
  • 47
  • 65