How to change behaviour of android.provider.MediaStore.ACTION_IMAGE_CAPTURE - android

I am using android.provider.MediaStore.ACTION_IMAGE_CAPTURE to capture images, however on pressing Ok button the camera activity is closed and I received the result in onActivityResult. Is there a way the image capture activity can be kept running after pressing OK button.
At the moment I am starting it again through my onActivityResult function, is it possible that I can keep the same image capture activity running after a successful image capture.

I don't think this is possible with the ACTION_IMAGE_CAPTURE intent. Instead you will have to control the camera preview in SurfaceHolder. Here is one example I have found - How to Program the Google Android Camera to Take Pictures.

Related

How do I enable front and back camera on Android Studio Virtual Device?

I'm using an AVD on Android Studio. The app I'm using performs verification, first taking a photo with the back camera, and then switching to the front camera to take a selfie. But the problem I'm having is that I can't seem to use both cameras. Whichever one I don't assign "webcam0" shows a black screen. To get the front facing camera to work for the selfie, I need to assign "webcam0" and either "emulate" or "virtualscreen" to the back. But then the back camera doesn't work.
How do I get both to work? I really need to be able to take a photo with the front and back camera. Thanks in advance for your help!

Take images without closing camera in Android

I want to develop camera functionality for my app where I have to capture 10 images. The camera should not close, rather it should continuously take pictures while I hold the shutter button. I am using intent for opening the camera, but after taking one image the camera is stopping. How can I achieve the desired functionality?
You would need to write your own camera code, using android.hardware.Camera and/or the android.hardware.camera2.* classes. There is no Intent structure that camera app developers are required to support that handles your use case.

Capture image from both front and back camera automatically

I would like to capture image from back camera automatically(camera has to capture a image automatically without pressing the capture button after wait for 1 sec),when I click button in my android project.After this capture, front camera has to start and like to capture image automatically as like back camera.I was searched over internet but didn't get any better solution for implementing this technique in my project.So anyone please help me to achieve this technique.

capture photo from both front and back camera simultaneously

I would like to develop an Android application which has the technique of capturing a photo from camera(both front and back) at simultaneously.I searched over internet but unfortunately I couldn't find any better solution.
note for example if I capture the photo from back camera,once it captured from back means then it has to start front camera automatically for capture a photo.
You need to approach this problem step by step.
First build functionality to take picture by back camera.
Once you have done that, then build functionality to take picture by front camera (most of the code will be the same, just setting the back/font camera will be different.
Once you have these two options built, separately, then you can combine the two by making it a three-step process: 1) take picture by back camera 2) switch the camera to front 3) take picture by front camera.
Again, as mentioned, taking picture by back and front cameras are not different, it only involves switching the cameras.
Edited after seeing new comment:
If you are using the built-in camera, that is using intents, then this task is not going to be an automatic and immediate thing. I thought you were building custom camera, where you can do all this by code (without intents and built-in camera). But anyways, you can still do it.
So now, the process will be:
Use intent to go to Camera.
Take a picture (which is by default back camera). Do whatever you
want to do with this picture, save, process, etc.
Use another intent to go to Camera again. This time, add an extra to your intent to so the camera defaults to front camera intent.putExtra("android.intent.extras.CAMERA_FACING", 1);
Take picture again.
Refer to this thread for how to launch front camera with intent:
How to launch front camera with intent?

Code to tap anywhere on screen to take photo

Does anyone know how I could code for a camera function that to take the picture the user just has to tap anywhere on the screen? I am writing the app with Phonegap in Android.
Thanks!
When you execute the navigator.camera.getPicture() method you are firing off the Intent to start the Android Camera. The Camera provides the UI to take the picture so you'll need to use their shutter button.
If you want to do the click anywhere functionality you'll need to write a plugin to provide your own camera functionality.

Categories

Resources