2

I'm building simple barcode reader with Android Vision API using googlesamples as guide. The problem is that I want to add toggle button for turning flash on/off, but method public Builder setFlashMode(@FlashMode String mode) used in the googlesamples code is missing in the latest version of Vision API implementation 'com.google.android.gms:play-services-vision:17.0.2'

I've tried to find out if this method has been replaced with something else by digging through Vision Java Doc but had no luck.

I'm using basically the same code as in BarcodeCaptureActivity in the googlesamples for barcode detection and that part works perfectly , I just need to add option to turn on flash light.

Is there any way to do this using code from googlesamples, or I need to downgrade to some old version of Vision or change my approach altogether.

krdzy
  • 31
  • 4
  • I didn't know that there was flash control within the Google vision API, I have always controlled it from the Camera2 and legacy Camera classes which is also an option and has flash control parameters there that you can take advantage of as well. – Jay Snayder Feb 05 '19 at 20:57

0 Answers0