AdMob
suggest changeSyntax
compile 'com.google.firebase:firebase-ads:10.2.1'— use a newer version when you have one<uses-permission android:name="android.permission.INTERNET" />Required to retrieve the ad- AdRequest adRequest = new AdRequest.Builder().build();//Banner ad
- AdView mAdView = (AdView) findViewById(R.id.adView);//Banner ad
- mAdView.loadAd(adRequest);//Banner ad
Parameters
| Param | Details |
|---|---|
ads:adUnitId="@string/main_screen_ad" |
The ID of your ad, from the AdMob site. Storing the ID in a resource file is optional, but it keeps later changes out of Java code. AdMob quick start |
Remarks
- Requires a valid AdMob account.
- Read the AdMob policy. Do not do anything that can get the account suspended.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents