androidAndroid SDK

The Metica Ads SDK for Android enables developers to integrate advertising into Android applications with support for interstitial, rewarded, banner, and MREC ad formats.

Requirements

  • Android API 21 (Android 5.0) or higher

  • Kotlin 1.8+

  • AppLovinSDK dependency (version 13.0.0 or higher, managed by Metica SDK)

  • Valid Metica API credentials (API key, App ID)

  • AppLovin SDK Key from AppLovin Dashboardarrow-up-right under "SDK Key"

circle-exclamation

Download

The Metica Android SDK is distributed via Maven Central. You can find the latest version and version history at:

Maven Central - com.metica:metica-sdkarrow-up-right

Installation

Add the Metica SDK dependency to your app's build.gradle.kts or build.gradle

build.gradle.kts
dependencies {
    implementation("com.metica:metica-sdk:<version>")
}

Make sure you have Maven Central in your repositories:

Callback Interfaces

The SDK uses callback interfaces to communicate events back to your application.

MeticaInitCallback

Triggered when SDK initialization completes.

MeticaAdsLoadCallback

Handles ad loading events.

MeticaAdsShowCallback

Manages display lifecycle events for fullscreen ads.

MeticaAdsAdViewCallback

Handles banner and MREC ad view events. Extends MeticaAdsLoadCallback.

Privacy Configuration

Set privacy controls before initialization for GDPR and CCPA compliance:

Supported Ad Formats

Format
Enum
Dimensions

Interstitial

INTER

Full-screen

Rewarded

REWARD

Full-screen video

Banner

BANNER

320x50 (adaptive)

MREC

MREC

300x250


SDK Initialization

Initialize the SDK once during application startup, before loading any ads.

Initialization Response

The MeticaInitResponse contains a smartFloors object with two properties:

  • userGroup – The experiment group assigned to the current user: either TRIAL or HOLDOUT. This determines which cohort the user belongs to for A/B testing purposes.

  • isSuccess – A boolean indicating whether initialization completed successfully. If this is false, the user is automatically assigned to the holdout group.

circle-info

These values are provided solely for analytics and logging. You do not need to implement any fallback logic—the SDK handles group assignment internally regardless of initialization outcome.

Using Kotlin Lambda


Interstitial Ads

Full-screen ads that cover the app interface.


Rewarded Ads

Full-screen video ads that reward users upon completion.


Small rectangular ads (320x50) that remain on screen.


MREC Ads

Medium Rectangle ads (300x250).


Revenue Tracking

Track ad revenue for analytics and attribution.

MeticaAd Properties

Property
Type
Description

adUnitId

String

Unique identifier for the ad unit

revenue

Double?

Revenue in USD

networkName

String?

Ad network that served the ad

placementTag

String?

Placement identifier (if set)

adFormat

String

Format type (INTER, REWARD, BANNER, MREC)

creativeId

String?

Creative identifier

latency

Long?

Load latency in milliseconds


Access AppLovin-specific consent information via MeticaSdk.Ads.Max:


Debug Logging

Enable logging for development and debugging:

Or via ADB:

Look for "Metica" tag in Logcat.


Best Practices

1

Initialize Early

Call MeticaSdk.initialize() as early as possible, ideally in Application.onCreate() or MainActivity.onCreate().

2

Set Privacy Before Init

Always configure privacy settings before calling initialize:

3

Preload Ads

Load the next ad immediately after showing:

4

Check Readiness Before Showing

5

Pass Activity Context

Always pass the current Activity when showing fullscreen ads:

6

Clean Up Banner/MREC Views

7

Handle Lifecycle for Ad Views

8

Implement Retry with Backoff

Use exponential backoff for failed loads to avoid overwhelming the network:


Thread Safety

All callbacks are delivered on the same thread that made the original call. If you call from the main thread, callbacks arrive on the main thread - safe for UI updates:


Complete Example

A complete activity demonstrating all features.


API Reference

MeticaSdk

Method
Description

initialize(context, initConfig, mediationInfo, callback)

Initialize the SDK

Ads

Access to ad functionality

MeticaSdk.Ads

Method
Description

loadInterstitial(adUnitId, callback)

Load an interstitial ad

showInterstitial(activity, adUnitId, placementId?, customData?, callback)

Show an interstitial ad

isInterstitialReady(adUnitId): Boolean

Check if interstitial is ready

loadRewarded(adUnitId, callback)

Load a rewarded ad

showRewarded(activity, adUnitId, placementId?, customData?, callback)

Show a rewarded ad

isRewardedReady(adUnitId): Boolean

Check if rewarded is ready

createBannerAdView(adUnitId): MeticaAdView

Create a banner ad view

createMrecAdView(adUnitId): MeticaAdView

Create an MREC ad view

Max

AppLovin-specific functions

MeticaAds.PrivacySettings

Method
Description

setHasUserConsent(isConsent, context)

Set GDPR consent

setDoNotSell(isDoNotSell, context)

Set CCPA do-not-sell

MeticaAdView

Method
Description

setListener(callback)

Set the callback for ad events

setPlacement(placement?)

Set placement for analytics

load()

Load the ad

startAutoRefresh()

Start auto-refresh

stopAutoRefresh()

Stop auto-refresh

destroy()

Clean up resources

Last updated

Was this helpful?