This is an adapter to be used in conjunction with the MoPub Android SDK.
- MoPub Android SDK v5.3.0 or later.
- Avocarrot Android SDK v4.10.3 or later.
Add the compile dependency with the latest version of the Avocarrot adapter in the build.gradle
file:
repositories {
maven { url "https://s3.amazonaws.com/avocarrot-android-builds/dist" }
}
dependencies {
compile 'com.avocarrot.sdk:adapter-mopub-banner:1.4.15'
}
The Avocarrot SDK should be initialised and started before requiring for ads. To ensure that the metrics are not over-counted, it is highly recommended
that the Avocarrot SDK be called in the Application
class.
public class YourApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Avocarrot.onApplicationCreated(this);
//...
}
//...
}
Don't forget to add application name to your AndroidManifest.xml
file.
<application android:name=".YourApplication">
<!-- activities goes here -->
</application>
Create an "Avocarrot" Network in MoPub's dashboard and connect it to your Ad Units.
- In MoPub's dashboard select
Networks
>Add New network
- Then select
Custom Native Network
- For Native Ad Units you need complete the following:
Custom Event Class
com.mopub.mobileads.AvocarrotBanner
Custom Event Class Data
{"adUnit":"<AvocarrotAdUnit>"}
Get your adUnit from the Avocarrot dashboard.