Skip to main content

Getting Started

info

Welcome to Teads SDK - The next generation of mobile monetization combining Teads' premium video advertising with Outbrain's content recommendation capabilities in a single, powerful SDK.

Introduction

This document describes the Teads SDK for Android. Following the strategic merger of Teads and Outbrain, we've created a unified SDK that provides seamless access to both premium video advertising and content recommendation capabilities through a modern, unified interface.

The Teads SDK is designed for Android developers who want to:

  • Display premium video advertisements within their content
  • Show content recommendation widgets to increase user engagement
  • Monetize their apps with a single, comprehensive solution

Compatibility and Requirements

The Teads SDK is a modern framework designed for Android 12.0 and above, with support for both UIKit and SwiftUI applications.

Teads SDKRequirements
Android APIAPI 21+ (Android 5.0+)
Gradle7.0+
Kotlin1.6+ (Optional)
Java8+
SDK SizeTeadsSDK adds less than 1.3MB to your Android release app.
UI FrameworksXML (Compatible with Composables through Jetpack Compose's interoperability APIs)

Key Features

The Teads SDK provides a comprehensive solution for mobile app monetization:

Unified Interface

  • Single SDK for both video ads and content recommendations
  • Consistent API design across all placement types
  • Simplified integration process with fewer dependencies

Placement Types

  1. Media Placement - Premium video advertising (formerly Teads InRead)
  2. Media Native Placement - Native video advertising with custom layouts
  3. Feed Placement - Content recommendations widget (formerly Outbrain Widget)
  4. Recommendations Placement - Programmatic content recommendations API

Advanced Features

  • IAB Open Measurement Certified - Full viewability measurement support
  • Privacy-First Design - Built-in GDPR, CCPA, and GPP compliance
  • Brand Safety - Integrated Grapeshot framework for contextual brand safety
  • Mediation Support - Compatible with Google Ad Manager, AdMob, AppLovin MAX, and Smart AdServer
  • Performance Optimized - Lightweight with minimal impact on app performance

Installation

The Teads SDK can be integrated using multiple methods:

Gradle

project/build.gradle

repositories {
maven { url "https://teads.jfrog.io/artifactory/SDKAndroid-maven-prod" }
maven {
// Mandatory for Huawei device compatibility
url "https://developer.huawei.com/repo/"
}
}

app/build.gradle

dependencies {
implementation("tv.teads.sdk.android:sdk:6.x.x@aar") {
transitive = true
}
}

Manual Installation

  1. Download the latest TeadsSDK .aar file
  2. Copy it to your app's libs folder
  3. Add to your build.gradle:
dependencies {
implementation files('libs/sdk-6.x.x.aar') {
transitive = true
}
}

For detailed installation instructions, see Installation.

SDK Initialization

Initialize the Teads SDK as early as possible in your app's lifecycle:

import tv.teads.sdk.TeadsSDK

// Initialize the SDK with your partner key
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()

TeadsSDK.configure(applicationContext, "YOUR_PARTNER_KEY")
}
}
info

Important: Calling the method the TeadsSDK.configure with your YOUR_PARTNER_KEY is mandatory when using the Feed or Recommendations placements. Otherwise, you can skip this part.

Test Mode

Enable test mode during development to prevent real ad serving and billing:

// Enable test mode for development
if (BuildConfig.DEBUG) {
TeadsSDK.testMode = true
TeadsSDK.testLocation = "us" // Optional: Test specific geolocations
}
warning

Important: Always disable test mode before releasing your app to the App Store. Test mode is for development and testing only.

Quick Start Examples

Media Placement (Video Ads)

Display premium video advertisements within your content:

import tv.teads.sdk.combinedsdk.adplacement.TeadsAdPlacementMedia
import tv.teads.sdk.combinedsdk.adplacement.config.TeadsAdPlacementMediaConfig
import tv.teads.sdk.combinedsdk.adplacement.interfaces.TeadsAdPlacementEventsDelegate
import tv.teads.sdk.combinedsdk.TeadsAdPlacementEventName
import android.net.Uri

class ContentActivity : AppCompatActivity(), TeadsAdPlacementEventsDelegate {

private var mediaPlacement: TeadsAdPlacementMedia? = null
private lateinit var binding: ActivityArticleBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityArticleBinding.inflate(layoutInflater)
setContentView(binding.root)

setupMediaPlacement()
}

private fun setupMediaPlacement() {
// Create configuration
val config = TeadsAdPlacementMediaConfig(
pid = 84242, // Your unique Placement ID
articleUrl = Uri.parse("https://yoursite.com/article")
)

// Create placement with delegate
mediaPlacement = TeadsAdPlacementMedia(
this, // Context
config, // Placement config
this // Event delegate
)

// Load the ad
val mediaAdView = mediaPlacement?.loadAd()

// Add to your view hierarchy
binding.myContainerAdView.addView(mediaAdView)
}

override fun onPlacementEvent(
placement: TeadsAdPlacement<*, *>,
event: TeadsAdPlacementEventName,
data: Map<String, Any>?
) {
// Listen the ad lifecycle events
}

override fun onDestroy() {
super.onDestroy()
teadsAdPlacementMedia?.clean()
}
}

Feed Placement (Content Recommendations)

Display content recommendation widgets:

import tv.teads.sdk.combinedsdk.adplacement.TeadsAdPlacementFeed
import tv.teads.sdk.combinedsdk.adplacement.config.TeadsAdPlacementFeedConfig
import tv.teads.sdk.combinedsdk.adplacement.interfaces.TeadsAdPlacementEventsDelegate
import tv.teads.sdk.combinedsdk.TeadsAdPlacementEventName
import android.net.Uri

class ContentActivity : AppCompatActivity(), TeadsAdPlacementEventsDelegate {

private var feedPlacement: TeadsAdPlacementFeed? = null
private lateinit var binding: ActivityContentBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityContentBinding.inflate(layoutInflater)
setContentView(binding.root)

setupFeedPlacement()
}

private fun setupFeedPlacement() {
// Create configuration
val config = TeadsAdPlacementFeedConfig(
articleUrl = Uri.parse("https://yoursite.com/article"),
widgetId = "MB_1", // Your unique Placement ID
installationKey = "YOUR_INSTALLATION_KEY",
widgetIndex = 0,
userId = null, // Optional user ID for personalization
darkMode = false,
testDisplay = false,
extId = null, // External ID
extSecondaryId = null, // External Secondary ID
obPubImpl = null // OB Publisher Implementation
)

// Create placement
feedPlacement = TeadsAdPlacementFeed(
this, // Context
config, // Placement config
this // Event delegate
)

// Load the feed
val feedView = feedPlacement?.loadAd()

// Add to your view hierarchy
binding.myContainerAdView.addView(feedView)
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
feedPlacement?.onActivityConfigurationChanged()
}

override fun onPlacementEvent(
placement: TeadsAdPlacement<*, *>,
event: TeadsAdPlacementEventName,
data: Map<String, Any>?
) {
// Listen the ad lifecycle events
if (placement is TeadsAdPlacementFeed && event == TeadsAdPlacementEventName.CLICKED_ORGANIC) {
val url = data?.get("url") as? String
url?.let {
// Programmatically open browser with the url
}
}
}
}

Next Steps

Now that you have the basics set up, explore these comprehensive guides:

Detailed Integration Guides

  1. Integration Guide - Step-by-step integration instructions
  2. Privacy & Compliance - GDPR, CCPA, and consent management

Migration Guides

Advanced Features

Support and Resources

📞 Get Help


tip

Ready to get started? Follow the Integration Guide for detailed step-by-step instructions on implementing the Teads SDK in your Android application.