Android Studio - Camera Burst (Multiple shots) - android

I'm developing an app on Android Studio and I am setting a button that, when pressed, will open the camera. In particular, I need the camera to take multiple shots (keeping the "shot" button pressed on the camera view, it should take multiple shots till it is released).
My smartphone camera supports the "continuous shot" feature (Android 5.1, API 22), but I cannot use it when I call the camera from my app. As you can see in the screenshots below, when I open the camera from the official camera app, it has a different layout with more settings. When I call the camera from my app, it has less settings and if I try to keep pressed the "shot" button, it appears the toast message "Does not support continuous shot".
https://i.imgur.com/ncaJYyz.jpg
https://i.imgur.com/IJMIqjf.jpg
The simple code I use to call the camera function in my app is the following:
public void cameraCall(View view) {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(intent, 0);
}
Any idea about how to solve this problem?
Thank you

When you use IMAGE_CAPTURE intent, Android launches some camera app on your device. Most often, this will be the Camera app that was preinstalled by the device manufacturer, but this could be an 3rd party app installed from the Play Store or even sideloaded. This Camera app declared support for this standard intent, and hopefully it honestly fulfills the contract defined for this standard intent. This contract does not mention many advanced features of the cameras, so most likely you will not get them.
You may find another intent, INTENT_ACTION_STILL_IMAGE_CAMERA, better fit your needs. Or you can launch default camera app on press of the button.
The alternative is to implement custom camera in your app.

Related

Can I read the opened camera intent from my so

I built a face detection app that is working fine, the user can:
open the camera intent
take a picture
then it will screen this picture and tell if there is a face in it or no.
My idea is I don't need the user to open the camera from my app I need the user to open the camera
app in Android as normal, and then I will be working in the background reading the picture had been taken by his camera, analyse it and till by a toast if a face had been detected or no.
Not sure about if my application can detect if the camera had been opened or no and if opened can detect if phot had been taken or no, and if yes, can I read this image or no!!
If yes, how?!
Not sure about if my application can detect if the camera had been opened or no
Not really. You cannot detect what apps are in the foreground on modern versions of Android, for privacy and security reasons. And, even if you could, there are hundreds (perhaps thousands) of camera apps. You would have no reliable way of knowing whether any given app is really a camera app.
if opened can detect if phot had been taken or no
Not really. There is no requirement for a camera app to put its images anywhere that your app can access it. And, there is no reliable way to know whether any given file is a photo or not.

Zebra scanner emdk integration

I am adding zebra scanning sdk to my app. I see that when camera is open, the hardware scanner does not work. I have implemented Scanner.StatusListener but I see that this is not invoked when camera is open. I am seeing a way to know when user clicks the hardware button when camera is open to show them a toast. How can I get that callback
Unfortunately it is not possible to use both the camera and the scanner within the same app because of a low level hardware dependency (even if you are using the 2D imager for scanning, rather than the camera, this hardware dependency exists). There is no easy way to programmatically determine that the user has pressed the trigger in this scenario, to display the toast as you say, the only way I can think of would be for your app to remap the trigger to some other action using the KeyMapping Manager and then revert the trigger back to its original behaviour when the camera is dismissed. Rather than try to manage the EMDK enabling & disabling when the camera is used I would recommend using DataWedge for scanning in your app, you still can't do scanning when the camera is displayed but it should make your application logic simpler

Press Default Camera App Capture button programatically like in selfie stick Android

i am making an app in which i want to capture image in default camera app without pressing capture button.i also tired this but it just open camera app.
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
i am making an app in which i want to capture image in default camera app without pressing capture button
That is impractical, sorry.
First, there is no single "default camera app". There are ~2 billion Android devices in use, spanning thousands of models. Those models ship with hundreds of "default camera apps".
Second, there is no requirement for a camera app to have a capture button. Some might take a picture by other means. Even for those that have a capture button, there is no requirement for it to have anything in common with capture buttons in other camera apps.
Third, outside of accessibility services and rooted devices, an app cannot fake user input into another app.
You are welcome to write your own camera app, using the camera APIs (android.hardware.Camera, android.hardware.camera2.*), and come up with your own trigger for when a picture should be taken.

android camera intent stuck on confirmation

I'm using a chooser to allow the user to pick a photo from his gallery or take a new one using his camera (I copied the code from this answer).
Picking an image from the gallery works perfect. The problem is that when I capture an image with the camera It's not returning to the app and just stays in the confirmation screen...
I actually don't even need this screen to be displayed in the first place...
Can I somehow disable it or (if not) just make the Done button work?
Thanks in advance!
Can I somehow disable it
No.
just make the Done button work?
Contact the developers of your camera app, and point out the bug. Perhaps someday they will fix it.
You are using ACTION_IMAGE_CAPTURE. This launches a third-party camera app, to take a picture. There thousands of Android device models. These ship with hundreds of different pre-installed camera apps, and there are many more available for download from the Play Store and elsewhere. Any could be the one that handles a given ACTION_IMAGE_CAPTURE request, and any of them can have bugs.

Android ACTION_IMAGE_CAPTURE auto focus on take picture

We were using Camera API for our custom camera application. However, it turned out to be a very hard problem. Many devices required extra testing as they seemed to perform unexpected behaviors. So, we have decided to migrate to Android's camera intent.
However, we are dealing with image retrieval tasks so, we don't want our users to send us blurry pictures. Previously, we were using autofocus as user taps on take picture button. Android camera intent performs worse than ours because it does not try to autofocus just before taking the picture. Android's camera does have such option but we don't want leave that decision up to our users because, they will probably will not select that option.
Is it possible to launch the camera intent with the option which auto focusses just before taking the picture? Thank you!
Is it possible to launch the camera intent with the option which auto focusses just before taking the picture?
No. The decision of whether or not to use auto-focus, or a flash, or any other camera feature, is between the user and the developers of the camera app. You do not get a vote.

Categories

Resources