> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runanywhere.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Add the RunAnywhere Kotlin SDK to your Android project

## Gradle Setup

### Repository Configuration

Add the required repositories to your `settings.gradle.kts`:

```kotlin settings.gradle.kts theme={null}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        mavenLocal()       // For local SDK development builds
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }  // Required for transitive deps (android-vad, PRDownloader)
    }
}
```

### Dependencies

Add the RunAnywhere SDK to your module-level `build.gradle.kts`:

```kotlin build.gradle.kts (Module: app) theme={null}
dependencies {
    // Core SDK (required)
    implementation("io.github.sanchitmonga22:runanywhere-sdk-android:0.20.6")

    // LLM + VLM support - llama.cpp backend (~34MB)
    implementation("io.github.sanchitmonga22:runanywhere-llamacpp-android:0.20.6")

    // STT/TTS/VAD support - ONNX backend (~25MB)
    implementation("io.github.sanchitmonga22:runanywhere-onnx-android:0.20.6")
}
```

<Info>
  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)
</Info>

### Build Configuration

```kotlin build.gradle.kts (Module: app) theme={null}
android {
    compileSdk = 35
    defaultConfig {
        minSdk = 26
        targetSdk = 35
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = "17"
    }
}
```

## 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 your `AndroidManifest.xml`:

```xml AndroidManifest.xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<uses-feature android:name="android.hardware.microphone" android:required="false" />
```

<Note>
  `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()`.
</Note>

## ProGuard Rules

If using ProGuard/R8 minification, add these rules:

```proguard proguard-rules.pro theme={null}
-keep class com.runanywhere.sdk.** { *; }
-keepclassmembers class com.runanywhere.sdk.** { *; }
```

## Next Steps

<Card title="Quick Start" icon="rocket" href="/kotlin/quick-start">
  Initialize the SDK and run your first inference →
</Card>
