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

How do I know if a Uri is empty?

I have an application where I need to be able to let the user decide how to put a picture profile, (camera or gallery). I have only one variable of type "Uri" but I do not understand how to reset it and make it EMPTY, or check if it is EMPTY.…
Alex Voicu
  • 107
  • 1
  • 1
  • 5
9
votes
1 answer

How to save Exif data after bitmap compression in Android

After taking a picture with the camera intent, I compress the bitmap to lower the file size. The problem is that after compression, it loses all EXIF data. I have no problem retrieving the original EXIF data, however, how do I add this EXIFF data…
Janpan
  • 2,164
  • 3
  • 27
  • 53
9
votes
3 answers

android android.provider.MediaStore.ACTION_VIDEO_CAPTURE return null onActivityResult with nexus 7

I am using intent for record video. so i use following code on recordVideo button's click Videofilepath = ""; Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(intent,REQUEST_VIDEO_CAPTURED); and…
Praveen Sharma
  • 4,326
  • 5
  • 25
  • 45
9
votes
3 answers

android camera intent crashes app on some phones (about 20% of them)

I have done a lot of researching into this issue and have seen some great responses and found some good resources of "solutions" to this problem. Unfortunately however, I'm still encountering a lot of app crashes on certain devices. The crashes…
Christopher Johnson
  • 2,629
  • 7
  • 39
  • 70
9
votes
3 answers

Android - Taking photos and saving them with a custom name to a custom destination via Intent

I have a program that opens the camera via Intent to take a photo. That much part works fine already. However, I want it to save to a certain folder with a certain file name (the file name is optional but it would really really help). So here's what…
Razgriz
  • 7,179
  • 17
  • 78
  • 150
8
votes
3 answers

android camera portrait orientation

I am using camera in my app. I am just using intent to start camera Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); …
8
votes
2 answers

How to capture photo and get image and thumbnail?

I cannot believe that I've struggled with this simple problem for hours now, but I cannot get it to run properly. In principle I want this functionality: The user clicks a button. An ACTION_IMAGE_CAPTURE intent is fired and the default camera app…
Tobias Uhmann
  • 2,757
  • 2
  • 25
  • 35
8
votes
3 answers

Android: BroadcastReceiver intent to Detect Camera Photo Taken?

I'm working on an Android application which needs to perform an action each time a new image is taken with the phone. I don't want to take the image within my application, but rather perform some action when the Camera app takes an image and saves…
8
votes
2 answers

"Unfortunately, camera has stopped" on camera intent

So im trying to allow the user to take a picture which I would then send to a server. I am a bit of a noob in android so i followed this tutorial on how to do so. I've seen a few questions similar to mine but not quite the same. The app does launch…
ignacio murillo
  • 121
  • 1
  • 6
8
votes
3 answers

Null pointer exception in camera intent when i choose any third party camera Application

My problem is that every time i choose third party camera application for example Beauty Plus Camera i got null pointer exception every time, my code is completely working for default camera application it even works with Google's new camera made…
8
votes
1 answer

Picture file captured with camera intent empty for a while in onActivityResult

I am having a very strange bug trying to take a picture via intent. Activity code (a little simplified): private void startCapture() throws IOException { // Create output file final File photoFile = makePhotoFile(); _photoPath =…
8
votes
3 answers

Android - Camera intent low bitmap quality

When taking a picture using the android camera Intent, I get a low-quality bitmap image. I was wondering if it is possible to make this image decent quality. I googled some information about it and I think that I have to use 'EXTRA_OUTPUT'…
Meindert Stijfhals
  • 355
  • 1
  • 3
  • 12
8
votes
2 answers

Android - What is outputX/outputY and aspectX/aspectY when crop an image from gallery or camera?

I read a lot of posts about cropping an image from gallery or camera, and I know outputX/outputY refers to the size of the output/cropped image. However, nobody ever explained what does aspectX/aspectY do? And what is the unit of outputX/outputY? Is…
katie
  • 197
  • 2
  • 11
8
votes
3 answers

Camera Intent not returning to calling Activity

I have read a lot of questions regarding this problem. Some are similar to what I am experiencing; I have tried the answers with no success. The code works on a HTC Android 4.2 and doesn't work on a Nexus 7 Android 4.4. I have modified the storage…
brad J
  • 542
  • 1
  • 11
  • 26
8
votes
3 answers

Opening Camera in Portrait mode using Intent

I am able to open the device's Camera from my Activity using an Intent as follows: Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Uri fileUri =…
Neha Shukla
  • 3,572
  • 5
  • 38
  • 69