4

I have trouble with firebase barcode scanner which is in ML kit. In documentation there is no clue about live barcode scanner. I mean there is a solution for image but I want to do it instant with camera without taking picture. Is it possible or firebase barcode scanner is just for image?

peterh
  • 11,875
  • 18
  • 85
  • 108
  • Thanks for your question! Remember to include everything someone would need to answer, such as including the platform you're building for, and including what you've tried so far. – Ian Barber Sep 18 '18 at 20:20

1 Answers1

1

You can absolutely pull it from the camera directly, either as part of a live preview or as an image returned from taking a picture with the camera. How you do that will depend on your platform. Be aware that dealing with a live preview will make your code significantly more complex, so I would recommend getting it working with pictures from the gallery first to make sure you can do what you want!

For iOS you would follow the instructions for the CMSampleBufferRef in the documentation, and you can see an example of using it in the quickstart sample.

For Android you'd take your preview data from a ByteBuffer as described in the documentation, and you can see a full sample app in the Android quickstart.

I'd recommend downloading and trying the appropriate quickstart sample in order to see the various moving parts you'll need to recreate in your own app.

Ian Barber
  • 19,765
  • 3
  • 58
  • 58