This gist serves as a guide on how to integrate AdMob into your Raymob project. For the actual Raymob repository, please refer to Raymob.
Please note that this gist focuses on the integration of interstitial ads, but the process is similar for other types of ads as well.
If you have any doubts, please consult the AdMob Android Quick Start Guide for further information.
To integrate AdMob into your project, follow these steps:
- Add the following line to the end of the
app/build.gradlefile, under dependencies:implementation 'com.google.android.gms:play-services-ads:22.4.0' - Edit the existing
NativeLoader.javaandapp/AndroidManifest.xmlfiles in your project with the corresponding files provided in this gist. - Add the example file
admob.hto your project. - Think about setting
android.useAndroidXtotrueat the beginning of yourgradle.properties; you'll need it for using the@NonNullannotations.
That's it! AdMob should now be successfully integrated into your Raymob repository.
NOTE: The AdMob identifiers provided in this example are meant for testing purposes and are provided by Google. Remember to replace them with your own identifiers.
If your application is intended to be available only on the Google Play Store, you can also use com.google.android.gms:play-services-ads-lite:22.4.0 instead of com.google.android.gms:play-services-ads:22.4.0.
This implementation will be much lighter and will help reduce the size of your application. For more information, please refer to this link: https://developers.google.com/admob/android/lite-sdk?hl=en