I am using CameraEx and I need to check if the device has both Front and Rear Cameras.
Some simple devices, for example have only one camera.
Is there any function to see if the camera is present on the device before makink the initialization?
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Log ("this device has " & getNumberCameras & " cameras")
End Sub
Private Sub getNumberCameras
Dim r As Reflector
Dim ci As CameraInfoAndId
Dim cameraInfo As Object
Dim numCams As Int
cameraInfo = r.CreateObject("android.hardware.Camera$CameraInfo")
numCams= r.RunStaticMethod("android.hardware.Camera", "getNumberOfCameras", Null, Null)
Return numCams
End Sub