Set up Android project with Kotlin and Jetpack Compose

Initial project structure with manifest configured for foreground
audio service, AudioTrack-based playback, and background operation.
Includes Gradle wrapper, dependency catalog, placeholder icons,
and build instructions for Arch Linux.
This commit is contained in:
Jeena 2026-03-09 06:50:17 +00:00
commit a5b3f46eae
33 changed files with 923 additions and 0 deletions

104
README.md Normal file
View file

@ -0,0 +1,104 @@
# Pacer
A native Android pacing/metronome app that plays 880 Hz beeps at a user-set BPM to maintain
walking pace. Runs in the background for 2+ hour walks without draining battery. Plays
alongside other audio apps (podcasts, music) without requesting audio focus.
Ported from the web version at https://jeena.net/pacer/
## Building on Arch Linux
### 1. Install Java 17
```bash
sudo pacman -S jdk17-openjdk
```
Set `JAVA_HOME` (add to `~/.bashrc` or `~/.zshrc`):
```bash
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
export PATH="$JAVA_HOME/bin:$PATH"
```
Verify: `java -version` should show `openjdk version "17.x.x"`.
### 2. Install Android SDK via AUR
```bash
# Remove old package if previously installed (it leaves files behind — clean them up too)
sudo pacman -Rns android-sdk
sudo rm -rf /opt/android-sdk/platform-tools /opt/android-sdk/tools
# Install modern SDK tools
paru -S android-sdk-cmdline-tools-latest android-sdk-platform-tools android-sdk-build-tools android-platform
```
The packages install to `/opt/android-sdk`. Add to `~/.bashrc` or `~/.zshrc`:
```bash
export ANDROID_HOME=/opt/android-sdk
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
```
Reload: `source ~/.bashrc`
### 3. Accept SDK Licenses
```bash
sudo /opt/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses
```
### 4. Bootstrap the Gradle Wrapper
The first time only, install system Gradle to generate the wrapper binary:
```bash
sudo pacman -S gradle
cd /path/to/Pacer
gradle wrapper --gradle-version 8.7 --distribution-type bin
sudo pacman -Rs gradle # optional: remove system gradle afterwards
```
### 5. Build
```bash
./gradlew assembleDebug
```
The debug APK will be at: `app/build/outputs/apk/debug/app-debug.apk`
### 6. Install on a Device
Enable USB debugging (Settings > Developer Options > USB Debugging), connect via USB, then:
```bash
./gradlew installDebug
# or
adb install app/build/outputs/apk/debug/app-debug.apk
```
## Troubleshooting
**`ANDROID_HOME not set`** — Reload your shell profile or open a new terminal.
**`License for package ... not accepted`** — Run `sudo /opt/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses`.
**`Unsupported class file major version`** — Wrong Java version. Confirm `java -version` shows
17 and `JAVA_HOME` points to `/usr/lib/jvm/java-17-openjdk`.
**`Permission denied` on `/opt/android-sdk`** — Run sdkmanager with `sudo`.
**`Failed to install build-tools;34.0.0 ... SDK directory is not writable`** — AGP tried to
auto-download build-tools instead of using the installed version. Ensure `buildToolsVersion = "36.1.0"`
is set in `app/build.gradle.kts`.
## Development
See `AGENTS.md` for the developer/agent workflow guide.
See `BACKLOG.md` for all user stories and acceptance criteria.
```bash
./gradlew test # unit tests
./gradlew lint # lint checks
```