I have an API integrated application that calls the Internal Camera API. The application can then use the camera to capture with the interface inside that application. But now I want to use a previously taken photo, instead of the app taking a photo with the camera, when I press the shutter button on that app, it will record the photo I selected first.
Any ideas for the above problem? I don't want to mention the android virtual machine as that has a rather high requirement for hardware.
I have some ideas like Fake Camera software but it only applies to apps that call Android System Camera apps and not apps that use Internal Camera API. I also have an idea about using my pc to make a device that can pass an image to the Internal Camera API on the android device. But I am not knowledgeable enough or there is no software that can meet that requirement.
I think with the growth of the stackoverflow community, I can get my answer to this problem.
Thank you for reading my question.
Related
Or is it impossible no matter how you build or code apps?
I am saying in android version 5.0
Which was released 2014-2016.
I mean if when one app is using camera in “background” , is using another camera app at the same time possible??
Some people say it depends on how the applications is coded.
Also the app “sound assistant” makes 2 music apps using speaker at the same time.
Then how about camera???
And i saw a comment saying
“Our current frame work does support limited support for multi-app access to the camera.
We allow one (and only one) "controlling" app to the camera, but an arbitrary number of "shared" apps to access the same camera.
There are some limitations for "shared" apps:
No camera controls Exposure/White
Balance/Focus, etc...).
No media type selection (can't choose VGA vs.
720p vS. 1080p, etc...).
Only access to a video stream by default, photo pins are blocked (any photo operation will use a video frame instead).
The "controlling" app decides what media type to use and can set any camera control. Any of the sharing app can register to be notified if a controlling app releases control of the camera, at which point, the sharing app can re-open the camera in controlling mode.
The mechanism described above does not require any copying of the captured frame so the overhead is minimal.”
What this comment means? does it say 2apps can access to camera at the sametime anyway in android??
Any way thanks for reading and I want to know if the phone is rooted , this can be possible
thank you for reading !
I'm learning android studio and I'm currently working on a robotics project in which an Android phone is placed on the robot and used as the processor, therefore I can't reach the phone by hand. The phone needs to do some image processing. And it's not a real-time processing so I need to take a photo (Preferably Bitmap) whenever I want, quickly and without preview and confirmation. I've tried some tutorials and they all open the camera app and the user needs to capture and then confirm the photo.
I don't have problem with the processing and I don't need to use openCV etc. I just need help with capturing the photo. Thanks
You can implement your own camera, either via the camera APIs (hard) or by using a library (CameraKit-Android, Fotoapparat, etc.), thank you will have control, you can directly save the image without previewing it
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 configure front and back both cameras into Android camera2 API, to take pictures and videos from both cameras simultaneously, I have created 2 texture views , when ever I am opening one camera (front or back) my code is working fine but whenever I am trying to open both cameras simultaneously , code is breaking upon creating session, I am getting cameraAccessException :configure stream : method not implimented.
I want to save both front and back camera captured images as one image and both video as one video.
Guys it will be very much helpful if you can put some sample code or some sample link.
i am using one plus 6, i recently downloaded an app "Dual camera fron back Camera", by using this i am able to capture image from front and back both camera on the same time, so if somebody want to suggest for no hardware support, i think it may be valid for other phones but for my case i think i am missing something in coding, till now from google search it looks like there is some problem with session creation for second camera, i debugged my code, during creation of second camera session it fails so if you have any idea about that, please share.
Thanks
Rakesh
The camera API is fine with it, but most Android devices do not have sufficient hardware resources to run both cameras at once, so you will generally get an error trying to open the second camera.
Both image sensors are typically connected to the same image signal processor (ISP), and that ISP can only operate one camera at a time. Some high-end devices have ISPs with multiple processing pipelines which can in theory run more than one camera at a time, but they often require using multiple pipelines to handle advanced functionality or very high resolutions for the main (back) camera.
So on those devices, multiple cameras may be usable at once, but not at maximum resolution or other similar restrictions.
Some manufacturers include multi-camera features in their own camera app, since they know exactly what the limitations are and can write application code to work within them. They may not make multi-camera available to normal apps, due to concerns about performance, thermal limits, or just lack of time to verify more than the exact use case they implement in their own app.
The Android camera API does not currently have a way to query if multiple cameras can be used at once, or if they can be, what the restrictions are. So the only thing you can do is try, and handle the errors in case that isn't feasible.
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).