← Back to blog
Tutorial2026-05-21·9 min read·By Nedas Višniauskas

How to Add In-App AI Support to Your Android App in an Afternoon

Your Android app users hit blockers. They can't figure out how to upgrade their plan, find a setting, or diagnose why a feature stopped working. Most apps send them to a generic help center or a support email that takes two days to answer. By then, the user has already churned, left a bad review, or just worked around the problem.

In-app AI support changes this. The agent lives inside your app — aware of the user's account state, able to perform actions on their behalf, and capable of resolving issues in real time without ever leaving your UI.

This guide walks you through integrating the ResolveKit Android SDK — from zero to a working prototype — in a single afternoon. Native code, no web overlays, no compromises.

What You're Building

By the end of this post, you'll have an Android app with:

  • A native chat interface that feels like part of your app
  • An AI agent that can answer questions and perform actions using your own Kotlin code
  • An operator approval flow for sensitive actions — the user approves anything risky before it runs
  • Full session logging so you can audit exactly what happened in every conversation

Prerequisites

Before you start:

  • Android API level 26 (Android 8.0) or later
  • Android Studio Jellyfish or later
  • Kotlin 1.9+
  • A ResolveKit backend instance (self-host with the MIT-licensed backend, or use the managed tier at console.resolvekit.app)
  • API key from your ResolveKit dashboard
  • Your own LLM provider keys — ResolveKit does not bundle a model. You bring your own OpenAI, Anthropic, or Ollama keys

Step 1: Add the SDK

In your project's `settings.gradle.kts`, add the Maven Central repository if it's not already there:

dependencyResolutionManagement {
    repositories {
        mavenCentral()
    }
}

Then in your app's `build.gradle.kts`, add the dependency:

dependencies {
    implementation("app.resolvekit:resolvekit-android-sdk:1.0.0")
}

ResolveKit publishes two modules:

  • `resolvekit-core` — the session, transport, and tool dispatch layer
  • `resolvekit-ui` — ready-made chat views for Jetpack Compose and traditional Views

Link `resolvekit-ui`. It transitively includes `resolvekit-core`.

Step 2: Define Your First Tool Function

Tool functions are how the AI agent does things in your app — not just answer questions, but actually perform actions. You define them as Kotlin classes annotated with `@ResolveKitFunction`.

Here's a function that retrieves a user's plan details:

import app.resolvekit.authoring.ResolveKitFunction
import app.resolvekit.authoring.requiresApproval

@ResolveKitFunction(
    name = "get_plan_details",
    description = "Returns the current subscription plan, billing cycle, and feature flags for the active user.",
    timeoutSeconds = 5,
    requiresApproval = false
)
class GetPlanDetails {
    suspend fun perform(): PlanDetails {
        val user = currentUser ?: throw IllegalStateException("No active user session")
        return PlanDetails(
            plan = user.subscription.plan,
            renewalDate = user.subscription.renewalDate,
            features = user.subscription.enabledFeatures
        )
    }
}

data class PlanDetails(
    val plan: String,
    val renewalDate: String,
    val features: List<String>
)

And here's one that changes the user's plan — which requires explicit approval:

@ResolveKitFunction(
    name = "change_plan",
    description = "Changes the current user's subscription plan. Requires explicit user confirmation before execution.",
    timeoutSeconds = 15,
    requiresApproval = true
)
class ChangePlan {
    suspend fun perform(targetPlan: String): Boolean {
        val user = currentUser ?: throw IllegalStateException("No active user session")
        billingService.changePlan(userId = user.id, newPlan = targetPlan)
        return true
    }
}

The `requiresApproval = true` flag is the mechanism for operator control. When the LLM decides to change the plan, the SDK pauses the flow and shows the user a clear confirmation dialog. Nothing executes until the user explicitly allows it.

Step 3: Initialize the Runtime

The runtime manages the session lifecycle, backend connection, and tool dispatch. Configure it with your API key and the list of functions you want available:

import app.resolvekit.ui.ResolveKit
import app.resolvekit.ui.ResolveKitConfiguration

val resolveKit = ResolveKit(
    configuration = ResolveKitConfiguration(
        apiKey = "rk_your_api_key_here",
        functions = listOf(GetPlanDetails::class.java, ChangePlan::class.java)
    )
)

Keep the runtime alive for the lifetime of your chat session. Store it in a ViewModel, a dedicated service, or a singleton scoped to your activity.

Step 4: Embed the Chat Interface

The SDK provides native UI components for Jetpack Compose and Android Views. Here's how to use them:

Jetpack Compose

import androidx.compose.runtime.Composable
import app.resolvekit.ui.compose.ResolveKitChat

@Composable
fun SupportScreen() {
    ResolveKitChat(resolveKit = resolveKit)
}

Views / XML

import app.resolvekit.ui.views.ResolveKitChatView

val chatView = ResolveKitChatView(context).apply {
    configure(resolveKit)
}
supportContainer.addView(chatView)

`ResolveKitChatView` handles the full lifecycle: connecting to your backend, streaming text responses in real time, surfacing the approval dialog for sensitive operations, and recovering gracefully from network interruptions.

How the Approval Flow Works

Here's the sequence when a user asks "upgrade me to Pro":

1. The SDK sends the message to your ResolveKit backend

2. Your backend routes it to your LLM (with your API keys)

3. The LLM decides to call the `change_plan` tool

4. The SDK intercepts the tool call, reads `requiresApproval = true`, and pauses

5. The user sees a confirmation dialog: "This app wants to change your plan to Pro. Confirm?"

6. If the user taps Confirm, the SDK executes your Kotlin code and sends the result back

7. The agent delivers the final response: "Your plan has been upgraded to Pro. You'll see the new features immediately."

As the operator, you see the full trace in your ResolveKit dashboard: every message, every tool call, every approval decision. If something goes wrong, you have the full session context to investigate.

What to Do After Integration

Once the SDK is live, these are the highest-leverage next steps:

1. Upload your product documentation

The more context the agent has about your specific app, the fewer hallucinated responses. Upload your help articles, FAQs, and annotated screenshots to the ResolveKit dashboard.

2. Expand your function library

Every action a user can take is a potential tool function. Start with the top 5 support ticket topics and work down from there. The more the agent can do natively, the higher your resolution rate.

3. Tune your approval policies

Not every function needs human approval forever. As you gain confidence in a function's reliability, you can flip `requiresApproval` to `false` for trusted user segments or lower-risk operations.

4. Review session traces weekly

Look for patterns: where is the agent getting stuck? What questions does it consistently fail to answer? Use that to improve your function definitions and your documentation.

Why Not a Web Overlay?

You might be tempted to use a web-based support widget — they exist, they're quick to integrate, and they work across platforms. Here's the real difference:

  • App size: Web overlays typically add 20–30MB to your binary. The ResolveKit SDK adds under 1MB.
  • Battery: WebViews keep a browser process alive in the background. Native code doesn't.
  • Session continuity: WebViews lose state on app switch. The SDK maintains session context across transitions.
  • Native access: WebViews can't call your Kotlin APIs. The SDK can call any function you define.

For a production app with real users and real support volume, the native SDK is the only choice that doesn't compromise the experience.

Get Started

You can have a working prototype in under an hour. The SDK is MIT-licensed, the backend is MIT/AGPL, and the managed tier is free to start.

Start your free trial →

Or dig deeper into how operator approval flows work:

Ready to build better in-app support?

ResolveKit is an open-source SDK for embedding AI support directly in your mobile app. Self-host or start on managed infrastructure.