Gradle Setup
Repository Configuration
Add the required repositories to yoursettings.gradle.kts:
settings.gradle.kts
Dependencies
Add the RunAnywhere SDK to your module-levelbuild.gradle.kts:
build.gradle.kts (Module: app)
Include only the modules you need. Each native module adds to your APK size: -
runanywhere-llamacpp-android: ~34MB (for LLM/VLM text generation) -
runanywhere-onnx-android: ~25MB (for STT, TTS, and VAD)
Build Configuration
build.gradle.kts (Module: app)
Module Overview
| Module | Size | Features |
|---|---|---|
runanywhere-sdk-android | ~2MB | Core SDK, model management, events |
runanywhere-llamacpp-android | ~34MB | LLM + VLM (GGUF models) |
runanywhere-onnx-android | ~25MB | STT, TTS, VAD (ONNX models) |
Supported Model Formats
| Format | Extension | Backend | Use Case |
|---|---|---|---|
| GGUF | .gguf | llama.cpp | LLM text generation |
| ONNX | .onnx | ONNX Runtime | STT, TTS, VAD |
| ORT | .ort | ONNX Runtime | Optimized STT/TTS |
Android Manifest
Add the required permissions to yourAndroidManifest.xml:
AndroidManifest.xml
INTERNET is required for model downloads. RECORD_AUDIO is needed for STT and Voice Pipeline.
MODIFY_AUDIO_SETTINGS is needed for TTS audio playback. Runtime permission for RECORD_AUDIO
must be requested via ActivityResultContracts.RequestPermission().ProGuard Rules
If using ProGuard/R8 minification, add these rules:proguard-rules.pro
Next Steps
Quick Start
Initialize the SDK and run your first inference →