Eyyüp Alkış
Eyyüp Alkış

Reputation: 71

live barcode scanner firebase

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?

Upvotes: 4

Views: 2165

Answers (1)

Ian Barber
Ian Barber

Reputation: 19960

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.

Upvotes: 1

Related Questions