0

The barcode-reader sample comes with CameraSource class. However, com.google.android.gms.vision package also contains a similar implementation of CameraSource. The sample class has additional methods (e.g. setFocusMode(), setFlashMode()). If these methods are not used then it seems that the sample custom class can be replaced with com.google.android.gms.vision.CameraSource. I tried it and the sample works fine.

Does anyone know why the sample provides its own implementation of CameraSource?

ilse2005
  • 11,189
  • 5
  • 51
  • 75
bdristan
  • 1,048
  • 1
  • 12
  • 36

1 Answers1

1

The CameraSource that is included in the sample is an open source version of the code. It allows for a greater level of customization for apps that wish to go beyond what is provided in the official API, since they can take it and modify it for their specific needs.

pm0733464
  • 2,862
  • 14
  • 16