Android Question How to enable camera night mode

toby

Well-Known Member
Licensed User
Longtime User
When the surrounding is dark, I want to enable the night mode, if the camera has this feature, to have clear pictures. Could some expert show me how to do it, please?

TIA
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is the relevant documentation: https://developer.android.com/training/camera2/hdr-video-capture

I actually started converting it:
B4X:
Public Sub IsTenBitProfileSupported As Boolean
    Dim keys() As Int = Camera.GetCameraCharacteristics(id).As(JavaObject).RunMethod("get", Array(StaticCameraCharacteristics.GetField("REQUEST_AVAILABLE_CAPABILITIES")))
    For Each key As Int In keys
        If key = 0x00000012 Then Return True
    Next
    Return False
End Sub

However my test devices do not support it and it is too complex to implement like this. I'll implement it in the future.

You can use this code, add it to CamEx2, to check whether your device supports it.
 
Upvote 0
Top