Add an Android app that drives the same tethercore engine (SSE + RTC) as the iOS/macOS apps via generated Kotlin/UniFFI bindings — proving the shared core reaches a fourth language with no protocol reimplementation. Engine surface is identical to Swift: Engine(server,room,from,source) / start / send / stop. Includes the Gradle/Compose project, a TetherStore that bridges the engine to ClipboardManager (auto-send via OnPrimaryClipChangedListener — Android allows foreground clipboard observation, unlike iOS), per-install RoomIdentity, and core/build-android.sh (cargo-ndk → jniLibs + Kotlin bindgen). Not built here: this machine has no Android SDK/NDK, so the native .so and Kotlin binding are generated (git-ignored), not committed. README documents the NDK install + build steps. The binding itself was confirmed to generate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
49 lines
1.5 KiB
Kotlin
49 lines
1.5 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
}
|
|
|
|
android {
|
|
namespace = "io.pecord.tether"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "io.pecord.tether"
|
|
minSdk = 26
|
|
targetSdk = 35
|
|
versionCode = 1
|
|
versionName = "0.1.0"
|
|
// Limit to the ABIs core/build-android.sh produces.
|
|
ndk { abiFilters += listOf("arm64-v8a", "x86_64") }
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
kotlinOptions { jvmTarget = "17" }
|
|
buildFeatures { compose = true }
|
|
// Compose compiler comes from the org.jetbrains.kotlin.plugin.compose plugin
|
|
// (Kotlin 2.0+); no kotlinCompilerExtensionVersion needed.
|
|
// jniLibs/<abi>/libtethercore.so are placed by core/build-android.sh
|
|
}
|
|
|
|
dependencies {
|
|
val composeBom = platform("androidx.compose:compose-bom:2024.09.03")
|
|
implementation(composeBom)
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("androidx.activity:activity-compose:1.9.2")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
|
|
|
|
// UniFFI Kotlin runtime requirements.
|
|
implementation("net.java.dev.jna:jna:5.14.0@aar")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
|
|
}
|