Tiago_nes
Tiago_nes

Reputation: 923

How to use Xamarin Android.Hardware.Camera2;

I can't really understand the usage of Android.Hardware.Camera2 in Xamarin can anyone explain me how to use OpenCamera method and how do i define the AvailabilityCallback?

Here is my code

if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
{
    CameraManager cameraManager = ((CameraManager)Context.GetSystemService(Context.CameraService));
    //AvailabilityCallback stateCallback = ;


    Control.Preview = cameraManager.OpenCamera(cameraManager.GetCameraIdList()[0], WHAT_HERE?, null);
 }
 else
 {
    Control.Preview = Camera.Open((int)e.NewElement.Camera);
 }

Many thanks in advance.

Upvotes: 2

Views: 4295

Answers (1)

Related Questions