feat: add MeasurementDetailScreen, 365-day charts, and edit support
- New MeasurementDetailScreen with wijzigen/verwijderen - WeightChart now supports 30 and 365 days - NewMeasurementScreen now handles both create and edit - Updated README to match current code - Add build-toolchain documentation - Ignore *.apk build artifacts
This commit is contained in:
parent
c499f7df13
commit
ed714af8d1
15 changed files with 730 additions and 130 deletions
106
docs/build-toolchain.md
Normal file
106
docs/build-toolchain.md
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
# Lokale APK build toolchain
|
||||
|
||||
## Overzicht
|
||||
|
||||
De Weegschaal app kan lokaal gebouwd worden tot een zelfstandige APK
|
||||
zonder EAS cloud. Dit is handig voor snelle iteraties of als je geen
|
||||
internetverbinding hebt voor de cloud build.
|
||||
|
||||
## Benodigdheden
|
||||
|
||||
| Component | Versie | Installatie |
|
||||
|---|---|---|
|
||||
| Java | OpenJDK 21+ | `brew install --cask temurin` |
|
||||
| Android Command Line Tools | laatste | `brew install --cask android-commandlinetools` |
|
||||
| Android Platform Tools | laatste | `brew install --cask android-platform-tools` |
|
||||
| Node.js | 22+ | `brew install node` |
|
||||
| EAS CLI | laatste | via npm (`npx eas`) |
|
||||
|
||||
## Android SDK instellen
|
||||
|
||||
`ANDROID_HOME` moet gezet zijn in je shell config (`~/.zshrc`):
|
||||
|
||||
```bash
|
||||
export ANDROID_HOME="/home/linuxbrew/.linuxbrew/share/android-commandlinetools"
|
||||
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
|
||||
```
|
||||
|
||||
Licenties accepteren:
|
||||
|
||||
```bash
|
||||
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_HOME --licenses
|
||||
```
|
||||
|
||||
Best practices:
|
||||
- Gebruik `--sdk_root=$ANDROID_HOME` bij sdkmanager commando's, anders
|
||||
installeert hij naar de verkeerde plek
|
||||
- De eerste build downloadt automatisch de juiste platform-, build-tools-,
|
||||
NDK- en CMake-versies. Je hoeft ze niet handmatig voor te installeren.
|
||||
- Wil je ze toch vastzetten: `sdkmanager "platforms;android-36" "build-tools;36.0.0"`
|
||||
|
||||
## APK bouwen
|
||||
|
||||
```bash
|
||||
cd /home/eddy/bin/weegschaal-app
|
||||
npx eas build --local --profile apk --platform android
|
||||
```
|
||||
|
||||
Het build profiel staat in `eas.json`:
|
||||
|
||||
```json
|
||||
"apk": {
|
||||
"android": {
|
||||
"buildType": "apk"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
De build:
|
||||
1. Draait `npx expo prebuild` (maakt `android/` directory aan)
|
||||
2. Bundelt de JS bundle via Metro
|
||||
3. Voert `./gradlew :app:assembleRelease` uit
|
||||
4. Produceert `android/app/build/outputs/apk/release/app-release.apk`
|
||||
5. Kopieert het resultaat naar `build-<timestamp>.apk` in de projectroot
|
||||
|
||||
## Duur
|
||||
|
||||
- **Eerste build**: ~13 minuten (Gradle download, NDK/CMake compilatie)
|
||||
- **Latere builds**: ~2-3 minuten (Gradle daemon werkt door)
|
||||
|
||||
## Veelvoorkomende problemen
|
||||
|
||||
**`ANDROID_HOME` niet gezet**
|
||||
```
|
||||
Error: ANDROID_HOME is not set
|
||||
```
|
||||
→ Controleer of de export in `~/.zshrc` staat en herlaad met `source ~/.zshrc`
|
||||
|
||||
**Gradle fault / OutOfMemoryError**
|
||||
```
|
||||
The daemon will expire after running out of JVM Metaspace
|
||||
```
|
||||
→ Zet in `android/gradle.properties`:
|
||||
```
|
||||
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
|
||||
```
|
||||
|
||||
**Licenties niet geaccepteerd**
|
||||
→ Voer `yes | sdkmanager --licenses` uit
|
||||
|
||||
## Testen
|
||||
|
||||
Voor het bouwen kun je de tests draaien:
|
||||
|
||||
```bash
|
||||
cd /home/eddy/bin/weegschaal-app
|
||||
npm test
|
||||
```
|
||||
|
||||
## Installatie op Android
|
||||
|
||||
```bash
|
||||
# Via ADB (als je toestel aan de USB hangt met debugging aan)
|
||||
adb install -r weegschaal.apk
|
||||
|
||||
# Of handmatig: kopieer APK naar toestel, open bestand, kies 'installeren'
|
||||
```
|
||||
Loading…
Reference in a new issue