Planungen android
All checks were successful
Deploy to production / deploy (push) Successful in 2m17s
All checks were successful
Deploy to production / deploy (push) Successful in 2m17s
This commit is contained in:
101
android/README.md
Normal file
101
android/README.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# YourPart Android
|
||||
|
||||
Android-App-Shell fuer YourPart auf Basis der bestehenden Vue/Vite-App und Capacitor.
|
||||
|
||||
## Entscheidungen
|
||||
|
||||
- App-ID: `de.yourpart.app`
|
||||
- App-Name: `YourPart`
|
||||
- Technologie: Capacitor mit lokal gebuendeltem `frontend/dist`
|
||||
- Backend: bestehendes Backend wird verwendet, keine Backend-Implementierung in diesem Android-Start
|
||||
- Erstes Ziel: interne Debug-/Test-APK
|
||||
|
||||
## Vorbereitung
|
||||
|
||||
1. Frontend-Env-Vorlage kopieren und Werte pruefen:
|
||||
|
||||
```bash
|
||||
cp ../frontend/.env.android.example ../frontend/.env.android
|
||||
```
|
||||
|
||||
2. Android-Dependencies installieren:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. Web-Bundle fuer Android bauen:
|
||||
|
||||
```bash
|
||||
npm run build:web
|
||||
```
|
||||
|
||||
4. Android-Projekt erzeugen:
|
||||
|
||||
```bash
|
||||
npm run add:android
|
||||
```
|
||||
|
||||
5. Danach synchronisieren:
|
||||
|
||||
```bash
|
||||
npm run sync
|
||||
```
|
||||
|
||||
## Debug-Build
|
||||
|
||||
Nach `npm run add:android`:
|
||||
|
||||
```bash
|
||||
npm run build:debug
|
||||
```
|
||||
|
||||
Das erzeugte APK liegt danach unter `android/app/build/outputs/apk/debug/`.
|
||||
Innerhalb dieses Repositorys ist das der Pfad `/android/android/app/build/outputs/apk/debug/`.
|
||||
|
||||
## Android Studio
|
||||
|
||||
In Android Studio muss das native Gradle-Projekt geoeffnet werden:
|
||||
|
||||
```text
|
||||
/home/torsten/Programs/YourPart3/android/android
|
||||
```
|
||||
|
||||
Nicht `/home/torsten/Programs/YourPart3/android` oeffnen. Dieser Ordner ist nur die Capacitor-Projektwurzel mit `package.json` und `capacitor.config.ts`; die Android-Studio-App liegt eine Ebene tiefer in `/android/android`.
|
||||
|
||||
Nach dem Oeffnen:
|
||||
|
||||
1. Gradle Sync abwarten.
|
||||
2. Run Configuration `YourPart Debug` auswaehlen.
|
||||
3. Emulator auswaehlen.
|
||||
4. Starten.
|
||||
|
||||
Wenn Android Studio die Konfiguration nicht sofort anzeigt, `File > Sync Project with Gradle Files` ausfuehren oder das Projektfenster neu laden.
|
||||
|
||||
## Emulator-Eingabe
|
||||
|
||||
Die App verwendet die normale Android-WebView-Eingabe. `android.captureInput` ist bewusst nicht aktiviert, weil diese Capacitor-Option die WebView-InputConnection ersetzt und im Emulator verhindern kann, dass Textfelder normal beschrieben werden.
|
||||
|
||||
## Backend-CORS fuer Android-Debug
|
||||
|
||||
Capacitor laedt die lokale Android-App standardmaessig unter:
|
||||
|
||||
```text
|
||||
https://localhost
|
||||
```
|
||||
|
||||
Die API-Requests gehen weiterhin an `https://www.your-part.de/api/...`. Deshalb muss das Backend `https://localhost` in `CORS_ORIGINS` erlauben:
|
||||
|
||||
```env
|
||||
CORS_ORIGINS=https://www.your-part.de,https://localhost,http://localhost:5173,http://127.0.0.1:5173
|
||||
```
|
||||
|
||||
`server.hostname` in `capacitor.config.ts` darf nicht auf `www.your-part.de` gesetzt werden. Sonst interpretiert Capacitor Backend- und Model-URLs wie `/api/models/...glb` als lokale App-Assets.
|
||||
|
||||
## Wichtige Hinweise
|
||||
|
||||
- `frontend/.env.android` darf echte produktive URLs enthalten, aber keine Secrets.
|
||||
- `VITE_DISABLE_3D=true` ist fuer Android-Debug absichtlich gesetzt. Das verhindert WebGL/GLB-Last auf der Login-Seite, bis CORS und 3D-Performance separat freigegeben sind.
|
||||
- OAuth ist im ersten Debug-APK nicht der Blocker; Username/Passwort-Login ist die Pflichtfunktion.
|
||||
- Push Notifications werden erst nach stabiler Shell geplant.
|
||||
- Play Store ist vorerst kein Ziel, bis Datenschutz, UGC, Moderation und Adult-Content separat geprueft sind.
|
||||
Reference in New Issue
Block a user