Overview
Use the Adrop Android SDK to display various ad formats in your app.Supported Ad Formats
Requirements
- Android 6.0 (API Level 23) or higher
- Gradle 8.7 or higher
- Kotlin 2.1.0 or higher
- compileSdkVersion 34 or higher
- Jetpack (AndroidX) support
Prerequisites
1. Add adrop_service.json File
1
Download File
Download the
adrop_service.json file from Ad Control Console > Admin > App.2
Add to Project
Place the downloaded file in the
app/src/main/assets/ folder.2. Get Unit ID
Find the unit ID for your ad placement in the Ad Unit tab of the console.Installation
Gradle Setup
Settings.gradle.kts
Add the repository to your project-levelsettings.gradle.kts file:
Build.gradle.kts
Add the dependency to your app-levelbuild.gradle or build.gradle.kts file:
Check the latest version on Maven Central.
AndroidManifest.xml Setup
Add the App ID to yourAndroidManifest.xml for backfill ads:
AndroidManifest.xml
Please contact Adrop to get your App ID.
Initialization
Initialize the SDK in theonCreate() method of your Application class.
Initialization Parameters
User Settings
Set UID
Set a user identifier for targeted advertising.Set the UID before entering the ad placement for targeted ads to work properly.
Set Theme
Set the theme for ads that support dark mode. Must be called afterinitialize().
AUTO mode automatically detects the system dark mode setting. When the theme changes, the splash ad cache is automatically cleared.Deep Link Handling
Handle deep links when the app is launched via an external link.Test Unit IDs
Use test unit IDs during development. Replace with real unit IDs before production release.Banner Ads
Native Ads
Interstitial/Rewarded Ads
Popup Ads
Splash Ads
Error Codes
Error codes returned when ad loading or display fails.
For detailed descriptions, see the Reference.
Table of Contents
Banner Ads
Implement banner ads
Native Ads
Implement native ads
Interstitial Ads
Implement interstitial ads
Rewarded Ads
Implement rewarded ads
Popup Ads
Implement popup ads
Splash Ads
Implement splash ads
WebView Guide
Display web ads in WebView
Targeting
User properties and context targeting
Reference
Classes, listeners, and error codes
Examples
Example repository