Features | Screenshots | Quick Start | Tech Stack | License
BharatScan is a Made in India Android document scanning app built with Jetpack Compose, CameraX, and on-device ML for segmentation and OCR. This repo includes the Android app plus supporting JVM modules for image processing and evaluation.
- Tricolor Modern UI refresh with improved visual separation and India-inspired styling.
- Background image support for Home, Documents, and Settings with tint overlays.
- OCR Search Index: search inside scanned text across documents.
- Guided walkthrough across Home → Scan → Edit → Export → Search.
- Update flow polish with GitHub Releases checks, progress UI, and formatted notes.
- Scanner and crop refinements (retake per page, manual crop fallback).
- Camera-based document capture and scanning workflow.
- Automatic document boundary detection and auto-cropping via an on-device segmentation model.
- PDF export with optional OCR text layer (ML Kit Text Recognition).
- Built-in PDF viewer with zoom and search highlights.
- PDF password handling and optional security gate via device biometrics.
- Export formats and quality controls (see settings and export screens in the app).
- External intent support for
org.bharatscan.app.action.SCAN_TO_PDFand PDFVIEW/EDITintents.
Home![]() |
Document![]() |
Camera![]() |
Export![]() |
Success![]() |
PDF Viewer![]() |
Settings![]() |
Settings Detail![]() |
- Kotlin 2.3.10 and Java 11 bytecode.
- Android Gradle Plugin 8.13.2.
- Jetpack Compose (BOM
2026.03.00). - CameraX, ML Kit Text Recognition, PDFBox-Android.
- LiteRT (TFLite runtime) for on-device segmentation.
- OpenCV (JVM bindings) in
imageprocessing.
appAndroid application module (Compose UI, CameraX, PDF, OCR, settings, export).imageprocessingJVM library with OpenCV-backed image utilities and transforms.evaluationJVM module for evaluation workflows built onimageprocessing.gradleVersion catalog and Gradle plugin configuration.metadataPlay/metadata assets (if used for releases).
- JDK 11.
- Android Studio (recommended) or command-line Gradle.
- Android SDK with API 36 installed.
- Network access during first build to download the segmentation model.
The project uses the Gradle wrapper.
# Debug build
./gradlew :app:assembleDebug
# Install to a connected device
./gradlew :app:installDebugWindows PowerShell:
.\gradlew.bat :app:assembleDebug
.\gradlew.bat :app:installDebugThe segmentation model is downloaded during preBuild.
- Task:
downloadTFLiteModelinapp/download-tflite.gradle.kts. - Model name:
fairscan-segmentation-model.tflite. - Download location:
app/build/downloads/and copied into generated assets.
If you are building offline, run once with network access or pre-seed the model file into app/build/downloads/.
minSdk: 26targetSdk: 36compileSdk: 36- ABI splits are enabled for APKs. Output names follow
BharatScan-<versionName>-<abi>.apk.
Release signing is enabled when these Gradle properties are present:
RELEASE_STORE_FILERELEASE_STORE_PASSWORDRELEASE_KEY_ALIASRELEASE_KEY_PASSWORD
Without these, the release build type will still be configured but unsigned.
The app uses:
android.permission.CAMERAandroid.permission.WRITE_EXTERNAL_STORAGE(Android 9 and below, for saving files)
MainActivity handles:
- Launcher entry point.
- Custom action:
org.bharatscan.app.action.SCAN_TO_PDF. - PDF view/edit intents for
application/pdfwithfileandcontentschemes.
Unit and instrumentation tests are configured in the app module.
./gradlew :app:test
./gradlew :app:connectedAndroidTestIssues and PRs are welcome. Please keep changes small and focused, and include test updates where appropriate. See CONTRIBUTING.md for details.
This project is licensed under the GNU General Public License, version 3 or later (GPL-3.0-or-later).









