Getting Started
‘Integrate StreamLayer into GoogleTV and AndroidTV apps with Maven installation, SDK initialization, theme customization, and screen offset delegate setup.’

GoogleTV / AndroidTV SDK
Welcome to the StreamLayer GoogleTV / AndroidTV SDK documentation. StreamLayer supports GoogleTV and AndroidTV applications through the Android SDK. This guide covers installation, initialization, and integration for Android TV devices.
Start with your AI coding assistant
Connect your assistant to StreamLayer docs before changing code, then use this prompt. The connection lets it search the current guides and read the platform integration skill as it works.
Help me integrate StreamLayer into my existing Android TV / Google TV app.
Use the streamlayer-docs MCP to search for and fetch the matching integration
guide and the streamlayer-androidtv-integration skill page before editing code.
If search does not return the skill, read https://docs.streamlayer.io/docs/android-tv-integration-skill
or ask me to copy that page into this session.
Cite the sources, confirm my SDK version and prerequisites, and make the smallest
documented change while preserving my player and app structure. Report missing
or conflicting guidance instead of guessing. Use placeholder keys in examples.
Finish with the checks run and the remaining platform/device validation steps.Review the diff and follow the platform setup and testing guidance linked below.
Quick Start Path
- Read the Introduction — Understand what StreamLayer delivers and how the SDK architecture works.
- Follow the Android SDK Integration Guide — The Android TV SDK shares the Android SDK. Follow the full setup guide for dependencies, SDK API Key, and initialization.
- Configure for Android TV — Review the GoogleTV-specific notes below for screen offset handling, theme customization, and layout setup.
- Customize the Theme — Use Customizing Themes to match the StreamLayer Element to your TV app's branding.
What You Can Build
| Feature | Description | Guide |
|---|---|---|
| StreamLayer Element | Interactive UI surface with D-pad navigation | Android Integration Guide |
| Custom Themes | Match the StreamLayer Element to your TV app's branding | Customizing Themes |
| Layout Modes | Portrait, landscape, and squeezeback formats for TV | Layout Guide |
Reference Documentation
| Documentation | Description |
|---|---|
| Android SDK Integration Guide | Full Android SDK setup and configuration |
| Layout Guide | Portrait, landscape, and squeezeback layout setup |
| Customizing Themes | Theme and style customization |
| Error Reference | SDK error codes, causes, and fixes (shared Android SDK) |
| Migration Guide | Version-to-version upgrade instructions (shared Android SDK) |
| Changelog | Per-version change history (shared Android SDK) |
System Requirements
- Android Studio 4.0 or higher
- Target SDK version 33 or higher
- Minimum SDK version 21
- Kotlin or Java
GoogleTV vs AndroidTV
Google TV is a redesigned user interface that runs on top of the Android TV operating system. Android TV is the underlying operating system that provides access to apps. Since Google TV is built on the Android TV OS, any app that runs on Android TV also runs on Google TV, and vice versa. There is no difference in app compatibility between the two — they share the same Play Store catalog of TV apps and both support Chromecast built-in.
Quick Installation
The SDK is distributed via a Maven public repository. Find the latest version here.
Add the following dependencies to your module-level build.gradle:
dependencies {
implementation("io.streamlayer:androidsdk:<insert latest version>")
implementation("io.streamlayer:android-media3:<insert latest version>")
}Initialize the SDK in your Application class:
override fun onCreate() {
super.onCreate()
StreamLayer.initializeApp(this, BuildConfig.SL_SDK_KEY)
StreamLayer.setGamificationOptions(
StreamLayer.GameOptions(
isGlobalLeaderboardEnabled = false,
isInvitesEnabled = false,
isOnboardingEnabled = false,
showGamificationNotificationOnboarding = false
)
)
StreamLayer.setCustomTheme(
SLRTheme(
mainTheme = R.style.TVMainOverlayTheme,
baseTheme = R.style.TVMainOverlayTheme
)
)
StreamLayer.setInvitesEnabled(false)
StreamLayerMedia3Player.initSdk(this)
}GoogleTV-Specific Notes
- Screen Offset Delegate: Use a screen offset delegate to adjust player layout when the StreamLayer Element is active. See the example below.
- Themes: Customize the StreamLayer Element appearance using
SLRTheme. See Customizing Themes for details. - Layout: For portrait and landscape orientation setup, see the Layout Guide.
Screen Offset Delegate Example
val appHostDelegate = object : SLRAppHost.Delegate {
override fun onScreenSizeChanged(size: SLRAppHost.SLRScreenSize) {
binding.playerView.updateLayoutParams<ConstraintLayout.LayoutParams> {
topMargin = size.topMargin
bottomMargin = size.bottomMargin
marginEnd = size.endMargin
marginStart = size.startMargin
width = size.playerMinWidth
height = size.playerHeight
verticalBias = size.verticalBias
}
binding.playerView.outlineProvider = object : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setRoundRect(0, 0, view.width, view.height, size.playerCornerRadius)
}
}
binding.playerView.clipToOutline = true
}
}Support
For GoogleTV / AndroidTV-specific issues or questions:
- Email: [email protected]
Related
- Android SDK Integration Guide — Full Android SDK setup and configuration
- Customizing Themes — Theme and style customization for Android
- Layout Guide — Portrait, landscape, and squeezeback layout setup
Updated 25 days ago
