This project uses CameraX library and PreviewView to show camera output to screen, and uses ML Kit for scanning barcodes and doing OCR. For extra explanation in Turkish, see my Medium story here.
https://medium.com/@skaanozkaya/java-ile-camerax-ml-kit-barkod-okuma-ocr-6e30a4bb7dac