Integrate with MoPub

If you already have MoPub ads serving in your app, but want to integrate AwesomeAds as well, without having to directly use the Android Publisher SDK, you can follow the steps below:

Add the MoPub plugin

You can either change your module’s build.gradle file (usually the file under MyApplication/app/) to the following format:

repositories {
    maven {
        url  ""

dependencies {
    # add the Android Publisher SDK
    compile 'tv.superawesome.sdk.publisher:superawesome:7.0.1'

    # add MoPub plugin
    compile 'tv.superawesome.sdk.publisher:samopub:7.0.1'

You can also download the MoPub adapter as a .jar archive, from here

Setup MoPub Custom Networks

Login to the MoPub dashboard using your preferred account.

From here forward the tutorial assumes you have an Android app with three ad units setup in MoPub; one banner, one interstitial ad and one rewarded video ad:


From your MoPub admin interface you should create a New Network


From the next menu, select Custom Native Network


You’ll be taken to a new page. Here select the title of the new network


And assign custom inventory details for Banner, Interstitial and Video ads:


Notice that the custom event classes required by MoPub are:

  • for Banner Ads:
  • for Interstitial Ads:
  • for Rewarded Video Ads:

Finally, you can tell MoPub what AwesomeAds ads to load and how to display them by filling out the custom event class data field with a JSON similar to this:

    "placementId": 30473,
    "isTestEnabled": true or false,
    "isParentalGateEnabled": true or false,
    "orientation": "ANY" or "PORTRAIT" or "LANDSCAPE",
    "shouldShowCloseButton": false or false,
    "shouldAutomaticallyCloseAtEnd": true or false,
    "shouldShowSmallClickButton": true or false

Implement MoPub ads in your Android app

Once the previous steps are done, you can add MoPub banners, interstitials and rewarded video ads just as you normally would:

// create banner ad
MoPubView banner = (MoPubView) findViewById(;

// create interstitial
MoPubInterstitial interstitial = new MoPubInterstitial(this, "_AD_UNIT_ID_");

// create video

Since the previously created custom events will run on these ads, and the Android Publisher SDK is integrated alongside the MoPub plugin, you should start seeing ads playing.