Android SDK Configuration


Mobile Ads Settings

Before starting, first you must configure the SDK via EMASettings instance.

Required Parameters

Important Note: You must set the initial activity of your app by the following code:


Note: You have to set current activity with same code every time you changed activity.

If you have the user's consent on displaying non-personalized ads, you may set isAdsNonPersonalized to true.

Optional Parameters

Some properties of EMASettings are for testing and debugging purposes.

The optional parameters are:

  • isAdsDisabled: The default value is false. Set this value true if you don't want your users to see ads.
  • logLevel: the default value is LogLevel.NONE. Set this value to LogLevel.ALL to print out all debug messages.
  • testingType: The default value is AdTestingType.NONE. This may be used to test the DFP Banner Ads, DFP Interstitial Ads, AdMob Banner Ads, AdMob Interstitial Ads or IMA Preroll Ads. Please don't forget to remove this setting before submitting your app to the Google Play Store.
  • testDevies: If you'd like to test the ads via your device's testing id then add the value to this property. Please don't forget to remove this setting before submitting your app to Google Play Store!

Initializing the SDK

After configuring the SDK with at least the required parameters, you must call init method of EMAManager.instance, which initializes the SDK and sends a broadcast message of type EMAAdBroadcastType.ADS_READY_FOR_DISPLAY once the initialization is complete. This only needs to be done once, ideally at the application launch. Please also note that EMAManager.instance.isAdsReadyForDisplay is set to true once the initialiation process is completed.

aplication: Application class of the app.

appAdIdentifier: Your app idenfier which will be provided by us.

adAppVersion: ad version for the related app which is initially "1"

testMode(Optional): to enable debugging logs and test ads.

EMAManager.getInstance().init(this, appAdIdenfier, adAppVersion, testMode);
You can also add AppViewParserListener through EMAManager.instance.appViewParserListener property to listen sendAppView events with `onSuccessAppViewParse` and `onFailedAppViewParse`. Note that sendAppView may get called multiple times in one session.