# Pilot's Toolkit — Android Setup Guide (v2)

## What's New Since Last Build

- **G650 data** — ESWL formula, weight limits (52,600 / 99,600 / 100,000)
- **G700 data** — Full ACN + ACR formulas (16 total), ESWL thresholds (S-85 / D-108), weight limits
- **HF Frequencies tab** — WebView embed of ARINC Atlantic/Pacific pages with refresh, staleness timer, direct link
- **Pavement module** — Airport comparison banner, ACN/ACR labels, ESWL thresholds display
- **Crosswind module** — Wind input as xxx/xx format with auto-slash
- **Fuel module** — Split temperature warnings (red below -20°C, amber above +50°C)
- **Hamburger menu** — Dark mode toggle, About section
- **Theme** — Warning/danger colors for all banners

## Step 1: Android Manifest — Add Internet Permission

The HF module uses a WebView which requires internet access. Open `app/src/main/AndroidManifest.xml` and add this line **before** the `<application>` tag:

```xml
<uses-permission android:name="android.permission.INTERNET" />
```

## Step 2: Drop in the Source Files

Your project's Kotlin source root is:
```
app/src/main/java/com/harshmallow/pilottoolkit/
```

Replace all files with the provided ones. File layout:

```
app/src/main/java/com/harshmallow/pilottoolkit/
├── MainActivity.kt
├── data/
│   └── AircraftData.kt
└── ui/
    ├── PilotToolkitApp.kt
    ├── components/
    │   └── SharedComponents.kt
    ├── modules/
    │   ├── FuelOrderModule.kt
    │   ├── PavementModule.kt
    │   ├── CrosswindModule.kt
    │   ├── FuelBucketsModule.kt
    │   └── HFModule.kt          ← NEW
    └── theme/
        ├── Color.kt
        └── Theme.kt
```

**11 files total.** Delete any leftover `Type.kt` from the auto-generated template.

## Step 3: Build and Run

1. **Build → Rebuild Project** (Ctrl+F9)
2. Fix any import issues (most likely if a file landed in the wrong package)
3. **Run** on emulator or device

## What to Verify

- [ ] Fuel tab: enter temp below -20 → red warning; above 50 → amber warning
- [ ] Pavement tab (G450): enter weight + airport PCN → green/red comparison banner
- [ ] Pavement tab (G700): ACR/ACN values, ESWL thresholds display (no formula ESWL)
- [ ] Pavement tab (G650): ESWL formula works, ACN/ACR shows "not yet available"
- [ ] Crosswind tab: type "31015" → auto-formats to "310/15"
- [ ] Buckets tab: slider works, shows "Flight Time" label
- [ ] HF Freq tab: WebView loads ARINC page, refresh button works, staleness timer ticks
- [ ] HF Freq tab: Atlantic/Pacific toggle switches pages
- [ ] HF Freq tab: "Open ARINC Page" link opens browser
- [ ] Hamburger menu: dark mode toggle, About section
- [ ] Aircraft selector: G650 and G700 are selectable and functional

## Troubleshooting

**WebView blank/error:** Make sure `INTERNET` permission is in the manifest. Some emulators need a network connection configured.

**"Unresolved reference" errors:** Verify each file's `package` declaration matches its directory. E.g. `HFModule.kt` must be in `.../ui/modules/`.

**Gradle sync issues:** Ensure you're using the Compose "Empty Activity" template, not legacy Views.
