JAGADISWAR / LEARNINGS / PAKKAKHATA
MOBILE / COMMERCE

What I learned
building PakkaKhata.

Hackathon prototypeKotlinJetpack ComposeRoomML Kit

A phone-first, offline-first ledger concept for small shopkeepers, connecting voice credit, payment evidence, OCR and intelligent reconciliation.

LEARNINGS / PAKKAKHATAHACKATHON PROTOTYPEAMBATI JAGADISWAR REDDY
01 / OVERVIEW & STATUS

What it is, and where it stands.

PakkaKhata is an Android app for shopkeepers who sell on credit (udhaar). A credit can be entered by voice or by hand. When the customer pays later, the shopkeeper photographs the UPI payment, on-device OCR reads it, and a local reconciliation engine decides which open credit it belongs to.

The outcome is shown as fully settled, partially settled, overpaid or no match. The core workflow needs no backend and no external AI API at runtime. It was built for the iQOO Hackathon 2026 (Hyderabad City Battle).

Status
Hackathon prototype with the core workflow built
Platform
Android, minSdk 24, targetSdk 36
UI
Kotlin and Jetpack Compose (Material 3), Navigation Compose
Storage
Room database, fully on-device
Perception
CameraX, ML Kit text recognition (bundled model), Android SpeechRecognizer
Tests in repo
Unit tests for the parsers, reconciliation engine and database integration
02 / WHAT I LEARNED

Lessons from the build.

This project taught me that a finance feature has to be predictable and explainable first, and clever second.

LESSON / 01

Money is an integer

Amounts are stored as a Money value class holding integer paise, so balances and settlements never suffer floating-point rounding.

LESSON / 02

Explainable beats clever

Matching is a hand-written weighted score (name similarity 0.65, amount fit 0.30, timing 0.05) with an identity guardrail, so a payment cannot be strongly matched on amount alone. The review screen shows the reasons behind a match.

LESSON / 03

Safe by default

Ambiguous evidence should never silently settle against the wrong customer. Matches are tiered into auto match, suggested match and no match, with a confirmation step before the ledger changes.

LESSON / 04

Writes must be atomic

Settling a payment updates the evidence, the obligation’s remaining amount and status, the reconciliation record and the customer’s balance inside one Room transaction, so a failure cannot leave the ledger half-updated.

TECHNICAL CONCEPTS

Offline-first architecture

Room is the source of truth and the core flow has no network dependency.

On-device OCR and parsing

ML Kit reads the screenshot, then a parser extracts amount, payer, UPI ID, UTR, date and payment app, tolerating OCR noise.

Fuzzy name matching

Name normalization and fuzzy matching bridge the gap between the name on the credit and the payer name on the payment.

Duplicate detection

Payment evidence is checked for duplicates before reconciliation, to reduce the risk of the same payment being applied twice.

Provider abstractions

SpeechProvider and OCRProvider interfaces keep platform APIs out of the core business logic.

Layered structure

Code is separated into data, domain and presentation, with ViewModels driving Compose screens.

03 / CHALLENGES & DECISIONS

Challenges and engineering decisions.

Where the build pushed back, and what I decided to do about it.

Identity

The same person appears under different names

CHALLENGEA credit may say “Ramesh” while the UPI payer name is something else.

DECISIONNormalize and fuzzy-match names, weight identity most heavily, and use a guardrail so a good amount match cannot rescue a weak identity match.

Settlement

Partial payments and overpayments

CHALLENGEReal payments rarely equal the credit exactly.

DECISIONA settlement calculator produces fully settled, partially settled or overpaid results and updates the remaining balance.

Input quality

Noisy OCR from payment screenshots

CHALLENGELayouts differ between UPI apps and OCR text can be messy.

DECISIONThe parser is built around common Indian payment formats, and a review step lets the shopkeeper confirm before anything is saved.

Voice

Speech recognition is not reliably offline

CHALLENGEAndroid’s recognizer prefers offline mode, but availability depends on the device and installed language packs.

DECISIONManual entry is always available as a fallback, and the limitation is stated openly in the README.

04 / POTENTIAL IMPROVEMENTS

What I would improve next.

Ideas grounded in what the current code and documentation say is missing.

From prototype
to something sturdier.

  • Allow one payment to be split across several outstanding credits. Today one piece of evidence resolves to one obligation.
  • Improve multilingual voice input, including Telugu, Hindi and mixed-language speech.
  • Add encrypted backup and restore, and secure device-to-device sync that keeps the local-first model.
  • Support more UPI apps, bank formats and layouts in the payment parser.
  • Strengthen duplicate detection when no explicit reference exists, keeping the deterministic engine as a safety layer around any future model.

The code is the artifact.
The learning is the leverage.

Concise notes on PakkaKhata, written to make the decisions behind it easy to discuss in a review, interview or collaboration.