How do I add AdMob to an Android app?
Create an AdMob account, register the app, add the Google Mobile Ads SDK dependency, put your AdMob app ID in AndroidManifest.xml, then create ad units and load them with test ads until release. The sequence in order: register the app in AdMob (an app can be registered before it is on Google Play, then linked once published); add com.google.android.gms:play-services-ads to your module's Gradle dependencies; declare the app ID as a meta-data entry named com.google.android.gms.ads.APPLICATION_ID in the manifest — a missing or wrong value crashes the app on launch, which is the most common first-time failure; initialise the SDK once at startup; then create an ad unit per placement and load it. Use Google's published test ad unit IDs throughout development and swap to live IDs only in the release build. Add the UMP consent SDK at the same time if you will serve European users, since retrofitting it later means another release.
Related questions
- What is app-ads.txt and do I need one?
- How long does AdMob account approval take, and why do applications get rejected?
- Why do AdMob accounts get disabled for invalid traffic?
- When does AdMob pay, and what is the payment threshold?
- Can I click my own ads to test that they work?
- Why did my app's ad revenue suddenly drop?
- AdMob vs Unity Ads vs AppLovin: which pays more?
- What is the difference between eCPM, CPM and RPM?