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
AdMob 16
AppLovin 16
Chartboost 21
InMobi 15
IronSource 16
Maio 16
YouAppi 16
ZPlay 16

Chartboost requires the project to use Java 8

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" }
    // Chartboost
    maven { url  "https://chartboostmobile.bintray.com/Chartboost" }
    //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"
    }
    //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: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 = Tapdaq.getInstance().config();
  
  config.setUserSubjectToGDPR(STATUS.TRUE); //GDPR declare if user is in EU
  config.setConsentStatus(STATUS.TRUE); //GDPR consent must be obtained from the user
  config.setAgeRestrictedUserStatus(STATUS.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().setConsentGiven(MainActivity.this, STATUS.FALSE);
Tapdaq.getInstance().setIsAgeRestrictedUser(MainActivity.this, STATUS.UNKNOWN);

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.