Buildbox 2 Integration (Android)

You can use the following process to integrate MAS in your Android game whether you are using the Free, Plus or Pro Buildbox plan.

1. Buildbox configuration

Before you build your project to Android, make sure that you have integrated the different ad types in your game, here’s an example :

Then export your game to Android.

2. Update your Project-Level build.gradle 

After you open your game in Android studio, you need to update your project-level build.gradle file by adding these repositories:

				
					mavenCentral()
maven { url "https://artifact.bytedance.com/repository/pangle" }
maven { url "https://android-sdk.is.com" }
maven { url "https://sdk.tapjoy.com/" }
				
			

Or use these repositories if you need to comply with the Google Family Policy.

				
					mavenCentral()
maven { url "https://android-sdk.is.com" }
maven { url "https://sdk.tapjoy.com/" }
				
			

2. Update your App-Level build.gradle

1. If you’re only targeting children under 13 years of age, please add this dependency:

				
					implementation 'com.yodo1.mas:google:4.5.0'
				
			

 

2. If you’re targeting all ages, or 13+, use this dependency:

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

3. Make sure that MultiDex property is enabled.

				
					defaultConfig {
    ...
    multiDexEnabled true
    ...
}
				
			

 

4. Also make sure that minSdkVersion is at least 19.

				
					defaultConfig {
   ...
   minSdkVersion 19
   ...
}
				
			


3. Update gradle.properties

Add this configuration in gradle.properties file:

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


4. Update your AndroidManifest.xml file

Add your AdMob App ID to your app’s AndroidManifest.xml file by including the  tag. Your AdMob App ID can be found under the “details” of your app on MAS Dashboard. Please replace android:value with your own AdMob App ID:

				
					<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="YOUR_ADMOB_APP_ID"/>
</application>
</manifest>
				
			

5. Download MAS Plugin

  1. Download this file.
  2. Copy AdIntegrator.java and use it to replace the existing file under java/com/buildbox

6. Add your Appkey

Open AdIntegrator.java, find the initAds() method and add your Appkey in Yodo1Mas.getInstance().init(). You can find your Appkey in MAS dashboard.

For the next step please test your integration.

CONTENTS