Android Session Replay installation
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.
Or set it up manually by following the rest of this guide.
- 1
Install the dependency
RequiredAdd the PostHog Android SDK to your
build.gradledependencies:build.gradleSDK versionSession replay requires PostHog Android SDK version 3.4.0 or higher. We recommend always using the latest version.
- 2
Enable session recordings in project settings
RequiredGo to your PostHog Project Settings and enable Record user sessions. Session recordings will not work without this setting enabled.
- 3
Configure PostHog with session replay
RequiredAdd
sessionReplay = trueto your PostHog configuration. Here are all the available options:SampleApp.ktFor more configuration options, see the Android session replay docs.
RequirementsRequires Android API 26 or higher. Jetpack Compose is only supported if
screenshotis enabled. - 4
Watch session recordings
RecommendedVisit your site or app and interact with it for at least 10 seconds to generate a recording. Navigate between pages, click buttons, and fill out forms to capture meaningful interactions.
- 5
Next steps
RecommendedNow that you're recording sessions, continue with the resources below to learn what else Session Replay enables within the PostHog platform.
Resource Description Watching recordings How to find and watch session recordings Privacy controls How to mask sensitive data in recordings Network recording How to capture network requests in recordings Console log recording How to capture console logs in recordings More tutorials Other real-world examples and use cases











