Android Barcode scanner library can be a great help for developers building app that to scan barcodes.
Need some career advice or prepping for an Android developer interview? Hit me up on Topmate.io, and let's chat!
In this blog, we will be sharing a list of 11 such great android barcode scanning libraries that you can easily implement in your Gradle dependencies and build barcode scanning feature.
Barcode Scanner (Java)
Android barcode Scanner Library that provide easy to use and extensible Barcode Scanner views based on ZXing and ZBar.
Add the following dependency to your build.gradle file.
repositories {
jcenter()
}
implementation 'me.dm7.barcodescanner:zxing:1.9.13'
ZXing Fragment Library (Java)
This library allows you to embed a Barcode scanner as a Fragment.
Most of the code was taken from the official ZXing repository, this is basically a re-implementation of CaptureActivity.java.
This was also inspired by another similar library, barcodefragmentlib.
Usage
Add the ZXing core library (the jar is included in libs/zxing-core-2.3.jar)
Then add the following permissions to your AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.flash" />
Extend the BarCodeScannerFragment class and add a callback somewhere:
this.setmCallBack(new BarCodeScannerFragment.IResultCallback() {
@Override
public void result(Result lastResult) {
Log.v("zxingfragmentlib", lastResult.toString());
}
});
Enjoy!
ZBar Android barcode Scanner Library
ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code.
The flexible, layered implementation facilitates bar code scanning and decoding for any application: use it stand-alone with the included GUI and command line programs, easily integrate a bar code scanning widget into your Qt, GTK+ or PyGTK GUI application, leverage one of the script or programming interfaces (Python, Perl, C++) …all the way down to a streamlined C library suitable for embedded use.
ZBar is licensed under the GNU LGPL 2.1 to enable the development of both open source and commercial projects.
ZXing Orient (Java)
An Android barcode Scanner Library based on ZXing library with support for Portrait Orientation and some cool stuff.
To implement this library in your Android Studio project, add the following line of code to your build.gradle (app) dependencies:
implementation 'me.sudar:zxing-orient:2.1.1@aar'
MVBarcode Reader (Java)
A Barcode scanning library for Android. Uses the Google Play Services’ mobile vision API for barcode detection.
Add following dependencies to your app’s gradle file:
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.gms:play-services-basement:11.0.1'
compile 'com.google.android.gms:play-services-vision:11.0.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-annotations:25.3.1'
ZXing Android barcode Scanner Library (Java)
This is the library modified from the original ZXing Project. The code is not modified in any way but is just compiled into a library so that the end-user doesn’t have to download the scanner app separately.
Usage
Add this line (if not already present there) in the project’s build.
repositories {
jcenter()
}
Add this statement in the dependencies block of app’s build.gradle file
compile 'com.tarun0.zxing-standalone:zxing-standalone:1.0.0'
ZXing Barcode (Java)
An Android barcode Scanner Library based on zxing
- Support screen auto rotate (both Landscape and portrail)
- Simplify Zxing example code for android
- Highly custom FinderView
Code Scanner (Java & Kotlin)
Code Scanner is a QR Code scanner library for Android, based on ZXing with added features like:
- Auto focus and flash light control
- Portrait and landscape screen orientations
- Back and front facing cameras
- Customizable viewfinder
- Kotlin friendly
- Touch focus
To implement this library in your Android Studio project, add the following line of code to your build.gradle (app) dependencies:
dependencies {
implementation 'com.budiyev.android:code-scanner:2.1.0'
}
Add camera permission to AndroidManifest.xml (Don’t forget about dynamic permissions on API >= 23):
<uses-permission android:name="android.permission.CAMERA"/>
Simple Android barcode Scanner Library (Kotlin)
Barcode Scanner by Google Mobile Vision Api with RxJava
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency:
implementation 'com.github.bobekos:SimpleBarcodeScanner:1.0.23'
KBarcode (Kotlin)
A library to help implement barcode scanning.
Why should you use this Android barcode Scanner Library?
- Quality We want this library to be a high-quality production-ready library.
- Camera2 Many barcode libraries still use camera1 API’s. These are now deprecated and although unlikely to be removed, you can get better performance and stability from camera2. You are also safe in the knowledge that Android will work to fix issues, and the library will have more longevity.
- Firebase This library uses Firebase to process the frames and return barcodes. The Firebase team are committed to these API’s and continue to work to improve them.
- Tested We want this library to have tests. It’s surprising how many don’t.
- Simple We want the implementation to be simple, but not try to hide away too much of the complexity of the task.
To implement this library in your Android Studio project, add the following line of code to your build.gradle (app) dependencies:
implementation 'uk.co.brightec.kbarcode:kbarcode:1.0.3'
Firebase Machine Learning Kit
Take advantage of the machine learning technologies that have long powered Google’s own experiences on mobile.
With ML Kit’s barcode scanning API, you can read data encoded using most standard barcode formats. Read more here.