Android
Configure the SDK
Make sure multiDex is enabled in your build.gradle
.
defaultConfig {
multiDexEnabled true
}
Add this content to gradle.properties
file.
android.useAndroidX=true
android.enableJetifier=true
android.enableDexingArtifactTransform=false
Add AdMob ID
- Add your
AdMob ID
to your app'sAndroidManifest.xml
file. - Your AdMob ID can be found under the "details" of your app on MAS Dashboard.
- 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 Activity
.
- Java
- Kotlin
Yodo1Mas.getInstance().initMas(this, "YourAppKey", new Yodo1Mas.InitListener() {
@Override
public void onMasInitSuccessful() {
}
@Override
public void onMasInitFailed(@NonNull Yodo1MasError error) {
}
});
Yodo1Mas.getInstance().initMas(this, "YourAppKey", object : Yodo1Mas.InitListener {
override fun onMasInitSuccessful() {
Toast.makeText(this@MainActivity, "[Yodo1 Mas] Successful initialization", Toast.LENGTH_SHORT).show()
}
override fun onMasInitFailed(error: Yodo1MasError) {
Toast.makeText(this@MainActivity, error.message, Toast.LENGTH_SHORT).show()
}
})