This project is a QR Code Scanner application built using Jetpack Compose and Google's ML Kit. The app utilizes CameraX to access the device's camera, scan QR codes, and display the decoded information on the screen.
- Real-time QR Code Scanning: Uses CameraX and ML Kit for efficient scanning of QR codes.
- Jetpack Compose UI: Modern UI with Compose, offering a smooth and responsive user experience.
- Permission Handling: Uses Accompanist for handling runtime permissions gracefully.
- Display Results: Shows decoded QR code data in a user-friendly format.
Here are some screenshots of the application in action:
Scanning QR Code | Displaying QR Data |
---|---|
The project follows a straightforward architecture using Jetpack Compose and CameraX:
- MainActivity: The main entry point, handling camera initialization and managing the UI.
- Composable Functions: Individual composable functions are used to build the UI, such as
CameraPreview
,QRCodeResult
, andCameraPermission
. - QRCodeAnalyzer: This class processes each camera frame to detect and decode QR codes using ML Kit.
- State Management: Uses Compose's
remember
andmutableStateOf
for managing UI state and QR code results.
- Jetpack Compose: For building the UI in a declarative manner.
- CameraX: To access and control the camera.
- ML Kit: For barcode scanning and QR code detection.
- Accompanist: For managing permissions in Compose.
- Kotlin: The programming language used for building the application.
-
Clone the Repository:
git clone https://github.com/shafaque/ComposeScanner.git cd ComposeScanner
This project is licensed under the MIT License - see the LICENSE file for details.