How can i open both front camera and back camera at the same time in android? Is it possible?
I have tried tried but my application stops unfortunately.
Please Help..
On some devices, e.g. based on Snapdragon 805, you simply can. In other cases, the manufacturer chose to block the naïve approach, but the native camera app knows how to do it, and, with some reverse engineering effort, you can reproduce their approach (I had partial success with Samsung S4 before I lost interest in that project).
But on most of available phones, there is a physical restriction: the two cameras share the same bus, and cannot be opened simultaneously, no matter how skillful you are in software.
Related
Having a strange issue on one android phone for a website using openvidu for streaming.
There is a switch camera function which alternates between front and back cameras. This is accomplished by getting all the available devices say on the back and selecting the last one in the array and then publishing the stream to that device.
I’ve tested this on windows, mac, multiple iPhones in safari and chrome and multiple android phones in chrome and works perfectly.
However one android phone is behaving strange that when switching to the environment camera it says that the device is already in use, but it can’t be in use, the phone literally rebooted and no other app loaded and activated the camera.
Not sure why this is happening? I was thinking maybe the code should stop each device before the switch happens? But why would it say it’s in use when it’s not?
Update
After some investigation this seems like an annoying issue with huawei phones where one of the back cameras has the same device Id as the hands free audio input device, so when my code is selecting a back camera that works everywhere else it thinks it’s in use due to the id being used by the audio input.
So it looks like the only way around this is to bypass the selection of this particular camera if it’s id is the same as an audio input device and select a different back camera instead. Annoying!
Update 2
Actually it seems a bit more than this, the phone has 3 back cameras but 4 devices show up as video input, it looks like there is a bug on the device where it thinks the audio input is the same as the video input so it’s adding an additional camera to the device list, unless this is because somehow on that phone the hands free device includes a camera. Really odd
Update 3
The phone is a p20 pro and I also noticed it actually has 2 audio input that share 2 video input device id instead of all being unique which then causes another problem when try to use a different video device id.
Use case: I have security cameras around my home (on zoneminder). When an event is triggered (someone walks by the camera) I want to have some screen nearby the door and ideally push a notification to devices (hopefully android tablets) to display the camera view on all these connected devices.
I'm happy developing my own app if necessary (even better if such an app already exists). But does Android support this functionality to allow an app to open based on an external event (some message to the app)? I've personally never seen it (phonecall is the one exception). I'm sure listening for events is easy, but I can see there being a rule not to allow apps to 'force open' in this way.
If there is a way, if you could point me to the class that would support this I would appreciate it. Thanks!
(If you have any other solutions for my use case, I'd be happy to hear them. Unfortunately, I'd like these tablets to run other apps too, so keeping the 'camera app' open constantly isn't really a solution for me.)
My app is taking pictures with the native android camera. With my Motorola X 2, everything is going fine when the intent is launching. I can change settings, luminosity, HDR option etc.
I installed the same application on a Nexus 5 (Android 6.0.1). I started the application and then the camera intent. The device won't allow to change the HDR settings. Otherwise, in the native camera application, I can change these settings.
Is there a way to enable programmatically the HDR option on the camera before starting the intent ?
Or another way to fix it ?
Is there a way to enable programmatically the HDR option on the camera before starting the intent ?
No.
Or another way to fix it ?
Take the pictures yourself, using the camera APIs. Note that this is rather complex.
Right now, you are delegating to a third-party camera application. There are over 8000 Android device models. There will be hundreds of different pre-installed camera apps across those models, plus many more that users install from the Play Store or elsewhere. None of them have to offer HDR control to the user. None of them have to offer you the ability to request a particular HDR setting. And your app could wind up requesting any of those, based upon device and user.
In your case, on one of your devices, one of the hundreds of camera apps happens to offer HDR control when launched normally and not offer HDR control when launched via ACTION_IMAGE_CAPTURE (or whatever other Intent action that you are using). Either the developers of that camera app chose that behavior intentionally, or they have a bug in their app. Regardless, there is nothing that you can do about it.
I know this question has been asked before but its been a long time. Asking this question again to gather any new hacks/thoughts/approaches.
I need to access both front and back camera simultaneously.
So far I have tried implementations using android camera API (Dual Camera- by Jens) and camera2 API. Both implementations work fine on devices having hardware support(Dual Image Signal Processors) for dual camera feature.I have tested and both implementations works fine on HTC one M8(Snapdragon 801) & Xiaomi Mi4(Snapdragon 801).
Both implementations fails on Samsung s6 even though it's hardware capable (Exynos 7420 has dual ISP). Also, the default camera app on S6 supports dual camera mode.
Any ideas/advice on this ?
Thanks in advance.
Update:18/11/2015 --> Tried using the Samsung Galaxy Camera SDK but still no luck.
I had to implement the exact same thing in a previous project. I know the struggle, and I know how much code you have to write to make this work. Especially with Google providing TWO camera apis (camera and camera2).
Even though I got it working on some devices (like HTC M8) which basically had two Image Signal Processor (necessary to access both cameras at the same time), I had trouble with the Samsung devices that had this feature implemented in their native camera application.
Then I turned around and found out that Samsung provides different special APIs for its "very special" OS. What that means, is that for every special feature that Samsung has (like the finger print sensor, the S-pen, and soooo on), they provide a API for the developers to work with.
I found the SCamera API on their site here . They also provide very good documentation and it is ok to implement.
The question you need to ask yourself: is it really worth it to integrate yet another camera API in your app to make this work on Samsung devices as well? Take in consideration that the proportion of Samsung devices is really high.
My advice? Try and implement it in a different project and see how that goes. If you get it to work in a decent amount of time and it's not very complicated, then integrate it in your main project.
I hope this helps you. Have a great day and good luck!
I need to view the live screen of my Android mobile on a Windows PC. My Android phone has a mini-HDMI output. Is there any adapter/software that helps me to achieve this? The applications that I found after searching needs the device to be rooted to control it. I don't want to remotely control the device. I just need to get the live feed from the mobile.
Actually, there are some relatively affordable HDMI-DVI adapters on the market. Couple them with a mini-HDMI to full HDMI cable and you've got yourself a decent hardware setup.
Some notes:
HDMI carries audio and video, while DVI carries only video. However, the two have no difference in video quality, and they use the same encoding.
as Mgamerz said, support for the HDMI outputs on Android phones has been, thus far, dismal. Your phone might have the port, but your ROM might not support it. Furthermore, some apps won't even acknowledge the existence of the HDMI, again, because so few phones have them.
From a hardware and an encoding point of view, this is COMPLETELY possible, but from a software point of view, it is likely IMPOSSIBLE. If you figure out how to do what you're trying, definitely tell as many people as possible.
You're going to need HDMI mirroring, which means you'll need a high end device (most likely dual cores), and support for it is going to have to be built into the rom. I own an atrix, and developers have slaved for months to get HDMI mirroring on it, but only some progress has been made.
Otherwise, unless your device supports it, you won't be able to do it. It's dependent on hardware too.
Edit: There might be some apps to do it but I doubt they will achieve what you seek. HDMI mirroring typically doesn't go past 20fps either (on a dual core 1Ghz).
To use the HDMI port, you'd need something that can accept HDMI input.
Very few computers can do so (except possibly some smart-tv type boxes).
However, there's a good chance that the monitor connected to your computer can. It might even have a spare input.
In other words, displaying your phone's output "in a window" on your monitor is extremely difficult. But by pushing a button or swapping a cable, you may well be able to display your phone's output on the entire monitor, in place of the computer's.
Practically speaking, if you need it in a window, or the device doesn't have HDMI out, the most common solution seems to be a high-end webcam in a fixture to aim it at the device. I saw a presentation that was delivered this way, displaying on very large flatscreen TVs, and didn't even realize that the slides were coming from an Android tablet as seen by an overhead camera until the presenter picked up the tablet and slid a phone into it's place.
http://mymobiler.com/?cat=3
Try this app from mymobiler. it works on motorola atrx 2 with android 2.3.6 rooted.
The site lists only a few supported models but it seems working on other models too.
You can get the full access to the mobile screen in your windows application windows.
It can also capture screenshots and take video of the actions on the screen.