All Projects → mgouline → Droidxing

mgouline / Droidxing

Licence: apache-2.0
Simple Android wrapper for ZXing.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Droidxing

browser
ZXing for JS's browser layer with decoding implementations for browser.
Stars: ✭ 88 (+1660%)
Mutual labels:  zxing
Ngx Scanner
Angular (2+) QR code, Barcode, DataMatrix, scanner component using ZXing.
Stars: ✭ 420 (+8300%)
Mutual labels:  zxing
Android Zxing
android google zxing 可配置扫描框、线样式 ,生成二维码(文字、联系人)
Stars: ✭ 552 (+10940%)
Mutual labels:  zxing
qrcode
A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
Stars: ✭ 69 (+1280%)
Mutual labels:  zxing
Lbxscan
A barcode and qr code scanner (二维码、扫码、扫一扫、ZXing、ZBar、iOS系统AVFoundation扫码封装,扫码界面效果封装)
Stars: ✭ 3,133 (+62560%)
Mutual labels:  zxing
Zxing Cpp
ZXing C++ Library
Stars: ✭ 483 (+9560%)
Mutual labels:  zxing
Zxing-demo
A tutorial app to generate Barcode using Zxing.
Stars: ✭ 17 (+240%)
Mutual labels:  zxing
Tesseract Ocr Scanner
基于Tesseract-OCR实现自动扫描识别手机号
Stars: ✭ 622 (+12340%)
Mutual labels:  zxing
Qzxing
Qt/QML wrapper library for the ZXing library. 1D/2D barcode image processing library
Stars: ✭ 401 (+7920%)
Mutual labels:  zxing
Scanner
二维码/条码识别、身份证识别、银行卡识别、车牌识别、图片文字识别、黄图识别、驾驶证(驾照)识别
Stars: ✭ 547 (+10840%)
Mutual labels:  zxing
Inventory-Management-System
This is an app for a warehouse management using Bar code Scanner. The database used is Firebase.
Stars: ✭ 41 (+720%)
Mutual labels:  zxing
Binaryeye
Yet another barcode scanner for Android
Stars: ✭ 278 (+5460%)
Mutual labels:  zxing
Code Scanner
Code scanner library for Android, based on ZXing
Stars: ✭ 543 (+10760%)
Mutual labels:  zxing
StarBarcode
一个基于Zxing封装的条形码扫描库。支持多种条形码,可生成、解析带logo的二维码,自动放大镜头,设备移动时自动对焦、连续对焦,扫描UI自定义。
Stars: ✭ 52 (+940%)
Mutual labels:  zxing
Quick Media
media(audio/image/qrcode/markdown/html/svg) support web service (多媒体编辑服务, 酷炫二维码, 音频, 图片, svg, markdown, html渲染服务支持)
Stars: ✭ 612 (+12140%)
Mutual labels:  zxing
ZxingSimplify
一个精简的安卓Zxing扫码库。(A Zxing simplify library for Android)
Stars: ✭ 36 (+620%)
Mutual labels:  zxing
Qrcodescanner
An optimized qr code scan tool forked from zxing.
Stars: ✭ 427 (+8440%)
Mutual labels:  zxing
Zxing
ZXing ("Zebra Crossing") barcode scanning library for Java, Android
Stars: ✭ 28,795 (+575800%)
Mutual labels:  zxing
Zxinggenerator
花式二维码生成,提供了6种样式
Stars: ✭ 618 (+12260%)
Mutual labels:  zxing
Android Zblibrary
🔥Android MVP 快速开发框架,做国内 「示例最全面」「注释最详细」「使用最简单」「代码最严谨」的 Android 开源 UI 框架。 🔥An Android MVP Framework with many demos, detailed documents, simple usages and strict codes.
Stars: ✭ 5,000 (+99900%)
Mutual labels:  zxing

DroidXing Build Status

Simple Android wrapper for ZXing.

Summary

DroidXing is a fork of the ZXing Android app intended for anyone, who only wants to allow users to input data in their app via a barcode (1D or 2D, including QR codes).

The flow revolves around the capture activity that gets started, provides the viewfinder UI to allow the user to scan the code and closes, handing the control back to your app.

Usage

The easiest way to import the library into your project is by grabbing the AAR from Maven Central. Alternatively, you can check out the the source and manually import it into your IDE.

depedencies {
  compile 'net.gouline.droidxing:droidxing:[email protected]'
}

Next, declare the CaptureActivity in your AndroidManifest.xml.

<activity android:name="net.gouline.droidxing.CaptureActivity" />

Now you can just start CaptureActivity for result and let it handle the scanning.

activity.startActivityForResult(new Intent(activity, CaptureActivity.class), 0);

Once the code has been scanned, you can retrieve the data from the result by overriding onActivityResult() in the activity that started the CaptureActivity.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  if (resultCode == RESULT_OK && data != null) {
    Serializable codeResult = data.getSerializableExtra(CaptureActivity.EXTRA_CODE_RESULT);
    if (codeResult != null && codeResult instanceof CaptureResult) {
      CaptureResult codeResultBlock = (CaptureResult) codeResult;
      Result rawResult = codeResultBlock.getRawResult(); // Raw scan data
      ParsedResult parsedResult = codeResultBlock.getParsedResult(); // Parsed data
    }
  }
}

Once you have the ParsedResult object, you can test for the subtype you are expecting (look at the classes in the com.google.zxing.client.result package that extend ParsedResult) and retrieve the data. Below is a URI code example.

public String getCodeURI(ParsedResult parsedResult) {
  if (parsedResult != null && parsedResult instanceof URIParsedResult) {
    return ((URIParsedResult) parsedResult).getURI();
  }
  return null;
}

Configuration

Default configuration will suffice for most users but the following advanced features can be provided:

Key Description Default Type
KEY_DECODE_1D_PRODUCT enable 1D product barcodes true boolean
KEY_DECODE_1D_INDUSTRIAL enable 1D industrial barcodes true boolean
KEY_DECODE_QR enable QR codes true boolean
KEY_DECODE_DATA_MATRIX enable decoding of data matrices true boolean
KEY_DECODE_AZTEC enable Aztec codes false boolean
KEY_DECODE_PDF417 enable decoding PDF417 codes false boolean
KEY_FRONT_LIGHT_MODE front light mode: ON, OFF or AUTO OFF FrontLightMode
KEY_AUTO_FOCUS enable auto-focus true boolean
KEY_INVERT_SCAN enable inversion of the scan false boolean
KEY_DISABLE_CONTINUOUS_FOCUS disable continuous focus true boolean
KEY_DISABLE_EXPOSURE disable exposure true boolean
KEY_DISABLE_METERING disable metering true boolean
KEY_DISABLE_BARCODE_SCENE_MODE disable barcode scene mode true boolean

To override defaults, you can set a custom properties provider.

CapturePreferences.setProvider(new Provider() {
  @Override
  public Object getValue(String key) {
    if (CapturePreferences.KEY_DECODE_QR.equals(key)) {
      return false;
    } else if (CapturePreferences.KEY_DECODE_AZTEC.equals(key)) {
      return true;
    }
    return null;
  }
});

This is a simplistic example, in the real world you can either plug in a hash map with your values or implement any other retrieval flow.

If your custom provider is not set or does not return a value for any key, configuration will fall back to the defaults. As a result, only values differing to the defaults should be supplied by the custom provider.

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].