hello,
i will use the camera 2 but it gave me an error.
my device have 5.0.2 API 21 19. Dezember 2014
and it should work and i believe i tested it long ago and it worked.
at my tablet device with android 6.0 it works.
at os 5 the example said: Failed to open camera
the used example:
https://www.b4x.com/android/forum/threads/camera2-still-images-and-videos.83920/#post-531669
i will use the camera 2 but it gave me an error.
my device have 5.0.2 API 21 19. Dezember 2014
and it should work and i believe i tested it long ago and it worked.
at my tablet device with android 6.0 it works.
at os 5 the example said: Failed to open camera
B4X:
Sub OpenCamera (front As Boolean)
rp.CheckAndRequest(rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result = False Then
ToastMessageShow("No permission!", True)
Return
End If
SetState(False, False, VideoMode)
Wait For (cam.OpenCamera(front)) Complete (TaskIndex As Int)
If TaskIndex > 0 Then
MyTaskIndex = TaskIndex 'hold this index. It will be required in later calls.
Wait For(PrepareSurface) Complete (Success As Boolean)
End If
Log("Start success: " & Success)
SetState(Success, False, VideoMode)
If Success = False Then
ToastMessageShow("Failed to open camera", True)
End If
Log(cam.ActiveArraySize)
End Sub
the used example:
https://www.b4x.com/android/forum/threads/camera2-still-images-and-videos.83920/#post-531669
Last edited: