Skip to content

markusfisch/BinaryEye

Repository files navigation

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-C++ ("Zebra Crossing") barcode scanning library.

If you find this app useful and wish to support its continued development, you can buy me a coffee or send some Bitcoin decimals to bc1q2guk2rpll587aymrfadkdtpq32448x5khk5j8z.

Buy Me A Coffee Liberapay Ko-fi

Screenshots

Screenshot Gallery Screenshot Gallery Screenshot Theme Screenshot Editor

Download

Get it on F-Droid Get it on Google Play

Supported Barcode Formats

Read

ZXing can read the following barcode formats:

Generate

ZXing can generate the following barcode formats:

Deep Links

You can invoke Binary Eye with a web URI intent from anything that can open URIs.

Decoding

  1. binaryeye://scan (note: GitHub does not render this as clickable link)
  2. http(s)://markusfisch.de/BinaryEye

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 content
  • RESULT_BYTES - raw result as a hex string
  • FORMAT - barcode format

Encoding

  1. binaryeye://encode

You can use the URL arguments content and format to automatically preset this data. For example:

binaryeye://encode?content=Test&format=QRCODE

If you want the code to be generated immediately, add execute=true.

Intents

You can also use Binary Eye from other apps by using an Intent.

If you prefer to integrate a barcode scanner into your app, take a look at at BarcodeScannerView (if you also want to use ZXing-C++) or read how to scan barcodes with ML Kit on Android.

SCAN Intent

Use 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")
			…
		}
	}
}

If you're using AndroidX, this would be the new, recommended way:

class YourActivity : AppCompatActivity() {
	private val resultLauncher = registerForActivityResult(
		ActivityResultContracts.StartActivityForResult()
	) { result ->
		if (result.resultCode == RESULT_OK) {
			val content = result.data?.getStringExtra("SCAN_RESULT")
			…
		}
	}

	fun openScanner() {
		resultLauncher.launch(Intent("com.google.zxing.client.android.SCAN"))
	}
}