Skip to content

UditWadhwa/PaperNotes

Repository files navigation

PaperNotes

Personal Android app that turns photos of dated, hand-written paper notes into structured digital notes, syncing every hour to a private Git repo so the same notes appear inside Obsidian on a laptop.

Source spec: ~/ObsidianVault/01-Projects/AndroidApp-PaperNotes/spec.md.

Build & run

One-time host setup

# JDK 17 (already available at /export/apps/jdk/JDK-17_0_5-msft on this machine)
source scripts/env.sh

# Android SDK command-line tools
mkdir -p ~/Android/Sdk/cmdline-tools
cd ~/Android/Sdk/cmdline-tools
curl -L -o tools.zip 'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip'
unzip tools.zip && mv cmdline-tools latest && rm tools.zip

yes | sdkmanager --licenses
sdkmanager "platforms;android-35" "build-tools;35.0.0" "platform-tools"

Fetch + convert OCR model (one-time, on the laptop)

cd ~/Code/PaperNotes
bash scripts/fetch-and-convert-model.sh
# Verifies app/src/main/assets/models/{encoder,decoder,tokenizer.json,preprocessor_config.json}

The .onnx assets are gitignored. Anyone re-cloning the repo runs the script above to regenerate them.

Build the APK

source scripts/env.sh
cd ~/Code/PaperNotes
./gradlew assembleDebug
# Output: app/build/outputs/apk/debug/app-debug.apk

Install on phone

adb over USB (recommended).

  1. On the phone: enable Developer Options (tap Build Number 7×) → enable USB Debugging.
  2. Plug phone into laptop via USB; accept the RSA fingerprint prompt on the phone.
  3. Verify connection: adb devices.
  4. Install: adb install -r app/build/outputs/apk/debug/app-debug.apk.

First-run wizard

  1. Open Settings.
  2. Confirm the pre-filled remote URL (git@github-personal:UditWadhwa/cuddly-octo-train.git) and branch.
  3. Tap Generate SSH key, then Copy public key.
  4. On GitHub → cuddly-octo-train → Settings → Deploy keys → Add → paste, Allow write access.
  5. Tap Test connection → on success, Save.
  6. The hourly SyncWorker does the rest.

Sync target vs source repo

  • Sync target (runtime, what the app pushes): cuddly-octo-train. The app only writes under notes/.
  • Source repo (this directory): hosted at github.com/UditWadhwa/papernotes. Set up automatically by the bootstrap script. See "Pushing source" below.

Repo layout

See spec §5 for the full module/package tree. Top-level:

~/Code/PaperNotes/
├── app/                         # the Android module
├── gradle/libs.versions.toml    # version catalog
├── scripts/fetch-and-convert-model.sh
└── scripts/env.sh               # source this for JAVA_HOME / ANDROID_HOME

Tests

./gradlew :app:testDebugUnitTest          # DateParser, MonthFileSerializer
./gradlew :app:connectedDebugAndroidTest  # Room round-trip, SyncWorker

Known follow-ups

  • Camera capture wiring. The TakePicture contract is launched but the file-URI flow is left as a follow-up. Capture-from-gallery works end-to-end and exercises the full OCR + parse + save path.
  • OCR speed without KV-cache. Current decoder runs greedy without a key/value cache — fine for ≤ 64-token notes; long pages will exceed the 5 s budget. Switch to a KV-cached export if it bites.
  • R2 fallback for >100 MB models. If scripts/fetch-and-convert-model.sh produces assets > 100 MB total, switch to download-on-first-launch and host them in a release of the runtime sync repo (see spec §15 R2). Document the deviation in this README.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors