# ScopeDOPE — Android

Precision rifle ballistics app for Android — calculate firing solutions, print DOPE labels, and manage range data entirely offline.

**See [shared/SPEC.md](shared/SPEC.md) for the full product specification**, including architecture, feature requirements, data formats, and device integration details. The spec governs all platform implementations and is maintained in [`scopedope-shared`](https://github.com/ColdBoreBallistics/scopedope-shared).

## Requirements

- Android 12+ (API 31)
- Android Studio Meerkat (2024.3) or later
- JDK 17

## Getting Started

This repository uses a git submodule for shared assets (spec + ammo database). Clone with:

```bash
git clone --recurse-submodules git@github.com:ColdBoreBallistics/scopedope-android.git
```

Or if already cloned:

```bash
git submodule update --init
```

## Project Structure

```
shared/                              ← submodule: scopedope-shared
├── SPEC.md                          Product specification (all platforms)
└── assets/databases/
    └── ammo_builtin.db              Built-in ammunition database (read-only)

ballistics/                          ← :ballistics KMP module (shared engine)
└── src/
    ├── commonMain/kotlin/           ← Shared engine code (Android + iOS)
    │   └── com/coldboreballisticsllc/scopedope/ballistics/
    │       ├── BallisticsEngine.kt  Trajectory solver, atmospheric model, corrections
    │       ├── BiasInterpolation.kt DOPE-blend spline (entryBias, applyBias — internal)
    │       └── DragModels.kt        G7_CD / G1_CD tables; CdCurve interpolator
    └── jvmTest/kotlin/              ← JVM validation suite (:shared:ballistics:jvmTest — canonical engine validation)
        └── com/coldboreballisticsllc/scopedope/ballistics/
            └── BallisticsValidationTest.kt

app/src/main/java/com/coldboreballisticsllc/scopedope/
├── data/
│   ├── ammo/            Built-in (asset) and user (Room) ammo databases
│   ├── printer/         Printer BLE drivers (Niimbot B1, B21 Pro)
│   ├── sensor/
│   │   ├── btmeter/     BTMETER BT-100APP BLE driver
│   │   └── weatherflow/ WeatherFlow Tactical BLE driver
│   └── session/         .dope file serialization
├── di/                  Hilt dependency injection modules
├── domain/
│   ├── label/           LabelFormat sealed class + LabelRenderer interface
│   ├── model/           Shared data classes
│   ├── printer/         PrinterSource interface
│   ├── repository/      Repository interfaces
│   ├── sensor/          WeatherSensorSource interface; SensorRouter
│   └── usecase/         Business logic use cases
├── label/
│   ├── format/          LabelFormat definitions (19 formats)
│   └── renderer/        LabelRenderer implementations per format
└── ui/
    ├── ammo/            Ammo picker screen
    ├── conditions/      Environmental conditions + sensor screen
    ├── dope/            DOPE entry screen
    ├── navigation/      NavGraph
    ├── print/           Print + PNG export screen
    ├── results/         Calculation results + label selection screen
    ├── settings/        Basic Settings screen
    ├── advancedsettings/ Advanced Settings screen
    └── theme/           Color, typography, theme
```

## Running Engine Validation

The ballistics engine has an exhaustive validation test suite:

```bash
./gradlew :shared:ballistics:jvmTest    # Engine validation (canonical JVM suite)
```

See `shared/BALLISTICS_TEST_HANDOFF.md` for the test dataset documentation and methodology.

## License

© 2026 Cold Bore Ballistics LLC. Proprietary and Confidential. All rights reserved. Unauthorized reproduction, distribution, or disclosure of this material is strictly prohibited without the express written consent of Cold Bore Ballistics LLC.
