Skip to main content

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.
The SDK will not work properly without the adrop_service.json file.

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-level settings.gradle.kts file:

Build.gradle.kts

Add the dependency to your app-level build.gradle or build.gradle.kts file:
Check the latest version on Maven Central.

AndroidManifest.xml Setup

Add the App ID to your AndroidManifest.xml for backfill ads:
AndroidManifest.xml
Please contact Adrop to get your App ID.

Initialization

Initialize the SDK in the onCreate() method of your Application class.

Initialization Parameters

If your adrop_service.json contains multiple app configurations, use tokenKey to specify which key to use for initialization.
Make sure to set production = true before release. Ads will not be displayed if set to false in production.

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 after initialize().
AUTO mode automatically detects the system dark mode setting. When the theme changes, the splash ad cache is automatically cleared.

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.

Native Ads

Interstitial/Rewarded 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