Check Mobile App
Read now
Start a Project

Barcode Scanning using Firebase ML kit

Save

In order to get the information from the barcode and trigger the action, We can use ML kit’s barcode scanning API.
Steps to implement Firebase ML kit
1. We have to add Firebase in the project.
2. Add the dependencies for the ML Kit Android libraries to your module (app-level) Gradle file (usually app/build.gradle)<

Configure Barcode detector
It will be better to know the formate of the barcode in order to improve performance and getting the information
The following formats are supported:-Code 128 (FORMAT_CODE_128), Code 39 (FORMAT_CODE_39), Code 93 (FORMAT_CODE_93), Codabar (FORMAT_CODABAR), EAN-13, (FORMAT_EAN_13), Aztec (FORMAT_AZTEC), Data Matrix (FORMAT_DATA_MATRIX)

Run the Barcode Detector
1. Create FirebaseVisionImage object.
FirebaseVisionImage image = FirebaseVisionImage.fromMediaImage(media_image, rotation);
We can also get the instance of FirebaseVisionImage object from a file URI.

2. Create an instance of FirebaseVisionBarcodeDetector:

3. Finally, pass the image to the “detectInImage” method:

Get Information from barcodes

You can also go through the following link in order to get details:-
https://firebase.google.com/docs/ml-kit/android/read-barcodes
https://github.com/firebase/mlkit-material-android

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

The support is fast and do everything in their power to make it perfect. If you need customization it's also done right away. I had massive research to select Mobikul and now I'm sure it was the right one.

Igor Souza

Igor Souza

Talk to Sales

Global

Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home