可以看到,这个项目除了扫码功能,还有其他各种各样的好用且免费的SDK,像是文字识别,人脸识别等等,都可以依赖这个项目轻松搞定。无奈小弟才疏学浅,只接触了该项目的扫码功能,等来日水平提升了,定将其他的功能也一一体验一遍
对了,这个项目除了Android端,还有IOS端的哦,感兴趣的IOS小伙伴可以自行参考
要使用这个项目,必不可少的,需要先引入工程
dependencies {
// …
// Use this dependency to bundle the model with your app
implementation ‘com.google.mlkit:barcode-scanning:16.1.1’
}
有google play条件的小伙伴,还可以选择添加google play的相关引用,甚至可以使用google play model
dependencies {
// …
// Use this dependency to use the dynamically downloaded model in Google Play Services
implementation ‘com.google.android.gms:play-services-mlkit-barcode-scanning:16.1.4’
}
<application …>
…
CameraX的支持当然也要一并加上
// 版本号
def camerax_version = “1.0.0-rc03”
// 对camera 及 camera2的支持,可自行选择
implementation “androidx.camera:camera-core: c a m e r a x v e r s i o n " i m p l e m e n t a t i o n " a n d r o i d x . c a m e