Get Started

Welcome to the RTB-Stack SDK integration guide for Android applications. This document is designed to help developers seamlessly integrate the SDK into their Android apps. The RTB-Stack SDK offers a comprehensive suite of ad formats, including banner ads, interstitials, rewarded videos, and native ads, each tailored to provide a high-quality user experience while maximizing revenue potential. By following this guide, you will learn how to add the necessary dependencies to your project, configure your application's settings, and prepare your app to display various types of advertisements effectively. Let's begin by setting up the SDK in your Android project.

Add dependencies

RTB-Stack SDK is available on Maven Central Repository. RTB-Stack SDK requires play-services-ads-identifier library for operation. Add the following dependencies to your build.gradle file:

dependencies {
   implementation 'com.rtb-stack.sdk:sdk:0.1.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' }

Update AndroidManifest.xml

Add the following permissions to your AndroidManifest.xml file outside application tag:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

User’s location information allows to improve ad targeting. Add optional location permissions to AndroidManifest.xml file:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

RTB-Stack SDK shows in-app browser (WebView), interstitial and rewarded ad through a separate activity. Add the AdActivity to AndroidManifest.xml file:

<activity
    android:name="com.rtbstack.sdk.AdActivity"
    android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"/>

Next Steps: Create and Load Your First Ad

Now that you have successfully integrated the RTB-Stack SDK into your Android application, you are ready to create and load your first ad. Explore the various ad formats available to find the best fit for your app’s design and user experience. Proceed to the Ad Formats section for detailed instructions on implementing and optimizing each type of ad:

  • Banner Ad: Ideal for consistent visibility without interrupting the user experience.
  • Interstitial Ad: Best for transitional moments, offering full-screen engagement.
  • Rewarded Video Ad: Offers incentives to users for watching videos, enhancing engagement.
  • Native Ad: Seamlessly integrates with the app’s layout for a cohesive look.
  • Instream Video Ad: Suitable for video content, providing a natural viewing experience.

Choose the ad formats that align with your monetization strategy and enhance your application’s user experience.

General Information on Parameters Needed for Format Setup:

The Endpoint Request URL and Custom Tag ID are crucial configurations passed into the SDK to control ad behavior and track placements across all formats.

  • Endpoint Request URL: This URL specifies where the SSP (Supply-Side Platform) should send ad requests. You can retrieve it from the Edit Endpoint section in the RTB-Stack interface. Each app is associated with a single Endpoint.
  • Custom Tag ID/Publisher Tag ID: This is a randomly assigned string used for tracking and reporting. It can help you differentiate ad placements. Example for an interstitial ad: "Interstitial_Homepage_Promo".

Updated on October 31, 2024