Rename all project references from quicproquo/qpq to quicprochat/qpc across documentation, Docker configuration, CI workflows, packaging scripts, operational configs, and build tooling. - Docker: crate paths, binary names, user/group, data dirs, env vars - CI: workflow crate references, binary names, artifact names - Docs: all markdown files under docs/, SDK READMEs, book.toml - Packaging: OpenWrt Makefile, init script, UCI config (file renames) - Scripts: justfile, dev-shell, screenshot, cross-compile, ai_team - Operations: Prometheus config, alert rules, Grafana dashboard - Config: .env.example (QPQ_* → QPC_*), CODEOWNERS paths - Top-level: README, CONTRIBUTING, ROADMAP, CLAUDE.md
QuicProChat Kotlin SDK
Kotlin/JVM wrapper over libquicprochat_ffi via JNI for Android and JVM platforms.
Prerequisites
- Kotlin 1.9+ / JDK 17+
libquicprochat_ffibuilt for the target architecture- JNI bridge compiled (
jni/dev_quicprochat_NativeBridge.c)
Building the Native Library
# Linux (JVM)
cargo build --release -p quicprochat-ffi
# Android (aarch64)
cargo build --release -p quicprochat-ffi --target aarch64-linux-android
# Android (armv7)
cargo build --release -p quicprochat-ffi --target armv7-linux-androideabi
Compiling the JNI Bridge
cd jni
gcc -shared -fPIC -o libquicprochat_jni.so \
-I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" \
dev_quicprochat_NativeBridge.c \
-L ../../../../target/release -lquicprochat_ffi
Installation
Gradle
dependencies {
implementation(files("libs/quicprochat-0.1.0.jar"))
}
Or include as a local project module.
Usage
import dev.quicprochat.QpqClient
val client = QpqClient("127.0.0.1:5001", caCertPath = "ca.pem")
client.login("alice", "secret")
client.send("bob", "hello".toByteArray())
val messages = client.receive(timeoutMs = 5000)
messages.forEach { println("Received: $it") }
client.close()
API
| Method | Description |
|---|---|
QpqClient(server, caCertPath, serverName) |
Connect to server |
client.login(username, password) |
OPAQUE authentication |
client.send(recipient, message) |
Send message by username |
client.receive(timeoutMs) |
Receive pending messages |
client.close() / client.disconnect() |
Disconnect |
client.isConnected |
Connection status |
Error Handling
try {
client.login("alice", "wrong")
} catch (e: QpqAuthException) {
println("Auth failed: ${e.message}")
} catch (e: QpqTimeoutException) {
println("Timeout: ${e.message}")
} catch (e: QpqException) {
println("Error: ${e.message}")
}
Structure
src/main/kotlin/dev/quicprochat/QpqClient.kt-- High-level clientsrc/main/kotlin/dev/quicprochat/NativeBridge.kt-- JNI declarationssrc/main/kotlin/dev/quicprochat/QpqError.kt-- Exception typesjni/dev_quicprochat_NativeBridge.c-- JNI C bridge to FFI
Android Integration
- Add the native libraries to
src/main/jniLibs/<abi>/:arm64-v8a/libquicprochat_ffi.soarmeabi-v7a/libquicprochat_ffi.so
- Add the JNI bridge library alongside
- The
NativeBridgeclass loads the library viaSystem.loadLibrary
Cross-Compilation
# Install Android NDK targets
rustup target add aarch64-linux-android armv7-linux-androideabi
# Build with the NDK linker
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang \
cargo build --release -p quicprochat-ffi --target aarch64-linux-android