Integration with MoPub
The banners and interstitial of the AppBrain SDK can easily be integrated in the MoPub mediation solution.
Setting up your app for mediation
First make sure you added the AppBrain SDK to your app, follow the general installation instructions on the SDK setup page.
Then add the AppBrain MoPub library to your project. If you use Gradle to build your project, and you have already added the AppBrain repository as described in SDK setup, you can simply add the dependency:
dependencies {
implementation 'com.appbrain:appbrain-sdk:+'
implementation 'com.appbrain:appbrain-sdk-mopub:+'
}
If you don’t use Gradle, you can add the appbrain-mopub.jar
file to your project’s libs/
folder manually. This file can be downloaded from the AppBrain SDK GitHub page.
MoPub SDK initialization
In the initialization for the MoPub SDK the AppBrain SDK needs to be registered. For example like this:
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder("<your ad id>")
.withAdditionalNetwork(AppBrainMoPubConfiguration.class.getName())
.withMediatedNetworkConfiguration(AppBrainMoPubConfiguration.class.getName(), Collections.emptyMap())
.build();
MoPub.initializeSdk(this, sdkConfiguration, initSdkListener());
More information about the MoPub SDK initialization is in the Initialize Custom Ad Networks section of the MoPub SDK documentation.