Files included in the program: AndroidManifest.xml <uses-feature android :name ="android.hardware.camera.any" /> <uses-permission android :name ="android.permission.CAMERA" /> build.gradle (Module :app) def camerax_version = "1.2.2" implementation "androidx.camera:camera-core: $ { camerax_version } " implementation "androidx.camera:camera-camera2: $ { camerax_version } " implementation "androidx.camera:camera-lifecycle: $ { camerax_version } " implementation "androidx.camera:camera-video: $ { camerax_version } " implementation "androidx.camera:camera-view: $ { camerax_version } " implementation "androidx.camera:camera-extensions: $ { camerax_version } " implementation 'com.google.mlkit:barcode-scanning:17.2.0' implementation 'com.intuit.sdp:sdp-android:1.0.6' implementation 'com.intuit.ssp:ssp-android:1.0.6' implementation 'androidx.camera:camera-mlkit-visi
MainActivity.java package com.simpy.preview; import android.Manifest; import android.content.pm.PackageManager; import android.os.Bundle; import android.widget.Toast; import androidx.activity.EdgeToEdge; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.camera.core.Camera; import androidx.camera.core.CameraSelector; import androidx.camera.core.Preview; import androidx.camera.lifecycle.ProcessCameraProvider; import androidx.camera.view.LifecycleCameraController; import androidx.camera.view.PreviewView; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; import androidx.lifecycle.LifecycleOwner; import com.google.common.util.concurrent.ListenableFuture; import com.google.mlkit.vision.barcode.BarcodeScanner; import java.util.concurrent.ExecutionException; import java.util.concurrent.Ex