# Android Surveys installation - Docs

> 🚧 **Note:** Mobile surveys for Android is currently in **beta**. We'd love to hear your feedback on betas via the [in-app support panel](https://us.posthog.com#panel=support%3Afeedback%3Asurveys%3Alow) or one of our other [support options](/docs/support-options.md).

1.  1

    ## Install the dependency

    Required

    Add the PostHog Android SDK to your `build.gradle` dependencies:

    build.gradle

    PostHog AI

    ```kotlin
    dependencies {
        implementation("com.posthog:posthog-android:3.+")
    }
    ```

2.  2

    ## Configure PostHog

    Required

    Initialize PostHog in your Application class:

    SampleApp.kt

    PostHog AI

    ```kotlin
    class SampleApp : Application() {
        companion object {
            const val POSTHOG_PROJECT_TOKEN = "<ph_project_token>"
            const val POSTHOG_HOST = "https://us.i.posthog.com"
        }
        override fun onCreate() {
            super.onCreate()
            // Create a PostHog Config with the given project token and host
            val config = PostHogAndroidConfig(
                apiKey = POSTHOG_PROJECT_TOKEN,
                host = POSTHOG_HOST
            )
            // Setup PostHog with the given Context and Config
            PostHogAndroid.setup(this, config)
        }
    }
    ```

3.  3

    ## Send events

    Recommended

    Once installed, PostHog will automatically start capturing events. You can also manually send events to test your integration:

    Kotlin

    PostHog AI

    ```kotlin
    import com.posthog.PostHog
    PostHog.capture(
        event = "button_clicked",
        properties = mapOf(
            "button_name" to "signup"
        )
    )
    ```

4.  4

    ## Add the surveys UI module

    Required

    Add the optional `posthog-android-surveys-compose` module alongside the core SDK. It provides a ready-made [Jetpack Compose](https://developer.android.com/jetpack/compose) UI.

    build.gradle

    PostHog AI

    ```kotlin
    dependencies {
        // ... existing dependencies
        implementation("com.posthog:posthog-android-surveys-compose:0.+")
    }
    ```

5.  5

    ## Enable surveys in your configuration

    Required

    Enable surveys in your PostHog configuration. The SDK auto-discovers the UI module from the classpath, so matching surveys render automatically with no extra wiring.

    SampleApp.kt

    PostHog AI

    ```kotlin
    val config = PostHogAndroidConfig(
        apiKey = POSTHOG_PROJECT_TOKEN,
        host = POSTHOG_HOST
    ).apply {
        surveys = true
    }
    PostHogAndroid.setup(appContext, config)
    ```

6.  6

    ## Next steps

    Recommended

    After installing the PostHog SDK, you can create your first survey.

    | Resource | Description |
    | --- | --- |
    | [Creating surveys](/docs/surveys/creating-surveys.md) | Learn how to build and customize your surveys |
    | [Targeting surveys](/docs/surveys/targeting.md) | Show surveys to specific users based on properties, events, or feature flags |
    | [How to create custom surveys](/tutorials/survey.md) | Build advanced survey experiences with custom code |
    | [Framework guides](/docs/surveys/tutorials.md#framework-guides) | Setup guides for React, Next.js, Vue, and other frameworks |
    | [More tutorials](/docs/surveys/tutorials.md) | Other real-world examples and use cases |

    You should also [identify](/docs/product-analytics/identify.md) users and [capture events](/docs/product-analytics/capture-events.md) with PostHog to control who and when to show surveys to your users.

    Not all survey features are available on every SDK. See the [SDK feature support matrix](/docs/surveys/sdk-feature-support.md) for a full comparison.

## Supported features

Not all survey features are available on every SDK. See the [SDK feature support matrix](/docs/surveys/sdk-feature-support.md) for a full comparison.

## Limitations

-   HTML descriptions for questions and the thank-you screen render as plain text.

## Troubleshooting

-   Update your SDK and run a clean build if you experience issues.
-   If surveys aren't shown, make sure `surveys = true` is set in your config and the survey is enabled in your [project settings](https://us.posthog.com/settings/project-surveys).

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better