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.
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' }
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"/>
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:
Choose the ad formats that align with your monetization strategy and enhance your application’s user experience.
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.