All Projects → G00fY2 → quickie

G00fY2 / quickie

Licence: MIT License
📷🔍 Android QR code scanning library

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to quickie

Zxinglite
🔥 ZXing的精简版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信)
Stars: ✭ 2,117 (+1198.77%)
Mutual labels:  barcode, qr-code, qrcode-scanner, camerax
Qr Code Scanner
📠 A simple, fast and useful progressive web application
Stars: ✭ 982 (+502.45%)
Mutual labels:  barcode, qr-code, qrcode-scanner
QR Attendance
This project is an attendance system which provides attendance on scanning QR code. The attendance is stored in Excel sheet named with the date of attendance taken. In this folder a file named Generate.py is used to generate the QR code for given input file. Attend.py file is for scanning the QR code
Stars: ✭ 17 (-89.57%)
Mutual labels:  qr-code, qrcode-scanner
android-zbar-sdk
🔗 android-zbar-sdk, provide jni source, so file and jar file used alone, gradle/maven remote dependencies.
Stars: ✭ 311 (+90.8%)
Mutual labels:  barcode, qrcode-scanner
barcoder
Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.
Stars: ✭ 76 (-53.37%)
Mutual labels:  barcode, qr-code
barcode scan2
[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.
Stars: ✭ 43 (-73.62%)
Mutual labels:  barcode, qrcode-scanner
Segno
Python QR Code and Micro QR Code encoder
Stars: ✭ 144 (-11.66%)
Mutual labels:  barcode, qr-code
scanbot-sdk-example-ios
No description or website provided.
Stars: ✭ 17 (-89.57%)
Mutual labels:  barcode, qr-code
Barcode To Pc App
Barcode to PC app
Stars: ✭ 121 (-25.77%)
Mutual labels:  barcode, qrcode-scanner
qrcode
A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
Stars: ✭ 69 (-57.67%)
Mutual labels:  qr-code, qrcode-scanner
python
Build Python extension with Dynamsoft Barcode Reader.
Stars: ✭ 35 (-78.53%)
Mutual labels:  barcode, qr-code
browser
ZXing for JS's browser layer with decoding implementations for browser.
Stars: ✭ 88 (-46.01%)
Mutual labels:  barcode, qr-code
Barcode
barcode.php - Generate barcodes from a single PHP file. MIT license.
Stars: ✭ 141 (-13.5%)
Mutual labels:  barcode, qr-code
barcode-detector
Spec compliant polyfill of the Barcode Detection API 🤳
Stars: ✭ 31 (-80.98%)
Mutual labels:  barcode, qrcode-scanner
React Native Qrcode Scanner
A QR code scanner component for React Native.
Stars: ✭ 1,796 (+1001.84%)
Mutual labels:  barcode, qrcode-scanner
barcode-server
Barcode Server for Barcode Client-Server android application
Stars: ✭ 40 (-75.46%)
Mutual labels:  barcode, qrcode-scanner
Qr-Code-Scanner-
This is simple QR code scanner with Room Database. 100% written in Kotlin.
Stars: ✭ 19 (-88.34%)
Mutual labels:  qrcode-scanner, qr-code-reader
Scanbot Sdk Example Android
Document scanning SDK example apps for the Scanbot SDK for Android.
Stars: ✭ 67 (-58.9%)
Mutual labels:  barcode, qr-code
Barcodescanner.xf
Barcode Scanner using GoogleVision API for Xamarin Form
Stars: ✭ 82 (-49.69%)
Mutual labels:  barcode, qrcode-scanner
BarcodeReader
Simple multi-format barcode reader for Windows
Stars: ✭ 26 (-84.05%)
Mutual labels:  barcode, qrcode-scanner

quickie is a Quick Response (QR) Code scanning library for Android that is based on CameraX and ML Kit on-device barcode detection. It's an alternative to ZXing based libraries and written in Kotlin. quickie features:

  • Easy API for launching the QR scanner and receiving results by using the new Activity Result API
  • Modern design, edge-to-edge scanning view with multilingual user hint
  • Android Jetpack CameraX for communicating with the camera and showing the preview
  • ML Kit Vision API for best, fully on-device barcode recognition and decoding

Download Maven Central

There are two different flavors available on mavenCentral():

Bundled Unbundled
ML Kit model is bundled inside app (independent of Google Services) ML Kit model will be automatically downloaded via Play Services (once while app install)
2.3 MB app size increase per ABI (you should use App Bundle or ABI splitting) 550 KB app size increase
V3 model is used (faster, more accurate) currently V1 model will be downloaded
// bundled:  
implementation("io.github.g00fy2.quickie:quickie-bundled:1.4.0")

// unbundled:
implementation("io.github.g00fy2.quickie:quickie-unbundled:1.4.0")

Quick Start

To use the QR scanner simply register the ScanQRCode() ActivityResultContract together with a callback during init or onCreate() lifecycle of your Activity/Fragment and use the returned ActivityResultLauncher to launch the QR scanner Activity.

val scanQrCode = registerForActivityResult(ScanQRCode(), ::handleResult)

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    …
    binding.button.setOnClickListener { scanQrCode.launch(null) }
}

fun handleResult(result: QRResult) {
    …

⚠️ You can't register the ActivityResultContract inside the OnClickListener lambda. This will fail since the code gets executed after the onCreate lifecycle!

Check out the sample inside this repo or visit the official Activity Result API documentation for more information.

Responses

The callback you add to the registerForActivityResult will receive a subclass of the sealed QRResult class:

  1. QRSuccess when ML Kit successfully detected a QR code
    • wraps a QRContent object
  2. QRUserCanceled when the Activity got canceled by the user
  3. QRMissingPermission when the user didn't accept the camera permission
  4. QRError when CameraX or ML Kit threw an exception
    • wraps the exception

Content

The content type of the QR code detected by ML Kit is wrapped inside a subclass of the sealed QRContent class which always provides a rawValue.

Currently, supported subtypes are: Plain, Wifi, Url, Sms, GeoPoint, Email, Phone, ContactInfo, CalendarEvent

See the ML Kit Barcode documentation for further details.

Customization

Use the ScanCustomCode() ActivityResultContract to create a configurable barcode scan. When launching the ActivityResultLauncher pass in a ScannerConfig object:

BarcodeFormat options
BarcodeFormat.FORMAT_ALL_FORMATS
BarcodeFormat.FORMAT_CODE_128
BarcodeFormat.FORMAT_CODE_39
BarcodeFormat.FORMAT_CODE_93
BarcodeFormat.FORMAT_CODABAR
BarcodeFormat.FORMAT_DATA_MATRIX
BarcodeFormat.FORMAT_EAN_13
BarcodeFormat.FORMAT_EAN_8
BarcodeFormat.FORMAT_ITF
BarcodeFormat.FORMAT_QR_CODE
BarcodeFormat.FORMAT_UPC_A
BarcodeFormat.FORMAT_UPC_E
BarcodeFormat.FORMAT_PDF417
BarcodeFormat.FORMAT_AZTEC
val scanCustomCode = registerForActivityResult(ScanCustomCode(), ::handleResult)

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    …
    binding.button.setOnClickListener {
      scanCustomCode.launch(
        ScannerConfig.build {
          setBarcodeFormats(listOf(BarcodeFormat.FORMAT_CODE_128)) // set interested barcode formats
          setOverlayStringRes(R.string.scan_barcode) // string resource used for the scanner overlay
          setOverlayDrawableRes(R.drawable.ic_scan_barcode) // drawable resource used for the scanner overlay
          setHapticSuccessFeedback(false) // enable (default) or disable haptic feedback when a barcode was detected
          setShowTorchToggle(true) // show or hide (default) torch/flashlight toggle button
          setHorizontalFrameRatio(2.2f) // set the horizontal overlay ratio (default is 1 / square frame)
          setUseFrontCamera(true) // use the front camera
        }
      )
    }
}

fun handleResult(result: QRResult) {
    …

💡 You can optionally pass in an ActivityOptionsCompat object when launching the ActivityResultLauncher to control the scanner launch animation.

Screenshots / Sample App

You can find the sample app APKs inside the release assets.

Image

Requirements

  • AndroidX
  • Min SDK 21+ (required by CameraX)
  • (Google Play Services available on the end device if using quickie-unbundled)

Contributing

See CONTRIBUTING

Thanks to everyone who contributed to quickie!

License

The MIT License (MIT)

Copyright (C) 2021 Thomas Wirth

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].