Code Monkey home page Code Monkey logo

qrcodezxingzbar's Introduction

推荐使用

CameraX-MLKit

谷歌官方库, 使用CameraXML Kit工具包实现的, 支持二维码/条形码单扫/多扫功能, 速度也是非常快.

ML Kit

QrCodeZxingZbar

使用Zxing Zbar 结合 扫描, 默认1s切换一次ZxingZbar.

  • 具有Zxing所有特性
  • 具有Zbar所有特性
  • 支持生成二维码
  • 支持从图片扫码, 三层方法识别.
  • api 16+
  • zxing 3.3.3, 3.4需要api 24+

zxingzbar 的区别 总结一下:

  • zbar 快, 支持的格式少.
  • zxing 慢, 支持的格式多.

使用方法

启动扫码

ScanActivity.start(this)

获取扫码结果

ScanActivity.onResult(requestCode, resultCode, data)

创建二维码

RCode.syncEncodeQRCode("内容", 500)

扫描图片

RCode.scanPicture(bitmap)

定制界面

继承ScanFragment, 重写getLayoutId方法

class AppScanFragment : ScanFragment() {
    override fun getLayoutId(): Int {
        return R.layout.fragment_app_scan
    }
}

xml文件中,包含qr_code_scan_layout即可,其他元素可自行添加.

<include layout="@layout/qr_code_scan_layout" />

启动自定义界面

ScanActivity.start(this, AppScanFragment::class.java)

依赖

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}
    
dependencies {
    implementation 'com.github.angcyo:QrCodeZxingZbar:1.0.2'
}

感谢

https://github.com/XieZhiFa/ZxingZbar

混淆

库中已经自带了混淆规则, 手动添加如下:

-keep class net.sourceforge.zbar.**{*;}
-keep class com.google.zxing.client.android.**{*;}

下载体验

扫码安装


群内有各(pian)种(ni)各(jin)样(qun)的大佬,等你来撩.

联系作者

点此QQ对话 该死的空格 点此快速加群

qrcodezxingzbar's People

Contributors

angcyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ewsq make1122

qrcodezxingzbar's Issues

识别界面二维码拉伸

识别速度很快,真的很不错,但是有个小缺点就是扫描预览二维码的时候有点拉伸,正方形的二维码看起来变长方形了。。。。。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.