feat: Android support — APK build and emulator targets
- Dominant language
- Clojure
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Goal
Allow developers to build an APK from their spock game and test it in an Android emulator directly from the Makefile.
## Motivation
Spock uses LWJGL which has Android NDK support via the LWJGL Android bindings. Clojure runs on the JVM; GraalVM native-image or a standard Android Dalvik/ART compilation path (via Clojure + Android toolchain) would be needed.
## Scope
### Build
- `make build/android` — compiles the project to an APK targeting Android (arm64-v8a + x86_64 ABI)
- Toolchain: Android SDK + NDK, LWJGL Android natives, Clojure AOT → dex (via `lein droid` or equivalent)
- The game EDN + shaders + assets are bundled into the APK as resources
### Emulator
- `make emulate/android` — starts an AVD (Android Virtual Device) if not already running
- Should detect if the emulator is already up and skip launch
- AVD config (API level, ABI, screen size) should be definable in `settings.edn` or a top-level `android.edn`
- `make install/android` — installs the built APK into the running emulator via `adb install`
- `make run/android` — `install/android` + launch the main activity via `adb shell am start`
### Makefile targets summary
| Target | Action |
|---|---|
| `build/android` | Compile + package APK |
| `emulate/android` | Start AVD |
| `install/android` | `adb install` APK |
| `run/android` | install + launch |
| `android` | alias for `run/android` |
## Open questions
- Clojure → Android path: `lein droid` (Neko), GraalVM native-image with Android target, or Kotlin interop shim?
- LWJGL Vulkan on Android: requires `VK_KHR_android_surface`; the renderer's `create-surface!` needs an Android-specific implementation
- Is GLFW available on Android? If not, the windowing layer needs an Android alternative (SurfaceView / NativeActivity)
## Depends on
- Nothing blocking — can be designed in parallel with other features
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.