Add downloadable Android APK build
This commit is contained in:
@@ -59,6 +59,8 @@ The installer prints the final dashboard address, normally `http://<pi-hostname>
|
||||
|
||||
It also installs the BlueZ GATT bridge used by the optional [Android companion](./android/README.md). Pair phones from **Settings → Mobile** after the Pi has Bluetooth enabled.
|
||||
|
||||
A ready-to-install development build is available at [`apks/pi-car-companion-debug.apk`](./apks/pi-car-companion-debug.apk). Android 8 or newer is required.
|
||||
|
||||
`install.sh` is idempotent. After pulling changes in the original clone, run it again to deploy that checkout:
|
||||
|
||||
```bash
|
||||
|
||||
+3
-4
@@ -20,14 +20,13 @@ The one-use code expires after ten minutes. The resulting credential is encrypte
|
||||
|
||||
## Build
|
||||
|
||||
Open this `android/` directory in Android Studio (JDK 17, Android SDK 35) and run the `app` configuration, or use the included Gradle wrapper:
|
||||
Open this `android/` directory in Android Studio (JDK 17, Android SDK 35) and run the `app` configuration, or build the downloadable APK from the repository root:
|
||||
|
||||
```bash
|
||||
cd android
|
||||
./gradlew :app:assembleDebug
|
||||
./build-apk.sh
|
||||
```
|
||||
|
||||
The debug APK is produced at `app/build/outputs/apk/debug/app-debug.apk`. Hardware validation requires an Android 8+ phone with BLE and a Raspberry Pi with a BlueZ-compatible BLE adapter.
|
||||
The debug APK is copied to [`apks/pi-car-companion-debug.apk`](../apks/pi-car-companion-debug.apk). Hardware validation requires an Android 8+ phone with BLE and a Raspberry Pi with a BlueZ-compatible BLE adapter.
|
||||
|
||||
## BLE protocol
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Android APKs
|
||||
|
||||
Download [`pi-car-companion-debug.apk`](./pi-car-companion-debug.apk) and open it on an Android 8 or newer device to install the companion app.
|
||||
|
||||
This is a development build signed with Android's standard debug key. Android may require permission to install apps from the browser or file manager used to open it.
|
||||
|
||||
To rebuild the APK from the repository root (JDK 17+ and Android SDK 35 required), run:
|
||||
|
||||
```bash
|
||||
./build-apk.sh
|
||||
```
|
||||
Binary file not shown.
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repository_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
android_dir="${repository_dir}/android"
|
||||
output_dir="${repository_dir}/apks"
|
||||
source_apk="${android_dir}/app/build/outputs/apk/debug/app-debug.apk"
|
||||
output_apk="${output_dir}/pi-car-companion-debug.apk"
|
||||
|
||||
mkdir -p "${output_dir}"
|
||||
|
||||
(
|
||||
cd "${android_dir}"
|
||||
./gradlew --no-daemon :app:assembleDebug
|
||||
)
|
||||
|
||||
install -m 0644 "${source_apk}" "${output_apk}"
|
||||
|
||||
echo "APK written to ${output_apk}"
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
sha256sum "${output_apk}"
|
||||
fi
|
||||
+2
-1
@@ -16,7 +16,8 @@
|
||||
"typecheck": "npm run typecheck --workspaces --if-present",
|
||||
"test": "npm run test --workspaces --if-present",
|
||||
"build": "npm run build --workspaces --if-present",
|
||||
"check:scripts": "bash -n install.sh scripts/pi-car-companion-update scripts/pi-car-companion-network-setup scripts/pi-car-companion-power scripts/pi-car-companion-bluetooth-control && python3 -c \"compile(open('scripts/pi-car-companion-bluetooth', encoding='utf-8').read(), 'scripts/pi-car-companion-bluetooth', 'exec')\"",
|
||||
"build:apk": "./build-apk.sh",
|
||||
"check:scripts": "bash -n install.sh build-apk.sh scripts/pi-car-companion-update scripts/pi-car-companion-network-setup scripts/pi-car-companion-power scripts/pi-car-companion-bluetooth-control && python3 -c \"compile(open('scripts/pi-car-companion-bluetooth', encoding='utf-8').read(), 'scripts/pi-car-companion-bluetooth', 'exec')\"",
|
||||
"check": "npm run check:scripts && npm run lint && npm run typecheck && npm test && npm run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user