title: How to turn on the torch/flashlight with GooglePlay Services Vision API Xamarin Android
body: <p>I have been trying to implement the flashlight/torch feature of the camera using the GooglePlay Services Vision API (using Nuget from Visual Studio) for the past few days without success. I have noticed that there is a GitHub implementation of this API which has such functionality but that is only available to Java users.
  I was wondering if there is anything related to C# Xamarin users.</p>
  
  <p>The Camera object is not made available on this API therefore I am not able to alter the Camera parameters needed to activate the flashlight.</p>
  
  <p>I would like to be sure if that functionality is not available so I don't waste more time over this. It just might be the case that the Xamarin developers have not attended to this functionality and they might in a near future.</p>
  
  <hr>
  
  <p>UPDATE</p>
  
  <p><a href="https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/BarcodeCaptureActivity.java" rel="nofollow noreferrer">https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/BarcodeCaptureActivity.java</a></p>
  
  <p>In there you can see that on line 214 we have such method call:</p>
  
  <pre><code>mCameraSource = builder.setFlashMode(useFlash ? Camera.Parameters.FLASH_MODE_TORCH : null).build();
  </code></pre>
  
  <p>SetFlashMode is not a method of the CameraSource in Nuget, but it is on the GitHub (open source version).</p>