Using the camera from the Android device - android

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.

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.

Register a custom camera source with the Camera API

I have quite a bit of experience with the camera API, but I could not find any documentation to answer this question...
Most phones already have a front and a back camera. Would it be possible to simulate a 3rd camera via software (probably using a service), and register that with the api?
The idea would be that we define a custom camera, register it with the Api, and then any camera app would be able to get it by looping through the available cameras.
I imagine several cases where we might want this...
There are some external cameras (such as the FLIR thermal camera) that could provide this.
We might want to concatenate the front and back camera images into a single image, and preview that. I know not all phones support opening both cameras concurrently, but some do, and i could imagine this functionality would be cool for 3rd party video chat apps like Skype... Specifically, since Skype doesnt natively support this, by registering directly with the Android Camera Api, we could get around the limitations of the Skype API, since our custom camera would just look like one of the default Android cameras.
So would this be possible? Or what is the technical limitations that prevents us from doing it. Perhaps the Android Api simply doesnt let us define a custom source (I know the Sensor API doesnt, so I would not be surprised if this was the case for the Camera API as well).

Android detect if Save/Discard screen is being shown after taking the picture

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.

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