Skip to content

Latest commit

 

History

History
77 lines (52 loc) · 1.98 KB

File metadata and controls

77 lines (52 loc) · 1.98 KB

Avocarrot Banner Ads Adapter for MoPub Android SDK

This is an adapter to be used in conjunction with the MoPub Android SDK.

Requirements

  • MoPub Android SDK v5.3.0 or later.
  • Avocarrot Android SDK v4.10.3 or later.

Instructions

Integrating Avocarrot Android SDK

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>

Setup MoPub Dashboard

Create an "Avocarrot" Network in MoPub's dashboard and connect it to your Ad Units.

  • In MoPub's dashboard select Networks > Add New network

_networks

  • Then select Custom Native Network

_add-new-network

  • For Native Ad Units you need complete the following:

_setup

Custom Event Class

com.mopub.mobileads.AvocarrotBanner

Custom Event Class Data

{"adUnit":"<AvocarrotAdUnit>"}

Get your adUnit from the Avocarrot dashboard.