2 Star 1 Fork 0

HongboZhao / IDScanner

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

ID卡读卡器

使用说明

####### 启用扫描

  IdScanHelper.ins?.start(this)

####### 关闭扫描

IdScanHelper.ins?.close()

####### 注册广播

var filter = IntentFilter(SCAN_FILTER)
registerReceiver(idReceiver, filter)
//注销广播
unregisterReceiver(idReceiver)
//广播接收
private val idReceiver by lazy { IDReceiver() }
private inner class IDReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        if (intent?.action == SCAN_FILTER) {
            var value = intent.getSerializableExtra(KEY_ID_SCAN_INFO)
            binding.tvInfo.text = Gson().toJson(value)
        }
    }
}

Comments ( 0 )

Sign in for post a comment

About

优博讯设备扫描身份证 spread retract
Cancel

Releases (9)

All

Contributors

All

Activities

load more
can not load any more
Kotlin
1
https://gitee.com/zhzephi/idscanner.git
git@gitee.com:zhzephi/idscanner.git
zhzephi
idscanner
IDScanner
master

Search