Skip to main content

Android Integration

This page guides you through the process of downloading, importing, and configuring the Yodo1 MAS SDK.

Prerequisites

To integrate the Yodo1 MAS SDK on Android, you need to meet the following requirements:

  • Minimum API Level 23 or above.
  • Target API Level 33 or above.
  • compileSdkVersion 33 or above.
  • Android Gradle plugin version 7.4.2 or above.
  • Gradle 7.5.1 or above.
  • If you use ProGuard, please refer to the documentation.

Gradle

Add the following repositories to your build.gradle file.

mavenCentral()
maven { url "https://artifact.bytedance.com/repository/pangle" }
maven { url "https://android-sdk.is.com" }
maven { url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" }
maven { url "https://artifactory.bidmachine.io/bidmachine" }
maven { url "https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android" }
maven { url "https://artifacts.applovin.com/android/beta/" }

Import the SDK

Open your app-level build.gradle and add the following dependency.

Standard Integration

implementation 'com.yodo1.mas:full:4.14.2'

Customize Ad Networks

tip

Please contact support for advice on which ad networks are safe to remove without impacting performance. AppLovin and Google AdMob are required and cannot be removed.

To add or remove ad networks, you can include/exclude the following implementation definitions in build.gradle.

# Core
implementation 'com.yodo1.mas:core:4.14.2'
implementation 'com.yodo1.mas:gplibrary:4.14.2'

# AppLovin
implementation 'com.yodo1.mas.mediation:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.applovin.adapters:admob:4.14.2'

# BidMachine
implementation 'com.yodo1.mas.mediation:bidmachine:4.14.2'
implementation 'com.yodo1.mas.mediation.bidmachine.adapters:applovin:4.14.2'

# Bigo Ads
implementation 'com.yodo1.mas.mediation:bigo:4.14.2'
implementation 'com.yodo1.mas.mediation.bigo.adapters:applovin:4.14.2'

# DT Exchange(Fyber)
implementation 'com.yodo1.mas.mediation:fyber:4.14.2'
implementation 'com.yodo1.mas.mediation.fyber.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.fyber.adapters:admob:4.14.2'

# Google AdMob
implementation 'com.yodo1.mas.mediation:admob:4.14.2'
implementation 'com.yodo1.mas.mediation.admob.adapters:applovin-admob:4.14.2'
implementation 'com.yodo1.mas.mediation.admob.adapters:applovin-ad-manager:4.14.2'

# ironSource
implementation 'com.yodo1.mas.mediation:ironsource:4.14.2'
implementation 'com.yodo1.mas.mediation.ironsource.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.ironsource.adapters:admob:4.14.2-beta.1'

# InMobi
implementation 'com.yodo1.mas.mediation:inmobi:4.14.2'
implementation 'com.yodo1.mas.mediation.inmobi.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.inmobi.adapters:admob:4.14.2'

# Liftoff Monetize(Vungle)
implementation 'com.yodo1.mas.mediation:vungle:4.14.2'
implementation 'com.yodo1.mas.mediation.vungle.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.vungle.adapters:admob:4.14.2'

# Meta Audience Network(Facebook)
implementation 'com.yodo1.mas.mediation:facebook:4.14.2'
implementation 'com.yodo1.mas.mediation.facebook.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.facebook.adapters:admob:4.14.2'

# Mintegral
implementation 'com.yodo1.mas.mediation:mintegral:4.14.2'
implementation 'com.yodo1.mas.mediation.mintegral.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.mintegral.adapters:admob:4.14.2'

# Moloco
implementation 'com.yodo1.mas.mediation:moloco:4.14.2'
implementation 'com.yodo1.mas.mediation.moloco.adapters:applovin:4.14.2'

# Pangle
implementation 'com.yodo1.mas.mediation:pangle:4.14.2'
implementation 'com.yodo1.mas.mediation.pangle.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.pangle.adapters:admob:4.14.2'

# TradPlus
implementation 'com.yodo1.mas.mediation:tradplus:4.14.2'

# Unity Ads
implementation 'com.yodo1.mas.mediation:unityads:4.14.2'
implementation 'com.yodo1.mas.mediation.unityads.adapters:applovin:4.14.2'
implementation 'com.yodo1.mas.mediation.unityads.adapters:admob:4.14.2'

# Yandex
implementation 'com.yodo1.mas.mediation:yandex:4.14.2'
implementation 'com.yodo1.mas.mediation.yandex.adapters:applovin:4.14.2'

# YSO Network
implementation 'com.yodo1.mas.mediation:yso:4.14.2'
implementation 'com.yodo1.mas.mediation.yso.adapters:applovin:4.14.2'

# Yodo1 Test Ads
implementation 'com.yodo1.mas.mediation:yodo1:4.14.2'

Configure the SDK

Ensure that multiDex is enabled in your build.gradle.

defaultConfig {
multiDexEnabled true
}

In the gradle.properties file, add the following lines to configure AndroidX, Jetifier, and Dexing Artifact Transform:

android.useAndroidX=true
android.enableJetifier=true
android.enableDexingArtifactTransform=false

Update AdMob ID

  • Add your AdMob ID to your app's AndroidManifest.xml file.
  • Your AdMob ID can be found under the "details" of your app on the MAS Dashboard under "Management > Games > Manage".
  • Please replace android:value with your own AdMob ID.
<manifest>
<application>
<!-- Sample AdMob ID: ca-app-pub-3940256099942544~123456789 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="YOUR_ADMOB_APP_ID"/>
</application>
</manifest>

Initialize the SDK

Initialize the SDK by using the onCreate method of your app's Activity, as in the example below:

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Yodo1Mas.getInstance().initMas(this, "YourAppKey", new Yodo1Mas.InitListener() {
@Override
public void onMasInitSuccessful() {
}

@Override
public void onMasInitFailed(@NonNull Yodo1MasError error) {
}
});
}

Configure COPPA

Important
  • It's mandatory to use a privacy dialog to comply with Play Store policies and avoid revenue loss
  • If you use MAS built-in privacy dialog, COPPA will be configured automatically
  • If you prefer using your own privacy dialog, you should check the user's age and set COPPA manually
  • You need to set COPPA before initializing MAS

The Children's Online Privacy Protection Act (COPPA) is an American legal framework that safeguards children's privacy. If your app is designed for children under 13 years of age, it must comply with Google Play's Designed for Families policy.

// For users under 13
Yodo1Mas.getInstance().setCOPPA(true);

// For users 13 and above
Yodo1Mas.getInstance().setCOPPA(false);

Configure GDPR

Important
  • It's mandatory to use a privacy dialog to comply with Play Store policies and avoid revenue loss
  • If you use MAS built-in privacy dialog, GDPR will be configured automatically
  • If you prefer using your own privacy dialog, you should check users' age and add an agreement link to get their consent
  • You need to set GDPR before initializing MAS

The General Data Protection Regulation (GDPR) applies to users in the European Union (EU) and European Economic Area (EEA). Users under 16 must opt out of data collection.

// For users who consent to data collection
Yodo1Mas.getInstance().setGDPR(true);

// For users who don't consent or are under 16
Yodo1Mas.getInstance().setGDPR(false);

Configure CCPA

Important
  • It's mandatory to use a privacy dialog to comply with Play Store policies and avoid revenue loss
  • If you use MAS built-in privacy dialog, CCPA will be configured automatically
  • If you prefer using your own privacy dialog, you should add an agreement link to get users' consent
  • You need to set CCPA before initializing MAS

The California Consumer Privacy Act (CCPA) is a legal framework that protects the privacy of California residents in the USA.

// For users who opt out of data collection
Yodo1Mas.getInstance().setCCPA(true);

// For users who have not opted out
Yodo1Mas.getInstance().setCCPA(false);

Video Guide