Android Question Geting Camera characteristics

hayk

Member
Hi everyone!
I am trying to get Camera characteristics using Camera2 Library like is displayed in this app:

I use this code but it did not work:

example:
        Try
            ' Access camera parameters
            Dim params As JavaObject = Camera.GetCameraCharacteristics(0) ' Get the camera characteristics
          
            If params <> Null Then
                ' Use reflection to retrieve the value
                Dim lensInfoFocalLengthsField As JavaObject = params.RunMethod("Get", Array("LENS_INFO_AVAILABLE_FOCAL_LENGTHS"))
                If lensInfoFocalLengthsField <> Null Then
                    Dim focalLengthArray() As Float = lensInfoFocalLengthsField.RunMethod("get", Null)
                    If focalLengthArray <> Null And focalLengthArray.Length > 0 Then
                        Log($"Focal Length: ${focalLengthArray(0)}"$) ' Assuming it's an array and taking the first value
                    End If
                End If
            
                ' Similar adjustments for other parameters using reflection
            End If
            
        Catch
            LogColor("Camera_CameraOpened " & LastException, Colors.Red)
        End Try

Does anyone know how to get those characteristics?
Thanks in advanced !
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…