Follow

Integrate AerServ in Tapjoy Android SDK

AerServ Mediation Overview

The following diagram illustrates the interaction between LTV Platform services, Tapjoy’s AerServ Adaptor, the AerServ SDK and adaptors / SDKs of optional video demand sources:

 

 

Required Software 
Tapjoy SDK:   Android 
AerServ SDK:  Android  
Adapter Code: Android 
Sample App:  Android 
  
  
 
Prerequisites

These instructions assume you have ALREADY done the following:

AerServ Platform Mediation requires Tapjoy’s SDK 11.4 or higher.
 
  1. Aerserv Account Setup
  2. Tapjoy Account Setup
  3. Integrate AerServ Android SDK 
  4. Integrate the Tapjoy Android SDK
  5. Integrate Adapter Android SDK
  6. Set up a placement and content unit in the Tapjoy dashboard and in your application:
    1. Setting up placements in the Tapjoy dashboard
    2. Connect a content unit to that placement
    3. Call using Tapjoy Android SDK placement code from your application’s code
  7. Test to make sure you can see Tapjoy content from your application.

 

Step 1: Android Project Setup

 

Integrating AerServ Android SDK

Android OS & API Minimum Requirements:

  • Android 4.0.3 (Ice Cream Sandwich) and up (API 15+)
  • Google Play Services will adhere to the user’s ad tracking preference. For more information, please see Google's website regarding their Advertising ID.
  • Android Support V4+

 

1.1. SDK Directory Structure

SDK Directory Structure

 

1.2. Using Android Studio:

Using Android Studio:

 

Code sample of adding Google Play Services and Android Support libraries to your modules build.gradle file:

...
dependencies {
    // Google Play Services
    compile 'com.google.android.gms:play-services:7.5.0'

    // Android support library
    compile 'com.android.support:support-v4:+'
}
...

Note: If Gradle contains errors, please make sure you download the following using the SDK Manager:

  • Android Support Library
  • Android Support Repository
  • Google Play Services
  • Google Repository

 

1.3. Using Eclipse ADT Plugin:

  1. Add the aerserv-sdk.jar to your project's libs folder.
  2. Add Google Play Services to your project.
  3. Add Android Support Library v4/7 to your project.

Using Eclipse ADT Plugin:

2. Configuring Your Project

2.1. Update Android Manifest

In AndroidManifest.xml under: Assets > Plugins > Android

<!-- Required Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.pe1rmission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- Optional Permissions --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<!-- Optional Google Play Service -->
<metadata android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <!-- Required Aerserv Activity --> <activity android:name="com.aerserv.sdk.view.ASVastInterstitialActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
<activity android:name="com.aerserv.sdk.view.ASWebviewInterstitialActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity android:name="com.aerserv.sdk.view.ASVpaidInterstitalActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<!-- AdColony Mediation --> <activity android:name="com.jirbo.adcolony.AdColonyOverlay" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" /> <activity android:name="com.jirbo.adcolony.AdColonyFullscreen" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" /> <activity android:name="com.jirbo.adcolony.AdColonyBrowser" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" /> <!-- AdMob Mediation --> <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> <!-- Vungle Mediation --> <activity android:name="com.vungle.publisher.FullScreenAdActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> <service android:name="com.vungle.publisher.VungleService" android:exported="false" /> <!-- Facebook Mediation -->
<activity android:name="com.facebook.ads.InterstitialAdActivity"
    android:configChanges="keyboardHidden|orientation|screenSize" />

<!-- AppLovin Mediation -->
<activity android:name="com.applovin.adview.AppLovinInterstitialActivity" />
<activity android:name="com.applovin.adview.AppLovinConfirmationActivity" />

<!-- Unity Mediation -->
<activity android:name="com.unity3d.ads.android.view.UnityAdsFullscreenActivity"
 android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    android:hardwareAccelerated="true" />

<!-- MoPub Mediation -->
<activity android:name="com.mopub.mobileads.MoPubActivity"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize"/>
<activity android:name="com.mopub.mobileads.MraidActivity"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize"/>
<activity android:name="com.mopub.common.MoPubBrowser"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize"/>

<!-- Flurry Mediation -->
<activity
    android:name="com.flurry.android.FlurryFullscreenTakeoverActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize">
 
 
(Optional) Pre-initialize mediation adapters (Adcolony, Vungle Applovin)
Highly recommended. Call this method AerServSDK.init(this,"SITE_ID");onCreate(Bundle) in your main activity.
 @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        selfContext = this;
        setContentView(R.layout.activity_main);
				TextView version = (TextView) findViewById(R.id.sdkVersion);
				version.setText("v" + UrlBuilder.VERSION);

         AerServSdk.init(this, "SITE ID");

Adding Tapjoy AerServ Mediation Adapters:

After unzipping the Tapjoy Android SDK, copy the adapter libraries from /Libraries/ThirdPartySupport/AerServ to your project’s /libs folder. (If you don’t have it, create the folder first.)

  • For Android Studio, reference these libraries in your build.gradle (be sure to replace the version number with the actual version number that appears in the file):
dependencies {
  compile files('libs/tapjoy_aerserv_v1.0.0.jar')
}
 

Step 2: AerServ Dashboard Setup: Add Tapjoy

To add Tapjoy to your AerServ waterfall, follow the instructions for adding an Ad Source on the AerServ dashboard. Make sure to prioritize the Tapjoy source at the top when testing Tapjoy.

Add the placement name you’re using on the Tapjoy dashboard as a publisher-specific parameter.

A. Adding an Ad Source

  1. Click the Ad Sources tab
  2. Click the + button to add an ad source

 

 

B. Fill in the Tapjoy Ad Source Details

  1. Enter a Name for the ad source (example: Tapjoy Android Interstitial)
  2. Select Tapjoy in the dropdown box
  3. Enter Tapjoy Placement Name (example: aerserv_config_video 
  4. Enter in the estimated CPM
  5. Select the Payment Terms
  6. Set Placement 
  7. Select Countries targeting (optional)
  8. Select Device targeting (optional)
  9. Click Save

 

 

C. How to locate your Tapjoy Placement ID:

  1. Click "Monetize" in the left menu bar
  2. Click the White "Manage Placement" button in the upper right corner of the dashboard.
  3. Select the Tapjoy Placement Name 

 

 

Step 3: Tapjoy dashboard Setup

A. Link your AerServ and Tapjoy Accounts and Applications

PLEASE NOTE: Tapjoy-AerServ account linking is strictly one-to-one: a single Tapjoy account links to a single AerServ account. It is not possible to link multiple Tapjoy accounts to a single AerServ account or vice-versa.

  1. Link your AerServ account to your Tapjoy account. From the Tapjoy dashboard, go to App Settings → Content → Mediation. Select “AerServ” as the Mediation Provider. Give the configuration a name of your choosing. Click Save:
  2. An “Authentication Status” section will appear. Click the “Login” button.
  3. Next you will see the AerServ login page. Enter your AerServ account credentials and click "Login."
  4. On the following confirmation page, be sure to select "Approve," then click "Submit":
  5. You will be redirected back to the Tapjoy App Settings page. Your accounts are now linked. Use the dropdown menus to select the AerServ app that corresponds to your current Tapjoy iOS and/or Android Tapjoy app. (If your Tapjoy app is only on a single platform, you can leave the other platform blank.)

 

Create a Mediated Content Card on the Tapjoy dashboard

  1. On the Tapjoy Dashboard, Go to "Monetize," then click the "Create Content" button in the upper right.
  2. Scroll down the list of content types until you get to Mediated Auto Play Video (also called "Direct Play")  or Mediated Display Ad (also called "FSI"). Select the appropriate content card and click the "AerServ" button:
  3. Fill out the resulting Content Card creation form. Be sure to select the Tapjoy placement at which you want the AerServ Mediated content to appear:
  4. In the "Network Settings" section, select the AerServ placement you want this Mediated Content Card to call from the dropdown menu:
  5. Click the green "Save" button on the bottom left:

Prioritize the Mediated Content Card on the Tapjoy dashboard

  1. Prioritize the Mediated Content Card you just created relative to the other Content Cards at that Tapjoy Placement. On the Tapjoy Dashboard, go to "Monetize," "Manage Placements":
  2. Drag the Mediated Content Card you just created up and down the placement to prioritize it. Content Cards on top of the stack are checked first:
  3. By calling the Tapjoy placement from your application’s code, you should be getting AerServ mediated content (which may include Tapjoy content).

Step 4: Adding Additional Mediation Networks

Instructions on the adding Additional Ad sources on AerServ dashboard

List AerServ Partners 

Here’s a list of SDK Mediation partners:

 

Step 5: Configure Rewards and Virtual Currency

Android

// itemId = currency name specified on AerServ’s dashboard
// quantity = amount to reward
public void onRewardRequest(TJPlacement placement, TJActionRequest request, String itemId, int quantity)

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments