Custom Events - mobfox/MobFox-Android-SDK GitHub Wiki

Once a custom event is set up for a specific network, MobFox banners, interstitials and natives will get ads from that network in addition to ads from MobFox, increasing your fill rate.

Ad Network Banner Interstitial Native
MoPub Yes Yes Yes
AdMob Yes Yes Yes
Smaato - - -
DFP Yes Yes -
AppLovin - Yes -
Chartboost - Yes -
AdColony - Yes -
Supersonic - Yes -
Vungle - Yes -
Woobi - Yes -
Facebook Yes Yes -
Amazon Yes Yes -
Millenial Yes Yes -
Startapp Yes Yes -

MoPub

  1. Install the MobFox Android SDK Core.
  2. Install the MoPub Android SDK.
  3. Place the MobFox-Android-MoPub-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup MoPub Custom Events in your MobFox control panel.
  5. Integrate the Banner ,Interstitial or Native you created previously and load it - you should get an ad from the referred MoPub AdUnit.

AdMob

  1. Install the MobFox Android SDK Core.
  2. Install the AdMob Android SDK.
  3. Place the MobFox-Android-AdMob-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup AdMob Custom Events in your MobFox control panel.
  5. Integrate the Banner, Interstitial or Native ads you created previously and load it - you should get an ad from the referred AdMob AdUnit.
  6. When expecting an AdMob Native ad please follow these instructions:
  • Create a new layout in your res/layout folder. Call it ad_app_installed.
  • The layout's root element must be com.google.android.gms.ads.formats.NativeAppInstallAdView.
  • View components containing id's will be set with respected values if available.
  • Recommended layout (optional):

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.gms.ads.formats.NativeAppInstallAdView
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:background="#FFFFFF"
        android:minHeight="50dp"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:paddingTop="3dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/appinstall_app_icon"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:adjustViewBounds="true"
                    android:paddingBottom="5dp" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/appinstall_headline"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="14sp"
                        android:textStyle="bold" />

                    <RatingBar
                        android:id="@+id/appinstall_stars"
                        style="?android:attr/ratingBarStyleSmall"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:isIndicator="true"
                        android:numStars="5"
                        android:stepSize="0.5" />
                </LinearLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/appinstall_body"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="20dp"
                    android:textSize="12sp" />

                <ImageView
                    android:id="@+id/appinstall_image"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:maxHeight="150dp"
                    android:paddingTop="5dp" />

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:orientation="horizontal"
                    android:paddingBottom="10dp"
                    android:paddingTop="10dp">

                    <TextView
                        android:id="@+id/appinstall_price"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:paddingRight="5dp"
                        android:textSize="12sp" />

                    <TextView
                        android:id="@+id/appinstall_store"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:paddingRight="5dp"
                        android:textSize="12sp" />

                    <Button
                        android:id="@+id/appinstall_call_to_action"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:textSize="12sp" />
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
</com.google.android.gms.ads.formats.NativeAppInstallAdView>
  • In you application's layout add a container for the Native ad (FrameLayout - recommended).
    id must be fl_adplaceholder:

<FrameLayout
        android:id="@+id/fl_adplaceholder"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp" />
  • Finally, in your activity, pass the container to event.registerViewForInteraction:
@Override
public void onNativeReady(Native aNative, CustomEventNative event, NativeAd ad) {
   // ...
   FrameLayout fl_adplaceholder = (FrameLayout) findViewById(R.id.fl_adplaceholder);
   event.registerViewForInteraction(fl_adplaceholder);
   // ...
}

DFP

  1. Install the MobFox Android SDK Core.
  2. Install the DFP Android SDK.
  3. Place the MobFox-Android-DFP-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup DFP Custom Events in your MobFox control panel.
  5. Integrate the Banner or Interstitial you created previously and load it - you should get an ad from the referred DFP AdUnit.

AppLovin

  1. Install the MobFox Android SDK Core.
  2. Install the AppLovin Android SDK.
  3. Place the MobFox-Android-AppLovin-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup AppLovin Custom Events in your MobFox control panel.
  5. Place your AppLovin sdk key in your androidManifest.xml file as written in AppLovin documentation.<meta-data android:name="applovin.sdk.key" android:value="<your-applovin-sdk-key>" /> There's no need to fill the 'netwrokId' field in MobFox console as the key is taken from the manifest file.
  6. Integrate the Interstitial you created previously and load it - you should get an ad from the referred AppLovin SDK key.

Chartboost

  1. Install the MobFox Android SDK Core.
  2. Install the Chartboost Android SDK.
  3. Place the MobFox-Android-Chartboost-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup Chartboost Custom Events in your MobFox control panel.
  5. Integrate the Interstitial you created previously and load it - you should get an ad from Chartboost.

AdColony

  1. Install the MobFox Android SDK Core.
  2. Install the AdColony Android SDK.
  3. Place the MobFox-Android-AdColony-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup AdColony Custom Events in your MobFox control panel.
  5. It's only possible to request Interstitial custom event ads from AdColony at the moment. Create a MobFox Interstitial ad.
  6. Integrate the Interstitial ad you created previously and load it with the custom event publication ID (step 4) - you should get an ad from the referred AdColony ad.

Supersonic

  1. Install the MobFox Android SDK Core.
  2. Install the Supersonic Android SDK.
  3. Place the MobFox-Android-Supersonic-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup Supersonic Custom Events in your MobFox control panel.
  5. Integrate the Interstitial you created previously and load it - you should get an ad from Supersonic.

Vungle

  1. Install the MobFox Android SDK Core.
  2. Install the Vungle Android SDK.
  3. Place the MobFox-Android-Vungle-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup Vungle Custom Events in your MobFox control panel.
  5. It's only possible to request Interstitial custom event ads from AdColony at the moment. Create a MobFox Interstitial ad.
  6. Integrate the Interstitial ad you created previously and load it with the custom event publication ID (step 4) - you should get an ad from the referred Vungle ad.

Woobi

  1. Install the MobFox Android SDK Core.
  2. Download and Integrate the Woobi Android SDK, follow instructions in Here.
  3. While integrating Woobi SDK in your app keep the “appId” Woobi provides you.
  4. Place the Woobi-MobFox-1.0.0.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  5. Configuring Wooib’s plugin: Please set up Woobi’s plugin in your app, before calling MobFox’s Interstitial.load():
    • To select interstitial Type: call WoobiMobFox.setWoobiAdToShow (WoobiMobFox.WOOBI_AD.​) PrefferedIAdType = {VIDGET, DISPLAY, CAROUSEL}
    • Set up Woobi’s AppId: provide the Woobi SDK integration appId to the plugin using the WoobiMobFox.setWoobiAppId method.
    • Set up a clientId (optional): If you wish to set up a client id use WoobiMobFox.setWoobiClientId method.
  6. Setup Woobi Custom Events in your MobFox control panel and add Woobi as a "Custom Event".
  7. Integrate a MobFox Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Woobi network.

Facebook

  1. Install the MobFox Android SDK Core.
  2. Install the Facebook Android SDK.
  3. Place the MobFox-Android-Facebook-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup Facebook Custom Events in your MobFox control panel.
  5. Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Facebook network.

Amazon

  1. Install the MobFox Android SDK Core.
  2. Install the Amazon Android SDK.
  3. Place the MobFox-Android-Amazon-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup Amazon Custom Events in your MobFox control panel.
  5. Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Amazon network.

Millenial

  1. Install the MobFox Android SDK Core.
  2. Install the Millenial Android SDK.
  3. Place the MobFox-Android-Millenial-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup Millenial Custom Events in your MobFox control panel.
  5. Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Millenial network.

Startapp

  1. Install the MobFox Android SDK Core.
  2. Install the Startapp Android SDK.
  3. Place the MobFox-Android-Startapp-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
  4. Setup Startapp Custom Events in your MobFox control panel.
  5. Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Startapp network.

Writing Custom Events

Writing Custom Events