Installation
Installation Methods
- Gradle
- Manual
Using Gradle/Maven
- Add the Teads repository to your
project/build.gradle: - Add the Teads SDK dependency to your
app/build.gradle: - Sync your project
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.2.3@aar") {
transitive = true
}
}
Huawei Device Compatibility
For Huawei devices, the Huawei repository is mandatory and included in the configuration above.
Download AAR File
For manual installation, you can download the latest TeadsSDK.aar:
- Download the latest TeadsSDK.aar from the Maven repository
- Copy it to your app's
libsfolder - Add to your
app/build.gradle:
dependencies {
implementation files('libs/sdk-6.2.3.aar')
}
Implementation Samples
The official Teads SDK sample application demonstrates best practices and integration examples.
SDK Initialization
Initialize the Teads SDK as early as possible in your app's lifecycle:
- Kotlin
- Java
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")
}
}
import tv.teads.sdk.TeadsSDK;
import com.outbrain.OBSDK.OutbrainException;
// Initialize the SDK with your partner key
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
try {
TeadsSDK.INSTANCE.configure(getApplicationContext(), "YOUR_PARTNER_KEY");
} catch (OutbrainException e) {
// Handle configuration error
}
}
}
TeadsSDK.configure with your partner key is required for Feed and Recommendations only.
Global Settings Configuration
The Teads SDK provides global settings that apply across all placements. Configure these settings after SDK initialization.
Test Mode
Enable test mode for detailed logging including viewability percentage and other diagnostic information:
- Kotlin
- Java
if (BuildConfig.DEBUG) {
TeadsSDK.testMode = true
TeadsSDK.testLocation = "us" // Optional: Test specific geolocations
}
if (BuildConfig.DEBUG) {
TeadsSDK.INSTANCE.setTestMode(true);
TeadsSDK.INSTANCE.setTestLocation("us"); // Optional: Test specific geolocations
}
Crash Monitoring
Crash monitoring is enabled by default. To disable:
- Kotlin
- Java
TeadsSDK.isCrashMonitoringEnabled = false
TeadsSDK.INSTANCE.setCrashMonitoringEnabled(false);
Settings
Find the full settings list for each placement in the Settings Configuration.
Event Handling
Use Placement Events. That page is the source for the delegate, event names, and the click-URL rule.
Best Practices
1. Placement Lifecycle Management
Media, Media Native and Interstitial placements
Call clean() when the host is destroyed. Each format page shows this on onDestroy.
Feed and Recommendations placements
For Feed and Recommendation placements, ensure you load only one ad instance per screen.
To prevent redundant ad requests during view recycling (RecyclerView) or recomposition (LazyList), cache the loaded ad by holding a strong lifecycle aware reference to it.
2. Error Handling
Handle TeadsAdPlacementEventName.FAILED on the unified delegate. See Placement Events.
Next Steps
- Review the Direct integration if you load ads with Teads SDK
- Review the Mediation guides if Teads is a demand source inside another mediation SDK
- Review the Prebid guides for header bidding
For additional support, see Support