Skip to content

Android AAR Setup

The Android host publishes as a self-contained AAR: io.github.anderscan.ekrooh:bare-host, on Maven Central (with GitHub Packages as a fallback). “Self-contained” means the Bare Kit runtime jar ships in the AAR’s libs/ and its native libs in jni/ — consumers need no prebuilds download and no bare-link addons for the core runtime.

dependencyResolutionManagement {
repositories {
google()
mavenCentral() // no credentials needed
}
}
dependencies {
implementation "io.github.anderscan.ekrooh:bare-host:<version>"
}

The version is the same single vX.Y.Z as the npm package — bump both together. Check Maven Central for published versions. If you consumed it from GitHub Packages before, the Maven layout is identical: drop the maven.pkg.github.com repository and its read:packages credentials.

The host library surfaces:

  • BareProtocol — Kotlin mirror of the wire protocol.
  • HostIpcCoordinator — frames to/from the worklet.
  • HostPluginRegistry — host-side plugin handlers.
  • BareHandoff — reads handoff.json and deletes it (BareHandoff.consume).
  • BareWebViewClient — WebView wiring and loopback-origin confinement.
  • BareHostAbi — fails fast on an unsupported (32-bit) runtime.

The public Kotlin API is a stability boundary: it is dumped to android/api/bare-host.api and checked on every Gradle check.

Your app starts the worklet, waits for the handoff file, injects window.__ekrooh = { bootstrap } (a one-time nonce — never the raw token), and loads the loopback page — see Host Handoff Flow for the sequence, and the framework’s examples/android-app for a working shell.

If you are developing the host itself (not consuming it): npm run prebuilds then ./gradlew :examples:android-app:assembleDebug; host JUnit tests via ./gradlew build.