> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Android Product Analytics installation Canonical URL: https://posthog.com/docs/product-analytics/installation/android > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host). ## On this page - [Install with the wizard](#install-with-the-wizard) - [Install the dependency](#install-the-dependency) - [Configure PostHog](#configure-posthog) - [Send events](#send-events) - [Next steps](#next-steps) ## Install with the wizard Run this command in your project directory to add PostHog to your Android project. The wizard detects your framework, installs the SDK, and sets up your first events. `npx @posthog/wizard` Or set it up manually by following the rest of this guide. 1. 1 ## Install the dependency Required Add the PostHog Android SDK to your `build.gradle` dependencies: build.gradle ```kotlin dependencies { implementation("com.posthog:posthog-android:3.+") } ``` 2. 2 ## Configure PostHog Required Initialize PostHog in your Application class: SampleApp.kt ```kotlin class SampleApp : Application() { companion object { const val POSTHOG_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 ```kotlin import com.posthog.PostHog PostHog.capture( event = "button_clicked", properties = mapOf( "button_name" to "signup" ) ) ``` 4. 4 ## Next steps Recommended Now that you're capturing events, continue with the resources below to learn what else Product Analytics enables within the PostHog platform. | Resource | Description | | --- | --- | | [Capturing events](https://posthog.com/docs/product-analytics/capture-events.md) | Learn how to capture custom events beyond autocapture | | [Identifying users](https://posthog.com/docs/product-analytics/identify.md) | Associate events with specific users | | [Creating insights](https://posthog.com/docs/product-analytics/insights.md) | Build trends, funnels, and retention charts | | [Group analytics](https://posthog.com/docs/product-analytics/group-analytics.md) | Track events at the company or account level |