This library is not maintained anymore.
Use CameraX Preview instead of this library.
CameraX View + CameraX Analyzer
Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
Then, add the library to your module build.gradle
dependencies {
implementation 'com.github.fornewid:CameraView:1.0.0-alpha10'
}
- All features in AndroidX Camera-View.
- And image analysis.
There is a sample provided which shows how to use the library in a simple way:
<androidx.camera.view.CameraView
android:id="@+id/cameraView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:captureMode="image" />
val cameraView: CameraView = findViewById(R.id.cameraView)
photoView.setImageResource(R.drawable.image);
cameraView.bindToLifecycle(this)
cameraView.setAnalyzer { proxy ->
...
}