Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prongbang/scannerview
Simple QR & Barcode scanning library for Android
https://github.com/prongbang/scannerview
android barcode barcode-scanner qrcode qrcode-scanner
Last synced: 14 days ago
JSON representation
Simple QR & Barcode scanning library for Android
- Host: GitHub
- URL: https://github.com/prongbang/scannerview
- Owner: prongbang
- License: mit
- Created: 2020-10-06T14:30:37.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-19T13:36:42.000Z (about 4 years ago)
- Last Synced: 2024-10-24T08:07:51.885Z (2 months ago)
- Topics: android, barcode, barcode-scanner, qrcode, qrcode-scanner
- Language: Kotlin
- Homepage:
- Size: 144 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple ZXing Scanner View
Simple QR & Barcode scanning library for Android, based on the [ZXing](https://github.com/zxing/zxing/), [ZXing Android Embedded](https://github.com/journeyapps/zxing-android-embedded), [Barcode Scanner](https://github.com/dm77/barcodescanner) for decoding.
## Installation
- Add the following repositories to your `project/build.gradle` file.
```groovy
repositories {
maven { url 'https://jitpack.io' }
}
```- Add the following dependency to your `project/app/build.gradle` file.
```groovy
dependencies {
implementation 'com.github.prongbang:scannerview:1.1.0'
}
```## Usage
- Add camera permission to your AndroidManifest.xml file:
```xml
```
- Add ScannerView to xxx_layout.xml file:
```xml
```
- Add on Activity file:
```kotlin
private fun startScanner() {
scannerView?.apply {
addObserver(this)
onResultListener {
Toast.makeText(this, it, Toast.LENGTH_SHORT).show()
}
}
}private fun restartScanner() {
scannerView?.resumeScannerView()
}
```