Mopub Android Adapter


 This document describes the procedure for serving (Formerly StartApp) Ads in your application using MoPub as the mediation network

  • The code samples in this document can be copy/pasted into your source code
  • Feel free to take a look at our Sample Project to help you during the integration process
  • If you have any questions, contact us via


Pre-Integration Assumptions:

MoPub is set as your mediation network

The following manual assumes that you are already familiar with the MoPub Mediation Network and have already integrated the MoPub Android SDK into your application with at least one Ad Unit. 
Otherwise, please start by reading the following articles for a walk-through explanation of what mediation is, how to use the MoPub Mediation UI, and instructions on how to add MoPub mediation code into your app.

You application is defined in your Account

At this point we assume that you have already added your application to your (Formerly StartApp) account, in case you haven't, please follow the next steps:

  1. Login into your Publisher's account
  2. Add your application and get its App ID
  3. Download the In-App SDK

For any questions or difficulties during this process, please contact us via

You have integrated the In-App SDK V.4.6.0 and up, as well as your desired Ad Formats.

Before you can integrate the mediation adapter, you need to make sure you have integrated the (Formerly StartApp) SDK V.4.6.0 or up, as well as the Ad Formats you wish to monetize. 

In case you haven't, please start from the steps described on the following SDK integration guide

  • Note that this MoPub adapter is only compatible from SDK V.4.6.0


Step 1, Integrating the MoPub Mediation Adapter

You can add the MoPub adapter via Gradle jCenter dependency 

implementation 'com.startapp:inapp-sdk:4.+'
implementation 'com.startapp:mopub-mediation:3.+'

Another option to integrate the Adapter is through .java files:'s MoPub Adapter is available on open source from GitHub.

  • Please use only one of the options mentioned above 

Step 2, SDK Initialization

There are two options for Initializing the (Formerly StartApp) SDK while using MoPub as mediation, please select only one: 

  1. Option 1: Preferred and more robust way is passing your startapp appId to the MoPub custom event interface the optional parameter - 'startappAppId'
  2. Option 2: Initialize Start.op (Formerly StartApp) sdk from the code. For this case just add a few lines which include your appId to the MoPub's SdkConfiguration object
    final SdkConfiguration configuration = new SdkConfiguration.Builder(getString(R.string.mopubId))
    .withMediatedNetworkConfiguration(StartappConfig.class.getName(), Collections.singletonMap("startappAppId", "your_app_id_from_portal"))



Step 3, Configure MoPub Mediation Settings

  • Login into your MoPub account
  • Navigate to "Orders" tab and click "Create Order"
  • After Saving Create your Line Item and set it up to Type: "Network Line Item"


In this section, based on the Ad Units you wish (Formerly StartApp) to monetize add the relevant information (you would need to create one Line Item per each Ad Unit).

 Under the "Custom event data" section:

Ad Type Custom event class Custom event data Options
Fullscreen com.mopub.mobileads.StartappAdapter {"startappAppId":"your_id_from_portal", "adTag":"any_your_tag", "interstitialMode":"OVERLAY", "minCPM":0.03, "muteVideo":false} interstitialMode can be OVERLAY, VIDEO or OFFERWALL
Banner/Medium Rectangle com.mopub.mobileads.StartappAdapter {"startappAppId":"your_id_from_portal", "adTag":"any_your_tag", "minCPM":0.03, "is3DBanner":false}  
Rewarded com.mopub.mobileads.StartappAdapter {"startappAppId":"your_id_from_portal", "adTag":"any_your_tag", "minCPM":0.03, "muteVideo":false}  
Native com.mopub.nativeads.StartappNative {"startappAppId":"your_id_from_portal", "adTag":"any_your_tag", "minCPM":0.03, "nativeImageSize":"SIZE340X340", "nativeSecondaryImageSize":"SIZE72X72"} nativeImageSize and nativeSecondaryImageSize can be any of SIZE72X72, SIZE100X100, SIZE150X150, SIZE340X340, SIZE1200X628(for main image only)

Step 4, MoPub Ad Unit Advanced Configuration via Code 

There are several parameters for each Ad Unit which can be configured from the MoPub portal as described on section 3 or though code as described on this section.

All parameters mentioned below are optional and should be set based on your monetization strategy and criteria.

  • Everything defined from the MoPub Portal will override the parallel configuration made through the code.
  • All configurable parameters must be set in Json format and under the relevant custom event class, note that you can choose to configure non to any of the available parameters.

Interstitial Settings

final Map<String, Object> extras = new StartappExtras.Builder()


Banner Settings

final Map<String, Object> extras = new StartappExtras.Builder()


Rewarded Video Settings

final StartappAdapter.Extras.LocalExtras extras = new StartappAdapter.Extras.Builder()
MoPubRewardedVideos.loadRewardedVideo(getResources().getString(R.string.rewardedId), extras);

Native Ad Settings

final Map<String, Object> extras = new StartappExtras.Builder()


Step 6, Testing Your Integration


Congratulation - that's it! You may now run your app and see (Formerly StartApp) ads in action.