first release 0.0.0.2
This commit is contained in:
@@ -0,0 +1,192 @@
|
||||
# ARIA Cockpit — Android App
|
||||
|
||||
Stefans primäre Schnittstelle zu ARIA. Gebaut mit React Native + TypeScript.
|
||||
|
||||
---
|
||||
|
||||
## Schnellstart
|
||||
|
||||
```bash
|
||||
# 1. Abhängigkeiten installieren (einmalig)
|
||||
./setup.sh
|
||||
|
||||
# 2. Release-APK bauen (standalone, kein Dev-Server nötig)
|
||||
./build.sh
|
||||
|
||||
# 3. APK aufs Handy kopieren und installieren
|
||||
adb install ARIA-Cockpit-release.apk
|
||||
```
|
||||
|
||||
Fertig. APK liegt als `ARIA-Cockpit-release.apk` im Verzeichnis.
|
||||
|
||||
---
|
||||
|
||||
## Debug vs Release — was ist der Unterschied?
|
||||
|
||||
| | Debug | Release |
|
||||
|---|---|---|
|
||||
| **JS-Bundle** | Wird von Metro Dev-Server geladen (localhost:8081) | In die APK eingebaut — läuft standalone |
|
||||
| **Verwendung** | Entwicklung am PC mit Hot-Reload | Installation aufs Handy |
|
||||
| **Dev-Server nötig?** | Ja — `npx react-native start` muss laufen | Nein — App startet sofort |
|
||||
| **Größe** | Kleiner (Code wird live geladen) | Größer (alles eingebaut) |
|
||||
|
||||
**Für aufs Handy installieren immer Release bauen:**
|
||||
```bash
|
||||
./build.sh release # oder einfach: ./build.sh
|
||||
```
|
||||
|
||||
**Debug nur zum Entwickeln am PC:**
|
||||
```bash
|
||||
# Terminal 1: Metro Dev-Server starten
|
||||
npx react-native start
|
||||
|
||||
# Terminal 2: Debug-APK bauen und auf verbundenes Gerät/Emulator deployen
|
||||
./build.sh debug
|
||||
```
|
||||
|
||||
> Wenn du eine Debug-APK aufs Handy kopierst ohne Metro-Server, siehst du den roten
|
||||
> "Could not connect to development server" Fehler. Das ist normal — Debug braucht den Server.
|
||||
|
||||
---
|
||||
|
||||
## Scripts
|
||||
|
||||
### `setup.sh` — Entwicklungsumgebung einrichten
|
||||
|
||||
Installiert automatisch alles was zum Bauen nötig ist:
|
||||
|
||||
| Was | Version | Details |
|
||||
|-----|---------|---------|
|
||||
| **Basis-Tools** | — | curl, unzip, git |
|
||||
| **Node.js** | >= 18 | Via NodeSource (falls nicht vorhanden) |
|
||||
| **JDK** | 17 (vollständig) | OpenJDK mit jlink (nicht nur JRE!) |
|
||||
| **Android SDK** | API 34 | Command Line Tools + Build Tools + Platform Tools |
|
||||
| **Metro-Config** | — | metro.config.js, babel.config.js, .watchmanconfig (falls fehlend) |
|
||||
| **Node Packages** | — | Räumt alte node_modules auf + `npm install` |
|
||||
| **Natives Android-Projekt** | — | React Native Gradle-Projekt generieren |
|
||||
| **Gradle Config** | — | compileSdk-Warning unterdrücken, Build-Cache aufräumen |
|
||||
|
||||
Das Script erkennt automatisch dein OS (Debian, Fedora, Arch, macOS) und benutzt den passenden Paketmanager.
|
||||
|
||||
**ANDROID_HOME** wird automatisch gesetzt und in dein Shell-Profil (`.bashrc`/`.zshrc`) eingetragen.
|
||||
|
||||
**JDK-Hinweis:** React Native 0.73 + Android Gradle Plugin 8.1 braucht exakt JDK 17 — nicht 21 oder neuer. Falls du JDK 21 als Standard hast, ist das kein Problem: `build.sh` setzt `JAVA_HOME` automatisch auf JDK 17 (wenn installiert).
|
||||
|
||||
```bash
|
||||
./setup.sh
|
||||
```
|
||||
|
||||
> Nach dem Setup einmalig Shell neu starten oder `source ~/.bashrc` ausführen.
|
||||
|
||||
### `build.sh` — APK bauen
|
||||
|
||||
Baut die Android APK in einem Schritt:
|
||||
|
||||
```bash
|
||||
./build.sh # Release-APK (Standard) — fürs Handy
|
||||
./build.sh release # Release-APK (explizit)
|
||||
./build.sh debug # Debug-APK (nur mit Metro Dev-Server)
|
||||
```
|
||||
|
||||
**Was das Script macht:**
|
||||
1. Prüft ob Node, npm, Java vorhanden sind (sonst Fehler mit Hinweis auf `setup.sh`)
|
||||
2. Erkennt automatisch JDK 21 und wechselt auf JDK 17 (inkl. jlink-Prüfung)
|
||||
3. Sucht automatisch nach dem Android SDK (typische Pfade)
|
||||
4. Prüft ob das native Android-Projekt existiert (sonst Hinweis auf `setup.sh`)
|
||||
5. Installiert/updated Node Dependencies falls nötig
|
||||
6. Baut die APK via Gradle
|
||||
7. Kopiert die fertige APK als `ARIA-Cockpit-<modus>.apk` ins Hauptverzeichnis
|
||||
|
||||
**Ausgabe-Dateien:**
|
||||
- `ARIA-Cockpit-release.apk` — fertige APK (Hauptverzeichnis)
|
||||
- `android/app/build/outputs/apk/release/app-release.apk` — Original-Pfad
|
||||
|
||||
---
|
||||
|
||||
## Auf dem Handy installieren
|
||||
|
||||
```bash
|
||||
# Via ADB (USB-Kabel oder WiFi)
|
||||
adb install ARIA-Cockpit-release.apk
|
||||
|
||||
# Oder: APK aufs Handy kopieren und dort öffnen
|
||||
# Oder: Via Gitea Release herunterladen (siehe release.sh im Root)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Erstverbindung (Pairing)
|
||||
|
||||
1. App starten
|
||||
2. Tab **Einstellungen** öffnen
|
||||
3. QR-Code scannen (vom RVS generiert) oder Token manuell eingeben
|
||||
4. Verbindungsstatus prüfen (grüner Punkt = verbunden)
|
||||
|
||||
Der QR-Code enthält alles was die App braucht:
|
||||
```json
|
||||
{
|
||||
"host": "rvs.hackersoft.de",
|
||||
"port": 443,
|
||||
"token": "a3f8b2c9d1e4..."
|
||||
}
|
||||
```
|
||||
|
||||
Einmal scannen, nie wieder manuell tippen.
|
||||
|
||||
---
|
||||
|
||||
## Projektstruktur
|
||||
|
||||
```
|
||||
android/
|
||||
├── setup.sh ← Dev-Umgebung einrichten (einmalig)
|
||||
├── build.sh ← APK bauen
|
||||
├── index.js ← React Native Entry Point
|
||||
├── app.json ← App-Name Konfiguration
|
||||
├── App.tsx ← Haupt-Komponente, Navigation
|
||||
├── package.json ← Dependencies
|
||||
├── tsconfig.json ← TypeScript Config
|
||||
├── metro.config.js ← Metro Bundler Config
|
||||
├── babel.config.js ← Babel Transpiler Config
|
||||
├── .watchmanconfig ← Watchman Config
|
||||
│
|
||||
├── src/
|
||||
│ ├── services/
|
||||
│ │ ├── rvs.ts ← WebSocket-Verbindung zum Rendezvous Server
|
||||
│ │ └── audio.ts ← Mikrofon-Aufnahme und TTS-Wiedergabe
|
||||
│ │
|
||||
│ ├── screens/
|
||||
│ │ ├── ChatScreen.tsx ← Hauptchat mit ARIA
|
||||
│ │ └── SettingsScreen.tsx ← Verbindung, Modus, Logs
|
||||
│ │
|
||||
│ └── components/
|
||||
│ ├── VoiceButton.tsx ← Push-to-Talk Button
|
||||
│ ├── ModeSelector.tsx ← Betriebsmodus-Auswahl
|
||||
│ ├── FileUpload.tsx ← Datei-Versand
|
||||
│ └── CameraUpload.tsx ← Foto-Aufnahme / Galerie
|
||||
│
|
||||
└── android/ ← Generiertes Gradle-Projekt (nach setup)
|
||||
├── gradlew ← Gradle Wrapper
|
||||
├── gradle.properties ← Gradle Config (compileSdk etc.)
|
||||
└── app/build.gradle ← App Build Config
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Fehlerbehebung
|
||||
|
||||
| Problem | Lösung |
|
||||
|---------|--------|
|
||||
| **"Could not connect to development server"** | Das ist eine Debug-APK. Für standalone: `./build.sh release` |
|
||||
| `ANDROID_HOME nicht gesetzt` | `./setup.sh` ausführen, Shell neu starten |
|
||||
| `gradlew: Permission denied` | `chmod +x android/gradlew` |
|
||||
| `SDK not found` | `./setup.sh` — installiert Android SDK automatisch |
|
||||
| `JDK nicht gefunden` | `./setup.sh` — installiert OpenJDK 17 |
|
||||
| `jlink does not exist` | Nur JRE installiert, nicht voller JDK: `sudo apt install openjdk-17-jdk` |
|
||||
| `JdkImageTransform` Fehler | JDK 21 aktiv, aber JDK 17 nötig — `build.sh` löst das automatisch |
|
||||
| `BaseReactPackage` Fehler | `react-native-screens` Version zu neu — auf 3.27.0 pinnen |
|
||||
| `react-native-camera` Flavor-Fehler | Paket entfernt (deprecated), wird nicht gebraucht |
|
||||
| `EMFILE: too many open files` | `build.sh` setzt `CI=true` automatisch — Metro startet keinen File-Watcher |
|
||||
| `No Metro config found` | `./setup.sh` erstellt metro.config.js, babel.config.js, .watchmanconfig automatisch |
|
||||
| Build hängt bei `assembleRelease` | Signing Config prüfen (siehe React Native Docs) |
|
||||
| `node_modules` Probleme | `./setup.sh` — räumt alles auf und installiert frisch |
|
||||
Reference in New Issue
Block a user