867dc36811
Add desugaring support to reverse translate Java 8 language features
in order to use the latest ZXing without having to increase minSdk.
ZXing 3.4 doesn't work on SDK levels below 24 anymore, see:
https://github.com/zxing/zxing/issues/1170
Many thanks to @TheLastProject for showing me the way:
|
||
---|---|---|
app | ||
fastlane/metadata/android | ||
gradle/wrapper | ||
svg | ||
.gitignore | ||
build.gradle | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
LICENSE | ||
Makefile | ||
PRIVACY.md | ||
README.md | ||
settings.gradle |
Binary Eye
Yet another barcode scanner for Android. As if there weren't enough.
This one is free, without any ads and open source.
Works in portrait and landscape orientation, can read inverted codes, comes in Material Design and can also generate barcodes.
Binary Eye uses the ZXing ("Zebra Crossing") barcode scanning library.
Screenshots
Download
Supported Barcode Formats
Read
ZXing can read the following barcode formats:
- AZTEC
- CODABAR
- CODE 39
- CODE 93
- CODE 128
- DATA MATRIX
- EAN 8
- EAN 13
- ITF
- MAXICODE (only when unrotated and unskewed, see 77, because of which Binary Eye cannot read this barcode)
- PDF417
- QR CODE
- RSS 14
- RSS EXPANDED
- UPC A
- UPC E
- UPC EAN EXTENSION
Generate
ZXing can generate the following barcode formats:
Deep Links and Intents
Deep Links
You can invoke Binary Eye with a web URI intent from anything that can open URIs. There are two options:
If you want to get the scanned contents, you can add a ret
query
argument with a (URL encoded) URI template. For example:
http://markusfisch.de/BinaryEye?ret=http%3A%2F%2Fexample.com%2F%3Fresult%3D{RESULT}
Supported symbols are:
RESULT
- scanned contentRESULT_BYTES
- raw result as a hex stringFORMAT
- barcode formatMETA
- the meta data, if available
SCAN Intent
You can also use Binary Eye from other apps by using the
com.google.zxing.client.android.SCAN
Intent with startActivityForResult()
like this:
startActivityForResult(
Intent("com.google.zxing.client.android.SCAN"),
SOME_NUMBER
)
And process the result in onActivityResult()
of your Activity
:
override fun onActivityResult(
requestCode: Int,
resultCode: Int,
data: Intent?
) {
when (requestCode) {
SOME_NUMBER -> if (resultCode == RESULT_OK) {
val result = data.getStringExtra("SCAN_RESULT")
…
}
}
}
RenderScript
This app uses RenderScript to resize and rotate the camera image. Unfortunately, RenderScript has some nasty gotchas.
RenderScript.forceCompat()
It's necessary to call RenderScript.forceCompat()
on some devices/roms.
RenderScript.forceCompat()
needs to be run before any other RenderScript
function and unfortunately there is no way to know if invoking forceCompat()
is necessary or not.
If RenderScript.forceCompat()
is necessary, a RSRuntimeException
will
be thrown and the only option is to restart the app, this time with calling
forceCompat()
first.
Calling RenderScript.forceCompat()
means the processing is done in
software so you probably don't want to enable it by default.
2D barcodes
If you want to fork this and are only interested in reading 2D barcodes (like QR or Aztec), you may want to remove the custom rotation kernel altogether as ZXing can read 2D barcodes in any orientation.
This will make your app a bit simpler and saves you from compiling a custom RenderScript kernel for each architecture you want to support.