> For the complete documentation index, see [llms.txt](https://docs.keewano.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keewano.com/sdks/android.md).

# Android SDK

Install and configure the Keewano SDK in an Android project.

The SDK auto-initializes on process launch — there is no `Application` subclass to write and no boot code to call. Add the dependency, declare your API key in the manifest, and it starts collecting on the next launch.

**Prerequisites:** a Keewano project API key (a JWT issued in the Keewano console), and an app with `minSdk 21` (Android 5.0) or higher.

## 1. Add the dependency

```kotlin
// app/build.gradle.kts
dependencies {
    implementation("com.keewano:keewano-sdk:1.0.0")
}
```

That is the only build change required. The SDK pulls in a single transitive dependency (`androidx.startup`) and contributes its own `AndroidManifest.xml`, so there is nothing else to wire up.

## 2. Configure your API key

Declare your key as `<meta-data>` inside the `<application>` element of your app's `AndroidManifest.xml`:

```xml
<application ...>
    <meta-data
        android:name="com.keewano.sdk.API_KEY"
        android:value="YOUR_KEEWANO_API_KEY" />
</application>
```

No `Application` subclass, no boot code, no `initialize()` call. On the next launch the SDK starts itself, mints an anonymous install ID, and begins collecting.

{% hint style="info" %}
Prefer to configure in code — to fetch the key remotely, say? Skip the manifest key and call `KeewanoSDK.initialize()` yourself. See [Programmatic initialization](https://github.com/Keewano/keewano-android-sdk/blob/main/docs/configuration.md#programmatic-initialization).
{% endhint %}

## 3. Run and verify

Build and run, then watch Logcat filtered to the SDK's tag:

```bash
adb logcat -s KeewanoSDK
```

A healthy first launch is **quiet** — the SDK logs only warnings and errors, so no output means it started cleanly. To confirm positively, trigger something tracked automatically (rotate the screen, background and foreground the app) or report an event yourself.

Events appear in your Keewano console rather than in Logcat; the SDK does not log event contents. If you see `SDK not initialized; event dropped` or `No API key was provided`, see the SDK's troubleshooting section.

## 4. Report your first event

Every reporting call is a static method on `KeewanoSDK`, is safe to call from any thread, and never throws — invalid arguments are dropped with a logged warning rather than raised.

```kotlin
import com.keewano.sdk.KeewanoSDK

// Associate your own user id with this install (assign once, after the user logs in).
KeewanoSDK.setUserId(1234567890L)

// A progression milestone.
KeewanoSDK.reportOnboardingMilestone("finished_tutorial")

KeewanoSDK.reportButtonClick("Play")
```

Events are batched and uploaded on a background thread, and persisted to disk first — so they survive process death and offline periods, and upload when a network is available.

For events beyond the built-in set, see [Custom Events Codegen](https://docs.keewano.com/sdks/custom-events-codegen.md).

***

## Full documentation

|                                                                                                             |                                               |
| ----------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [Getting Started](https://github.com/Keewano/keewano-android-sdk/blob/main/docs/getting-started.md)         | Install, configure, verify                    |
| [Configuration](https://github.com/Keewano/keewano-android-sdk/blob/main/docs/configuration.md)             | Every manifest key and config option          |
| [Automatic Tracking](https://github.com/Keewano/keewano-android-sdk/blob/main/docs/automatic-tracking.md)   | What is captured with no extra code           |
| [Custom Events](https://github.com/Keewano/keewano-android-sdk/blob/main/docs/custom-events.md)             | Your own typed events                         |
| [Privacy and Consent](https://github.com/Keewano/keewano-android-sdk/blob/main/docs/privacy-and-consent.md) | Consent gating and PII                        |
| [API Reference](https://github.com/Keewano/keewano-android-sdk/blob/main/docs/api-reference.md)             | Every reporting method, with validation rules |

Source: [github.com/Keewano/keewano-android-sdk](https://github.com/Keewano/keewano-android-sdk)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keewano.com/sdks/android.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
