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
8
votes
1 answer

camera intent and priority queue in Android

I am currently writing an Android app (API level 2.3.3) that involves taking the 300 highest grayscale values from a photo taken via camera intent. Following, functions (mainly maths and some calendar/clock based) are performed on the resultant…
user1516493
7
votes
0 answers

Overlay transparent circle on camera preview in Android

Recently Uber has released a Face Recognition feature and I'm trying to create a similar camera preview it looks like this : I need to create a transparent circle to focus the users face to the camera. I have tried to create it from some other…
7
votes
2 answers

How to get path of picture in onActivityresult (Intent data is null)

I have to launch the camera, and when the users has done the picture, I have to take it and show it in a view. Looking at http://developer.android.com/guide/topics/media/camera.html I have done: protected void onCreate(Bundle savedInstanceState) { …
Shudy
  • 7,806
  • 19
  • 63
  • 98
7
votes
4 answers

Null pointer Exception on file- URI?

In my app a capture button is there to capture an image using device camera,so I have used a method captureImage() on the click event of that button.When I click the button a null pointer exception is thrown.I could not understand how this happens…
Jack
  • 1,825
  • 3
  • 26
  • 43
7
votes
2 answers

Android: How to save the camera result to a private file

I am trying to get an image from the camera and save it directly to my app's private files directory. For security concerns, the image should not be publicly accessible at any time. In general, the way you grant temporary access to a private file…
Nathan Taylor
  • 879
  • 1
  • 9
  • 16
7
votes
4 answers

Capture photo rotate 90 degree in samsung mobile

Photo is rotating 90 degree while capturing from camera in samsung mobile rest of other mobiles(HTC) its working fine. Please help me for this. Intent cameraIntent = new…
Ajay S
  • 48,003
  • 27
  • 91
  • 111
6
votes
1 answer

How to get video from camera Intent and save it to a directory?

Is it possible to have code similar to the following that does the same for video? if (resultCode == Activity.RESULT_CANCELED) { // camera mode was canceled. } else if (resultCode == Activity.RESULT_OK) { //…
6
votes
1 answer

Android Camera intent creating two files

I am making a program that takes a picture and then shows it's thumbnail. When using the emulator all goes well and the discard button deletes the photo. But on a real device the camera intent saves the image at the imageUri variable and a second…
Kyle Ramstad
  • 61
  • 1
  • 2
6
votes
1 answer

dlopen failed: library "/system/lib64/libhwuibp.so" not found : Honor 4C 64-bit octa-core CPU

Whenever I try to open camera/gallery through intent, I am getting this error in my Honor 4C mobile, Android version 6.0 with 64-bit octa-core CPU. load: so=/system/lib64/libhwuibp.so dlopen failed: library "/system/lib64/libhwuibp.so" not…
6
votes
5 answers

Camera Intent returns null onActivityResult

I am trying to take a photo and to save it to a custom location- public void SavePhoto(View view){ Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); String timeStamp = new…
s.k.paul
  • 7,099
  • 28
  • 93
  • 168
6
votes
2 answers

Android - Capture photo

In my application, i have to implement native camera activity where i have to launch the camera and take photo. In detail, my application containing, One TextView (at top) to display activity name and one Button (At bottom) and in Middle Area of the…
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
6
votes
3 answers

Android: Crash after Image Crop when updated OS Version to 5.1.1

I updated my nexus 5 Android OS version to 5.1.1 and also updated the Google Camera and Google Photos application. After this, when ever I tried to capture image and Crop it, my application crashes with the following Error: FATAL EXCEPTION:…
Rajeev Sahu
  • 1,732
  • 6
  • 26
  • 39
6
votes
3 answers

Save captured image in specific folder on sd card

I'm working with camera in android and I'm new to android camera. I've followed the tutorial from here Whenever I'll add External storage permission in android manifest, camera saves it in default directory without asking me and I want to save it in…
Tashen Jazbi
  • 1,068
  • 1
  • 16
  • 41
6
votes
3 answers

Camera API working on Jelly Bean but not Kitkat

I have a really strange problem. The following code I have is used to take a picture on button click. It works properly on Jelly Bean phones, but not on Kitkat: MainActivity.java: package com.example.takepic; import android.app.Activity; import…
SoulRayder
  • 5,072
  • 6
  • 47
  • 93
6
votes
7 answers

Get Image path from camera intent

There is option of capture image from camera in my application.But there is problem to get image from camera. When i use ACTION_IMAGE_CAPTURE this it return null data.Please help me get image path from camera intent Error Log: 07-04 11:22:36.902:…
Amit Sharma
  • 926
  • 2
  • 10
  • 35