Configuration
This guide explains how to initialize and configure the Empower Mobile Ads SDK in your application.
User Consent (UMP)
The SDK ships a built-in Google UMP integration. Call EMAManager.requestConsent(activity) on your launch activity, then call EMAManager.init(...) from its callback. The helper shows the consent form when required (GDPR regions) and skips it everywhere else. The callback always fires, even on UMP errors, so you can chain init(...) from it unconditionally.
- Kotlin
- Java
EMAManager.requestConsent(this) {EMAManager.init(EMAConfiguration.Builder(application, "YOUR_APP_AD_IDENTIFIER").build())}
Once consent is resolved, the SDK handles it automatically. You don't need to bridge consent to any ad network yourself.
Privacy Settings button
Users in regulated regions must be able to change their consent later. Add a button in your settings screen that calls showPrivacyOptionsForm(), and only show it when isPrivacyOptionsRequired() returns true:
- Kotlin
- Java
if (EMAManager.isPrivacyOptionsRequired(context)) {privacySettingsButton.isVisible = trueprivacySettingsButton.setOnClickListener {EMAManager.showPrivacyOptionsForm(this)}}
:::note
If your app already runs Google UMP or another IAB-compliant CMP, skip EMAManager.requestConsent() and just call EMAManager.init(...) from your own consent callback. The SDK will read automatically. In that case also use your CMP's own privacy options entry point instead of showPrivacyOptionsForm().
:::
SDK Initialization
Initialize the SDK after consent is obtained. The recommended approach is in your launch activity's consent callback.
Basic Initialization
- Kotlin
- Java
EMAManager.init(application = this,appAdIdentifier = "YOUR_APP_AD_IDENTIFIER")
:::caution Important
Replace YOUR_APP_AD_IDENTIFIER with the app identifier provided by Empower.
:::
Advanced Initialization with Configuration
For more control over the SDK behavior, use the EMAConfiguration builder:
- Kotlin
- Java
val configuration = EMAConfiguration.Builder(application = this,appAdIdentifier = "YOUR_APP_AD_IDENTIFIER").debugMode(BuildConfig.DEBUG).logLevel(LogLevel.DEFAULT).build()EMAManager.init(configuration)
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
debugMode | Boolean | false | Enables verbose logging for debugging. Disable in production. |
logLevel | LogLevel | NONE | Controls the verbosity of SDK logs. |
nonPersonalizedAds | Boolean | false | When true, serves only non-personalized ads (GDPR compliance). |
Log Levels
| Level | Description |
|---|---|
ALL | Logs all messages including debug information |
DEFAULT | Logs general information and errors |
ERROR | Logs errors only |
WARNING | Logs warnings and errors only |
NONE | Disables all logging |
Register Your Application Class
If you initialize the SDK in an Application class, ensure it is registered in AndroidManifest.xml:
<manifest><applicationandroid:name=".MyApplication"...></application></manifest>
Automatic Ad Queueing
All ad types (banner, interstitial, rewarded, app open) automatically queue if called before SDK initialization completes. You can safely load ads immediately after calling init():
- Kotlin
- Java
EMAManager.init(this, "YOUR_APP_AD_IDENTIFIER")// These calls are safe immediately after init()// They will queue and execute once SDK is readyEMAManager.loadInterstitialAd("interstitial_zone_id")EMAManager.loadRewardedAd("rewarded_zone_id")EMAManager.loadAppOpenAd("app_open_zone_id")
Listening for SDK Ready State (Optional)
If you need to know exactly when the SDK is ready (for analytics, UI updates, etc.), implement EMASdkReadyListener:
- Kotlin
- Java
class MyApplication : Application(), EMASdkReadyListener {override fun onCreate() {super.onCreate()EMAManager.setSdkReadyListener(this)EMAManager.init(this, "YOUR_APP_AD_IDENTIFIER")}override fun onReady() {// SDK is initialized and ready to load ads}override fun onFailed(error: Throwable?) {// SDK initialization failed}}
:::note
This listener is optional. Since all ad types automatically queue, you don't need to wait for onReady() before loading ads.
:::
Disabling Ads at Runtime
If you need to temporarily stop serving ads without tearing down the SDK (e.g., a feature flag or a user toggle), set EMASettings.isAdsDisabled to true. The SDK stays initialized, so flipping it back to false resumes ads immediately. No re-initialization required.
- Kotlin
- Java
// Stop serving ads without shutting down the SDKEMASettings.isAdsDisabled = true// Resume ads laterEMASettings.isAdsDisabled = false
:::tip
Use this for short-lived toggles. For permanent shutdown (e.g., user purchased premium and you want to release all SDK resources), use shutdown() below.
:::
Shutdown
Use shutdown() when you no longer want to show ads (e.g., user bought premium):
- Kotlin
- Java
// Stop all adsEMAManager.shutdown()// Reinitialize when you want to show ads againEMAManager.init(application, "YOUR_APP_AD_IDENTIFIER")