A CLI binary cross-compiled for GOOS=android cannot be launched as an Android app. This adds a proper APK built via gomobile bind + Gradle, with a native Java chat UI.
Go library (internal/zoplib/)
New gomobile-compatible package exposing a single function:
gomobile bind maps this to zoplib.Zoplib.query(...) in Java. Wraps go-openai (already a dependency). 5 mock-server unit tests cover success, system-prompt handling, server errors, and empty-choices.
Android app (android/)
Minimal Gradle project targeting API 21+, compileSdk 34:
MainActivity.java — scrollable conversation view + EditText/Button input; network calls on ExecutorService thread, UI updates via Handler(Looper.getMainLooper()); action-bar Settings dialog persists API key, base URL, model, and system prompt to SharedPreferences
ZopUnitTest.java — JVM unit tests for app-layer logic
app/libs/zoplib.aar is generated at build time (excluded from VCS)
CI/CD
android.yml (new) — runs go test ./internal/zoplib/, installs NDK via sdkmanager, runs gomobile bind, builds debug APK with Gradle 8.7 + AGP 8.3.2, runs Android JVM tests, uploads APK artifact
release.yml — new build-android job produces an unsigned release APK attached to GitHub Releases; removes the old GOOS=android CLI binary matrix entry (superseded)
test.yml — updated android job now runs go test ./internal/zoplib/ alongside the existing cross-compile checks
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
Configure Actions setup steps to set up my environment, which run before the firewall is enabled
Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.
A CLI binary cross-compiled for `GOOS=android` cannot be launched as an Android app. This adds a proper APK built via `gomobile bind` + Gradle, with a native Java chat UI.
## Go library (`internal/zoplib/`)
New `gomobile`-compatible package exposing a single function:
```go
func Query(apiKey, baseURL, model, systemPrompt, userPrompt string) (string, error)
```
`gomobile bind` maps this to `zoplib.Zoplib.query(...)` in Java. Wraps `go-openai` (already a dependency). 5 mock-server unit tests cover success, system-prompt handling, server errors, and empty-choices.
## Android app (`android/`)
Minimal Gradle project targeting API 21+, `compileSdk 34`:
- **`MainActivity.java`** — scrollable conversation view + `EditText`/`Button` input; network calls on `ExecutorService` thread, UI updates via `Handler(Looper.getMainLooper())`; action-bar Settings dialog persists API key, base URL, model, and system prompt to `SharedPreferences`
- **`ZopUnitTest.java`** — JVM unit tests for app-layer logic
- `app/libs/zoplib.aar` is generated at build time (excluded from VCS)
## CI/CD
- **`android.yml`** (new) — runs `go test ./internal/zoplib/`, installs NDK via `sdkmanager`, runs `gomobile bind`, builds debug APK with Gradle 8.7 + AGP 8.3.2, runs Android JVM tests, uploads APK artifact
- **`release.yml`** — new `build-android` job produces an unsigned release APK attached to GitHub Releases; removes the old `GOOS=android` CLI binary matrix entry (superseded)
- **`test.yml`** — updated `android` job now runs `go test ./internal/zoplib/` alongside the existing cross-compile checks
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by firewall rules:
>
> - `dl.google.com`
> - Triggering command: `/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.4-bin/1w5dpkrfk8irigvoxmyhowfim/gradle-8.4/lib/gradle-launcher-8.4.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.4-bin/1w5dpkrfk8irigvoxmyhowfim/gradle-8.4/lib/agents/gradle-instrumentation-agent-8.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.4 -o ux_amd64/vet` (dns block)
>
> If you need me to access, download, or install something from one of these locations, you can either:
>
> - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/peterwwillis/zop/settings/copilot/coding_agent) (admins only)
>
> </details>
<!-- START COPILOT CODING AGENT TIPS -->
---
📍 Connect Copilot coding agent with [Jira](https://gh.io/cca-jira-docs), [Azure Boards](https://gh.io/cca-azure-boards-docs) or [Linear](https://gh.io/cca-linear-docs) to delegate work to Copilot in one click without leaving your project management tool.
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
mutablecc/zop!7
Loading...
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/build-android-app"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?