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.
Related
I would like to disable the Camera on Android devices(Ignoring rooted devices). So far successfully using Android device administration to disable Camera. However, camera in containers such as Android for Work is able to bypass the policy (Samsung Secure Folder as well, but that can be disabled using KNOX). Are there other ways to enforce disable camera other then device administration?
For Samsung devices, cameras can be disabled entirely using KNOX. But other android devices such as Sony and LG does not have such capability. Does this mean there are no way to enforce camera disable?
I'm wondering if the Sony Camera API has parts that are only supported by certain versions of Android.
I have the latest firmware (1.04) on my a6500 and running Android 7 on LineageOS (successor of CyanogenMod) for the Samsung S5 (KLTE version). This is what I get in my Play Memories app:
The shutter button works and images download to the phone. But that's it.
Additionally, when I use another app called DSLRDashboard, the settings show up and can be changed on the app, but they don't get changed or applied on the camera, and this is in full manual mode on the camera. Other modes don't work either.
What could be causing this? What would need to be added into a 3rd party ROM like LineageOS to get this working?
Really hoping that the official Sony developers that roam this site will be able to chime in.
So, a bit of a snafu on my part.
It's not enough to update just the firmware on the Sony camera. The Remote Control app installed in the camera must also be updated as well, which means hooking the camera up to WiFi and downloading the updates for that app. With that done, all the settings appear in the phone app and can the changed.
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 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.
Can I emulate camera flash with Android emulator? I wasn't able to find anything flash-related in the settings.
Flash is manipulated via camera object by setting flash mode before taking picture
or preview. Emulator will allow you to do this. But I found flash behaviour extremely inconsistent across different devices.
Real camera applications use undocumented native apis which are specific for phone and camera models.