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
17
votes
6 answers

android: Take camera picture without "save" / "delete" confirmation

I want to display an image taken from the camera in an ImageView using Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); This works fine so far but after the user takes the photo using the chosen camera app a dialog…
fritz
  • 427
  • 1
  • 5
  • 13
15
votes
6 answers

BitmapFactory can't decode a Bitmap from Uri after photos taken on Android Nougat

I tried to take a photo and then to use the photo. Here is what I did. My device was Nexus 6P (Android 7.1.1). First, I created a Uri: Uri mPicPath = UriUtil.fromFile(this, UriUtil.createTmpFileForPic()); //Uri mPicPath = UriUtil.fromFile(this,…
14
votes
3 answers

Camera capture orientation on samsung devices in android

I am creating a camera app. The image when captured is shown in the grid view. Now, the code is working completely fine on all the devices except for samsung devices. I am facing the orientation issue. When I capture an image in a portrait mode, the…
14
votes
2 answers

Capture Image while Device is Locked with Password

I want to implement a functionality to capture image through front camera when someone tries to unlock my device and enter incorrect password 3 times. I checked that it is possible in Android and some applications are also available in Market. I…
14
votes
3 answers

Prevent activity from being destroyed

I'm sending an intent to the camera from an activity that I call like this: Intent testphoto = new Intent(Dashboard.this,CameraHandler.class); startActivity(testphoto); In the CameraHandler class I call the camera: Intent intent = new…
Diego
  • 4,011
  • 10
  • 50
  • 76
13
votes
5 answers

Stop saving photos using Android native camera

I am using native Android camera and save file to my application data folder (/mnt/sdcard/Android/data/com.company.app/files/Pictures/). At the same time anther copy of photo is saved to DCIM folder. This is my code: Intent intent = new…
13
votes
5 answers

How to skip or avoid 'retake and review' option after capturing photo from camera using ACTION_IMAGE_CAPTURE

I want to display the image when I click on the photo and want to set in my ImageView without user select yes or not.... I had searched for it and I also know it very well that the camera app itself gives you the ability to review/retake the image,…
Arjun saini
  • 4,223
  • 3
  • 23
  • 51
12
votes
5 answers

Upload from camera and gallery is not working properly in all the versions

I am trying number of tutorials and sample codes for take an image from gallery or camera then crop the image and upload it to server. I was implemented the code for that in that code am facing few problems the are. In pre Lollipop devices when I…
12
votes
3 answers

How to write exif data to image in Android?

I'm trying to write a User_Comment and TAG_GPS to a captured image in an Android application using the exif interface, but for some reason the tags don't seem to be appended to the image when I view the image's details in the gallery. It seems that…
Brian Var
  • 6,029
  • 25
  • 114
  • 212
11
votes
6 answers

Camera of any emulator not working

Friends I am facing this issue since so long but i am able to get any kind of solution to get working camera in emulator. I have gone through all the answer of the SO but none helped me uptill now. If i create any emulator with any api but in none…
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
11
votes
2 answers

Launch default camera app (no return)

I'd like to launch the default camera, but want it to act like it was started from the launcher (i.e. the resulting picture should be stored by the camera app to the user's gallery, rather than being returned to my app). If I use Intent cameraIntent…
Nick
  • 3,504
  • 2
  • 39
  • 78
10
votes
4 answers

Trouble working with the camera in onActivityResult

I have two options "select photo" and "take photo" - I have my select photo functionality fully working, but having problems with taking a photo. Mainly having the saved image display in my image view, after its been saved. Defined my photo…
bMon
  • 962
  • 4
  • 15
  • 33
10
votes
4 answers

Android 5.1.1 default camera return empty intent in onActivityResult after capturing image

I have the following code which request user to pick an image from photo apps or capture an image by camera apps: // Camera final List cameraIntents = new ArrayList(); final Intent captureIntent = new…
passer
  • 634
  • 2
  • 8
  • 16
10
votes
4 answers

Alternative ways to set durationLimit or sizeLimit while video recording?

The thing what I wanted to implement that users can record video only for 30 seconds or by a specific size. I tried to use those below (both seperately or together) public static final java.lang.String EXTRA_SIZE_LIMIT =…
Mustafa Güven
  • 15,526
  • 11
  • 63
  • 83
9
votes
4 answers

onActivityResult doesn't call from viewPager fragment

Hi I am using viewPager with fragmnets inside main fragment. I am trying to get image to bitmap from gallery or from camera, but after picking photo and startActivityForResult it doesn't catch in onActivityResult... here is how i call…
1 2
3
64 65