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.
Related
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.
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.
I am developing a Cordova camera plugin. When you open the camera, it allows the user to take the picture (first part) and then it takes the user to preview photo screen, where user can save or discard the image(second part). As per my requirement, I need to know when the user is at second part i.e. he/she is at 'save/discard' screen.
I was able to detect it in iOS via notifications. But I don't have any experience in Android so couldn't figure out a way.
Any help will be appreciated.
I am developing a Cordova camera plugin
According to your comment, you are using an existing Cordova camera plugin. I presume that you mean that you are forking that plugin and making changes to it.
That plugin is using ACTION_IMAGE_CAPTURE on Android to take a picture. This delegates to an external camera application. There are hundreds of possible camera applications that could handle the request. That includes pre-installed camera apps from thousands of Android device models.
I need to know when the user is at second part i.e. he/she is at 'save/discard' screen.
There is no requirement for developers of a camera application to offer the user a "save/discard" screen for ACTION_IMAGE_CAPTURE. Some may, some may not. For those that do, there is no requirement that they somehow tell other apps that the user is now on the "save/discard" screen.
Hence, there is no way for you to accomplish this, using the existing core logic in that plugin.
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.
I would like to know if there is any way to use the front camera of the mobile without asking the persmission of the user while is using an application.
The logic would be:
User triggers something
The front camera starts recording
Records during 5 seconds and saves the file
The user can't know the camera did this. Is it possible? I guess I will have to indicate in the manifest the camera is going to be used, but that is ok, what I don't want is that the user has to confirm the camera usage or anything while is using the app.
Thanks
IMO this warning is a additional feature of google's android or the customized android versions from the manufacturers. I think it's a security feature, so you can't handle that behavior by your self.
This info is based on my opinion and talkings with front camera paranoid friends.