Starting HTC camera in photo/video mode - android

I am building an app that uses the device camera app to take photos or record videos. There is a single button in my app that starts the camera app, and does it using MediaStore.INTENT_ACTION_VIDEO_CAMERA intent. So far, on all non-HTC devices that I've tested, the camera app opens in the default mode in which I can switch between taking photos and recording videos, while on HTC devices I can only record videos. Is there any method of starting the camera app on HTC devices from another app in the same mode as when it is started from the launcher.

So far, on all non-HTC devices that I've tested, the camera app opens in the default mode in which I can switch between taking photos and recording videos
There are thousands of camera apps, both ones that are pre-installed or installed by users. Many may elect to support INTENT_ACTION_VIDEO_CAMERA. None are required to have a "default mode in which [the user] can switch between taking photos and recording videos". This is not a problem with HTC -- it is a problem with your expectations.
Is there any method of starting the camera app on HTC devices from another app in the same mode as when it is started from the launcher.
Even if there is some undocumented, unsupported, unreliable, script-kiddie way to force this on some HTC devices, there are many other camera apps that will not offer such a means.
If you want that degree of control, write your own camera app.

Related

Display Manager can't detect huawei phones's screen recorder

On huawei phones DisplayManager.getDisplays() can see the screen recording of 3rd party applications. But when I open the huawei device's own screen recording application, DisplayManager cannot detect it.
I use getDisplays() method (Gets all currently valid logical displays.)
https://developer.android.com/reference/android/hardware/display/DisplayManager
There is no such problem with other android phones like xiaomi or samsung.
I want to detect whether huawei device's own screen recording is turned on

Webrtc with openvidu device already in use when it’s not

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.

Enable HDR option before starting camera intent

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.

Opening of Front Camera and Back Camera simultaneously?

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.

Flashlight crashes systems Camera App

I am making a Flashlight app, currently its widget.
I was wondering how would I emulate functionality of samsungs assistive light widget (http://www.youtube.com/watch?v=PYR9jqo0vvc&feature=player_embedded#!)?
If I turn my light on, the camera app is not going to work, however with this widget, samsung made it somehow work. I have no idea at all, for all I know Camera.open() locks the camera to the process, so Camera app cannot access it.
Thanks.
The standard Android camera API does not allow for setting the flash to torch mode, and then allowing some other application to use the camera. If the Flashlight app does not release the camera, then the standard camera app cannot work. If the Flashlight app does release the camera, then the flash will turn off.
Samsung must have extended the Android APIs with a custom feature to enable/disable the torch mode without requiring locking the camera. If they wish, they could document this additional capability, but presumably the added APIs only exist on the Galaxy S3 or other similar Samsung devices; it would not allow you to write code that works on all Android devices.

Categories

Resources