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.
Related
I'm working on a application and i want to take the picture of the user automatically with front camera without opening the camera or with a little preview.I can take the picture but the user have to click the button but what I want is it takes picture automatically. I've searched a lot about this but I was unable to get some useful tutorial or code.I
Using the camera API you can achieve this.
Look at this like http://www.vogella.com/tutorials/AndroidCamera/article.html
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?
I wish to use the front camera of a device to capture the image without any preview and the screen to remain blank.
I have a way to remotely activate this but not sure how to do it.
I found this: https://stackoverflow.com/questions/10702906/showing-blank-screen-while-recording-video-in-motorola-attrix-2-with-android-2-2.
It is pretty close to what I want but I'm not sure how to use the code and change it to camera.
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.
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.