Integrating the Mobile Ads SDK
The Yandex Mobile Ads library is provided in AAR and JAR formats.
We recommend using the AAR format.
To enable the Mobile Ads SDK:
Add the AppMetrica library. The recommended version of AppMetrica is 3.8.0.
If you use Gradle to build the app, add the Yandex Mobile Ads and AppMetrica SDK dependencies to the build.gradle file in your app's module:
dependencies { ... implementation 'com.yandex.android:mobileads:2.111' implementation 'com.yandex.android:mobmetricalib:3.8.0' }
Download the library and add it to the project.
To enable the Mobile Ads SDK:
Add the AppMetrica library. The recommended version of AppMetrica is 3.8.0.
If you use Gradle to build the app, add the Yandex Mobile Ads and AppMetrica SDK dependencies to the build.gradle file in your app's module:
dependencies { ... implementation 'com.yandex.android:mobileads:2.111:jar' implementation 'com.yandex.android:mobmetricalib:3.8.0:jar' }
If you don't use GradleDownload the library and add it to the project.
Make changes to the AndroidManifest.xml file:
<manifest> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> ... <application> ... <activity android:name="com.yandex.mobile.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> </application> </manifest>
If your project uses proguard, you must add the following lines in the proguard.cfg file:
-keep class com.yandex.mobile.ads.** { *; }
-dontwarn com.yandex.mobile.ads.**
-keepattributes *Annotation*