Installation of the Android SDK

1. Installation with Gradle

Tapdaq requires Android API 14 or higher, the following networks require higher minimum:

Network Minimum API Level
AppLovin 16
InMobi 15
Maio 16
YouAppi 16

A. Add Tapdaq & ad networks


  repositories {
    google()
    jcenter()
  
    //Tapdaq SDK and Adapters
    maven { url "http://android-sdk.tapdaq.com" }
    
    // AdColony
    maven { url  "https://adcolony.bintray.com/AdColony" }
    //HyprMX
    maven { url "https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master" }
    //Ironsource
    maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
    //Maio
    maven { url "https://imobile-maio.github.io/maven" }
    //Tapjoy
    maven {
      name "Tapjoy's maven repo"
      url "https://tapjoy.bintray.com/maven"
    }
    //Vungle
    maven { url "https://jitpack.io" }
    //YouAppi
    maven { url "http://repository.youappi.com/repository/release" }
  }
  dependencies {
    //Tapdaq
    implementation 'com.tapdaq.sdk:Tapdaq-BaseSDK:'
    //Adapters - These will automatically pull ad network dependencies
    
    implementation 'com.tapdaq.sdk:TapdaqAdColonyAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqAdMobAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqAppLovinAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqChartboostAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqFANAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqHyprMXAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqInmobiAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqIronsourceAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqMaioAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqMintegralAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqTapjoyAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqUnityAdsAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqVungleAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqYouAppiAdapter:'
    
    implementation 'com.tapdaq.sdk:TapdaqZPlayAdapter:'
    
  }
  

If you are using ProGuard in your app, see our Proguard page for details.

B. Network Specific Settings

Facebook Audience Network

For Android P (9.0) or higher devices, in order to load ads a config must be added to the AndroidManifest.xml, see full details on the Facebook website

2. Authenticate with Tapdaq

A. Override the TMInitListener

This listener object is provided in the initialise method, didInitialise will be called when the Tapdaq SDK is ready to receive requests such as load/show method calls. didFailToInitialise may be called if Tapdaq was unable to initialise.

public class TapdaqInitListener extends TMInitListener {

    public void didInitialise() {
        super.didInitialise();
        // Ads may now be requested
    }

    @Override
    public void didFailToInitialise(TMAdError error) {
        super.didFailToInitialise(error);
        //Tapdaq failed to initialise
    }
}

B. Initialise Tapdaq

Add the import statement in your main activity:

import com.tapdaq.sdk.*;
import com.tapdaq.sdk.common.*;
import com.tapdaq.sdk.listeners.*;

Navigate to the following method in your main activity, and add the following code:

Log in with your Tapdaq account to have these keys generated automatically.


protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  TapdaqConfig config = new TapdaqConfig();
  config.setUserSubjectToGDPR(STATUS.TRUE); //GDPR declare if user is in EU
  config.setConsentGiven(true); //GDPR consent must be obtained from the user
  config.setIsAgeRestrictedUser(false); //Is user subject to COPPA or GDPR age restrictions

  Tapdaq.getInstance().initialize(this, "<APP_ID>", "<CLIENT_KEY>", config, new TapdaqInitListener());
}
  

For more on GDPR and COPPA compliance, see the User Privacy section.

Once the Tapdaq SDK initialises, didInitialise() will be called.

3. Update GDPR Consent

Consent can be updated mid session as well as at initialisation, it can be set and unset.

Tapdaq.getInstance().setUserSubjectToGDPR(MainActivity.this, STATUS.TRUE);
Tapdaq.getInstance().setContentGiven(MainActivity.this, true);
Tapdaq.getInstance().setIsAgeRestrictedUser(MainActivity.this, true);

For Mintegral: for users outside the EU UserSubjectToGDPR must be set to FALSE to receive ads. For users inside the EU UserSubjectToGDPR must be TRUE with ConsentGiven also TRUE to receive ads.

4. Display an advert

To display the advert, please click on one of the following guides.

You can test that each ad network has been integrated correctly by visiting the Debugging page.

Need help?

If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.