
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
react-native-traxi-scanner
Advanced tools
scanner barcode and qr code
npm install react-native-traxi-scanner
import { scannerButton } from 'react-native-traxi-scanner';
// ...
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
Min API Level = 21
Add the JitPack repository to your project level build.gradle
:
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
Add this to your app build.gradle
:
dependencies {
implementation 'com.github.murgupluoglu:qrreader-android:lastVersion'
}
This library using Camera permission. Please grant permission before start.
<uses-permission android:name="android.permission.CAMERA"/>
Add QRReaderFragment to your XML like any other fragment.
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:id="@+id/qrCodeReaderFragment"
android:layout_width="0dp"
android:name="com.murgupluoglu.qrreader.QRReaderFragment"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Define your fragment for access later
val qrCodeReader : QRReaderFragment by lazy {
qrCodeReaderFragment as QRReaderFragment
}
Add listener for returned qr code.
qrCodeReaderView.setListener(object : QRReaderListener{
override fun onRead(barcode: FirebaseVisionBarcode, barcodes: List<FirebaseVisionBarcode>) {
}
override fun onError(exception: Exception) {
}
})
Start camera
qrCodeReaderView.startCamera(this@MainActivity)
Set configuration and enable torch
val qrOptions: BarcodeScannerOptions = BarcodeScannerOptions.Builder()
.setBarcodeFormats(
Barcode.FORMAT_QR_CODE,
Barcode.FORMAT_AZTEC)
.build()
val config = QRCameraConfiguration(lensFacing = CameraSelector.LENS_FACING_FRONT, options = qrOptions)
qrCodeReaderView.startCamera(this@MainActivity, config)
qrCodeReaderView.enableTorch(true)
If you have CameraX setup in your code. You can use only QRAnalyzer class.
imageAnalyzer.setAnalyzer(mainExecutor, QRAnalyzer(rotation, config.options).apply {
onFrameAnalyzed { qrStatus, barcode, barcodes, exeption ->
})
FAQs
scanner barcode and qr code
The npm package react-native-traxi-scanner receives a total of 0 weekly downloads. As such, react-native-traxi-scanner popularity was classified as not popular.
We found that react-native-traxi-scanner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.