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

When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

Michael Urresta

Michael Urresta

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