Skip to main content

Settings Configuration

info

Settings Overview: This page covers all configuration settings available in the Teads SDK for Android, organized by placement type and use case.

TeadsSDK

NameTypeField/MethodDescription
sdkVersionStringFieldCurrent TeadsSDK Version value in semver format (read-only)
testModeBooleanFieldTest mode flag. Set to true to activate test mode [All placements], false to deactivate. Prevents operational actions such as reporting and billing and increases logging level visibility [Feed, Recommendations]
testLocationString?FieldTest location for Geo simulation (country code, e.g., "us"). Causes all requests [Feed, Recommendations] to include the "location" param
isCrashMonitoringEnabledBooleanFieldControls whether crash monitoring is enabled for the Teads SDK [Media, Media Native]. When enabled, the SDK will collect and report crash information. True by default
configure(applicationContext: Context, appKey: String)UnitMethodInitialize the Teads SDK [Feed, Recommendations]. Call this in Application.onCreate to increase launch speed and load ads faster.
isSDKConfigured(): BooleanBooleanMethodChecks whether the SDK was already initialized.
setIronSourceIntegration()UnitMethodSets IronSource integration for publisher apps running on Aura platform. Must be called BEFORE configure().
createPlacement<PlacementType>(context: Context, config: Any, delegate: TeadsAdPlacementEventsDelegate?)PlacementTypeMethodGeneric method to create ad placements ((Feed, Media, MediaNative, Recommendations)) based on their config type.
createInReadPlacement(context: Context, pid: Int, placementSettings: AdPlacementSettings)TeadsInReadAdPlacementMethodCreates a legacy inRead placement - Teads flagship format that positions video ads within editorial content.
createNativePlacement(context: Context, pid: Int, placementSettings: AdPlacementSettings)TeadsNativeAdPlacementMethodCreates a legacy inFeed Native placement - ads placed between feed content that mimic page look & feel.
createPrebidPlacement(context: Context, placementSettings: AdPlacementSettings)TeadsPrebidAdPlacementMethodCreates a PrebidAdPlacement that wraps a legacy inRead placement with prebid capabilities.

TeadsAdPlacementMedia

ConfigurationTypeDescription
pidIntPublisher ID from your publisher manager
articleUrlUri?URL of the article where the ad will be displayed. Provides context for brand safety purposes
enableValidationToolBooleanEnable the Validation Tool mode for testing and debugging ad placements

TeadsAdPlacementMediaNative

ConfigurationTypeDescription
pidIntPublisher ID from your publisher manager
articleUrlUri?URL of the article where the ad will be displayed. Provides context for brand safety purposes
mediaScaleMediaScale?Set how the MediaView fits on its container. Works for images only on inFeed native creatives. Options: CENTER_CROP (default), CENTER_INSIDE

TeadsAdPlacementFeed

NameTypeField/MethodDescription
articleUrlUriFieldURL of the article where the feed will be displayed
widgetIdStringFieldWidget identifier
installationKeyStringFieldInstallation key for your app
widgetIndexIntFieldIndex of the widget in the feed
userIdString?FieldOptional user identifier for personalization
darkModeBooleanFieldEnable dark mode theme for the feed widget
testDisplayBooleanFieldEnable test display mode for debugging
extIdString?FieldOptional external identifier
extSecondaryIdString?FieldOptional secondary external identifier
obPubImplString?FieldOptional publisher implementation identifier
handleExploreMore(activity: Activity, onExploreMoreDismissed: Runnable)UnitStatic MethodThis method allows apps developers to handle explore more functionality.

TeadsAdPlacementRecommendations

NameTypeField/MethodDescription
articleUrlUriFieldURL of the article for which recommendations will be fetched
widgetIdStringFieldWidget identifier
widgetIndexIntFieldIndex of the widget (default: 0)
getUrl(rec: OBRecommendation): String?String?Static MethodMaps the given recommendation to the redirect URL for paid recommendations or original URL for organic ones. For organic recommendations, click registration is handled automatically.
getAdChoicesURL(): StringStringStatic MethodReturns the URL to open in external browser when user taps on ad choices logo. Contains Advertiser ID param required for Ad Choices opt-out compliance.
setTestRTB(isTestRTB: Boolean)UnitStatic MethodActivates/deactivates RTB recommendations simulation. When true, forces every response to include at least 1 RTB recommendation.
configureViewabilityPerListingFor(viewGroup: ViewGroup, rec: OBRecommendation)UnitStatic MethodConfigures viewability monitoring on a per-listing basis for regular widgets. SDK will monitor and report viewability events automatically.
configureViewabilityPerListingFor(outbrainRecContainer: OBFrameLayout, rec: OBRecommendation)UnitStatic MethodConfigures viewability monitoring on a per-listing basis for regular widgets using OBFrameLayout container.

TeadsMediationSettings

NameTypeField/MethodDescription
enableDebug()UnitMethodEnable debug logging.
enableLocation()UnitMethodEnable location.
useLightEndScreen()UnitMethodAllow Teads SDK to display the end screen with light color.
userConsent(subjectGdpr: String, consent: String, tcfVersion: TCFVersion, cmpSdkId: Int)UnitMethodThe GDPR consent and status, should match the IAB specifications.
setUsPrivacy(usPrivacy: String)UnitMethodThe CCPA consent string, should match the IAB specifications.
setGppConsent(consent: String, sectionIds: String)UnitMethodThe GPP consent and applicable section ids, should match the IAB specifications.
disableCrashMonitoring()UnitMethodDisable crash monitoring that collects crashes on Teads SDK by default.
hideBrowserUrl()UnitMethodHide the website url in the internal browser only. The url is visible by default.
toolBarBackgroundColor(color: int)UnitMethodSet the given toolbar background color on the browser.
pageSlotUrl(url: String)UnitMethodProvide context for brand safety purposes.
enableValidationMode()UnitMethodEnable the Validation Tool mode.
addPlacementExtra(key: String, value: String)UnitMethodAdd the given extra to your placement settings data.
addExtra(key: String, value: String)UnitMethodAdd the given extra to your request settings data.
setMediationListenerKey(key: Int)UnitMethodUsed to retrieve the TeadsAdapterListener.
setMediaScale(mediaScale: MediaScale)UnitMethodSet how the MediaView fits on its container. Works for images only on inFeed native creatives.

MediaScale Enum Values

ValueDescription
CENTER_CROPScales the image uniformly (maintaining the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view
CENTER_INSIDEScales the image uniformly (maintaining the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view

Best Practices

Production Settings

  • Remove enableValidationMode() before production
  • Remove testing configurations in production builds
  • Ensure proper privacy consent is configured
  • Set appropriate url for brand safety
  • Use production placement IDs and installation keys

Testing Settings

  • Use enableValidationMode() for integration testing
  • Use testing configurations for development and debugging
  • Test with different privacy consent scenarios
  • Verify settings work across all placement types
  • Use test placement IDs and installation keys

Performance Optimization

  • Initialize SDK early in application lifecycle
  • Use appropriate placement lifecycle management
  • Monitor memory usage and performance