qr-scanner

A library of broom tools, custom camera sweep codes and PDA laser scanning,support for QR codes and barcodes.

License

License

GroupId

GroupId

io.github.hpuhsp
ArtifactId

ArtifactId

qr-scanner
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

qr-scanner
A library of broom tools, custom camera sweep codes and PDA laser scanning,support for QR codes and barcodes.
Project URL

Project URL

https://github.com/hpuhsp/QRScanner
Source Code Management

Source Code Management

https://github.com/hpuhsp/QRScanner/tree/master

Download qr-scanner

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.hpuhsp/qr-scanner/ -->
<dependency>
    <groupId>io.github.hpuhsp</groupId>
    <artifactId>qr-scanner</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.github.hpuhsp/qr-scanner/
implementation 'io.github.hpuhsp:qr-scanner:1.0.0'
// https://jarcasting.com/artifacts/io.github.hpuhsp/qr-scanner/
implementation ("io.github.hpuhsp:qr-scanner:1.0.0")
'io.github.hpuhsp:qr-scanner:aar:1.0.0'
<dependency org="io.github.hpuhsp" name="qr-scanner" rev="1.0.0">
  <artifact name="qr-scanner" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.github.hpuhsp', module='qr-scanner', version='1.0.0')
)
libraryDependencies += "io.github.hpuhsp" % "qr-scanner" % "1.0.0"
[io.github.hpuhsp/qr-scanner "1.0.0"]

Dependencies

compile (9)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-android-extensions-runtime jar 1.4.10
androidx.core » core-ktx jar 1.3.1
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.10
androidx.lifecycle » lifecycle-extensions jar 2.2.0
androidx.lifecycle » lifecycle-runtime-ktx jar 2.2.0
androidx.appcompat » appcompat jar 1.2.0
androidx.constraintlayout » constraintlayout jar 2.0.4
» unspecified jar
com.google.zxing : core jar 3.2.1

Project Modules

There are no modules declared in this project.

QRScanner 安卓扫码工具库(支持二维码、条形码)

A library of broom tools, custom camera sweep codes and PDA laser scanning,support for QR codes and barcodes.

  • 手电筒模式开关并实现自动对焦。
  • 附带扫码音效。
  • 自定义扫码UI,可进行二次定制开发。
  • 结合zxing和zbar,扫码成功率高。

Version

    repositories {
        ...
        jcenter() // 或者 maven {url 'https://dl.bintray.com/517091/maven'}
        ...
    }
implementation 'com.shuanghui.mobile:scanner:1.2.0'

Usage

  • Step1:开启扫码
 if (EasyPermissions.hasPermissions(this, *CAMERA_PERMISSIONS)) {
            CaptureActivity.start(this@MainActivity, SCAN_REQUEST_CODE)
        } else {
            EasyPermissions.requestPermissions(
                    this,
                    "应用需要访问相机权限!",
                    SCAN_REQUEST_CODE,
                    *CAMERA_PERMISSIONS
            )
        }
  • Step2:结果处理
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == SCAN_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
        val barCode = data?.getStringExtra(Constants.SCAN_BAR_CODE_RESULT)
        if (barCode.isNullOrEmpty()) {
            Toast.makeText(this@MainActivity, "扫描结果为空~", Toast.LENGTH_SHORT).show()
        } else {
            tv_result.text = barCode
        }
    }
}

Versions

Version
1.0.0