We got many samsung user complain that our app's camera "front LED flash" cannot work normal after they upgrade to Android Oreo. But it is work normal at native camera. (so it should not hardware broken issue)
After check, we found that after upgrade to Android Oreo, we cannot get any flash capability from "getSupportedFlashModes" (camera1). We also tried camera2, but it not work either.
// Camera1
Camera.Parameters cameraParameters = mCamera.getParameters();
List<String> supportList = cameraParameters .getSupportedFlashModes();
// Camera2
mCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
Our app is work normal before upgrade Oreo, and it also work at non-Samsung device. Is there any think I miss? or is there any tricky way to control samsung front flash ? Thanks a lot
Related
I managed to preview back & front cameras simultaneously, using Camera2 API (multiple-camera-streams-simultaneously)
It works pretty well on OnePlus 8 (pro) device BUT didn't work on others such as Samsung Galaxy A32 and OnePlus 7 (pro);
got the error: ERROR_MAX_CAMERAS_IN_USE, while trying to open the second camera.
How can I know which devices can support it ?
I understand there is HW criteria for that, but what is it ?
Thanks
Starting API 30, new methods are added to know availability as well stream configuration for concurrent cameraID that you can use.
https://source.android.com/devices/camera/concurrent-streaming
Following the Camera 2 sample I've created simple camera class to capture the images. When it's okay with capturing both flash/non-flash images on any device with Android < 7.0, on mine Nexus 5X with Android 7.1 the same config fire the flash only once on the preview. Pre-sequences are the next:
for the preview I'm using CameraDevice.TEMPLATE_PREVIEW with AE mode set to CameraMetadata.CONTROL_AE_MODE_ON_ALWAYS_FLASH
the same I use for the capture still picture, but with CameraDevice.TEMPLATE_STILL_CAPTURE
If someone can help me with this case - I'll be really appreciated.
This is just additional information on the above issue. I wish to draw some attention to this problem!
My application takes a photo every 5 seconds. I (1) select the camera, (2) acquirer a session and then with each loop I (3) create a Capture request in which I set the Flash Mode and call the capture method on the session.
I have no issues with my Samsung SM-G550T (Android version 6.01), but I was having some issues with the Flash Mode on my Moto G4 (Android version 7.0). I got both phones to Flash, but only with this setting:
CaptureRequest.Builder requestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
I am presently having an issue with a LG device (M210N) (Android version 7.0). Using the settings I stated above I get the device to flash just once. If I completely re-initialize the camera (as described above) the device will flash again only once.
If I add the CONTROL_AE_MODE_ON_ALWAYS_FLASH setting to the above requestBuilder, then the LG does not flash at all. So I had to remove that flag.
I have tried many different additional settings and combination for settings and none of them have eliminated this issue. I wonder how many devices are affected by this issue.
I am working on an app and using the Camera class that comes with the Android SDK. The class seems to work on my Galaxy Ace, but I've read that it doesn't work on all Android devices. Here's the function I call:
Camera camera;
camera.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);
Sometimes OEM's customize default behavior and takePicture was introduced in API level 5. I'm also using this in one of my application and till now I haven't seen a device not supporting this.
Can you be more specific on which device it's not working?
I've been developing and app to turn on the LED light next the camera on Android. I have my code working for the Incredible and the Charge (because they are the only two other devices I have to test on) but I can't seem to get the Droid X LED to turn on. Is there some other way to turn on the camera's flashlight programmatically? I am also pretty sure all my permissions are correct considering it does work on other phones.
Here is the basic code being used to turn it on.
cam = Camera.open();
params = cam.getParameters();
params.setFlashMode(Parameters.FLASH_MODE_TORCH);
cam.setParameters(params);
cam.startPreview();
You can't just set any flash mode you want because a camera driver may not support it. You need to get available flash modes using Parameters.getSupportedFlashModes(), check whether the mode you want to set is supported or not and set it if it's supported. So I assume it's not supported on Droid X.
I'm trying to use the camera in an Android app using the 1.5 API. I want the camera to flash for every picture. However, when I looked at the API for camera.parameters, the setFlashMode() method is only supported for 2.0 and higher. Yet my Cliq XT, which runs 1.5, has a flash that I can set in the menu - I take this to mean there is a way to do this for the 1.5 API, though I was unable to find it.
Does anyone know how to set the flash mode using the 1.5 API?
You can use the following code to set the flash in older versions of the API:
Parameters params = camera.getParameters();
params.set("flash-mode", "on");
camera.setParameters(params);
I just guessed on the values to send to the .set method, but I just tested it and this turns on the flash.
Does anyone know how to set the flash mode using the 1.5 API?
There is no API for that in 1.5, sorry. A device manufacturer is not limited by the public SDK and therefore can access capabilities that you, as a third-party developer, cannot.