This guide is for publishers who want to monetize an Android app withAdMob and aren't using Firebase. If you plan toinclude Firebase in your app (or you're considering it), see the AdMobwith Firebase version ofthis guide instead.
Integrating the Google Mobile Ads SDK into an app is the first step towarddisplaying ads and earning revenue. Once you've integrated the SDK, you canchoose an ad format (such as native or rewarded video) and follow the steps toimplement it.
minSdkVersion
16 or highercompileSdkVersion
28 or higherAug 25, 2020. Online shopping from a great selection at Apps & Games Store. Online shopping from a great selection at Apps & Games Store. Skip to main content.us Hello, Sign in. Featured Fire Tablet Apps and Games See more Fire tablet apps and games Previous page. TODAY NBC News Digital LLC Free Download.
Apps can import the Google Mobile Ads SDK with a Gradledependency that points toGoogle's Maven repository. First, make surethat google()
is referenced in the allprojects
section of yourproject-level build.gradle
file.
Next, open the app-level build.gradle
file for your app, and look fora 'dependencies' section.
Add the line in bold above, which instruct Gradle to pull in the latestversion of the Mobile Ads SDK and additional related dependencies. Once that'sdone, save the file and perform a Gradle sync.
Add your AdMob App ID to your app'sAndroidManifest.xml
file by adding a <meta-data>
tag with name com.google.android.gms.ads.APPLICATION_ID
, as shown below.
You can find your App ID in the AdMob UI. For android:value
insert yourown AdMob App ID in quotes, as shown below.
<meta-data>
tag results in a crash with the message:The Google Mobile Ads SDK was initialized incorrectly.
Before loading ads, have your app initialize the Mobile Ads SDK by callingMobileAds.initialize()
which initializes the SDK and calls back a completion listener onceinitialization is complete (or after a 30-second timeout). This needsto be done only once, ideally at app launch.
MobileAds.initialize()
. If you need to obtain consent from usersin the European Economic Area (EEA), set any request-specific flags (such astagForChildDirectedTreatment
or tag_for_under_age_of_consent
), or otherwisetake action before loading ads, ensure you do so before initializing the MobileAds SDK.Here's an example of how to call the initialize()
method in an Activity:
If you're using mediation, wait until the completion handler is called beforeloading ads, as this will ensure that all mediation adapters are initialized.
The Mobile Ads SDK is now imported and you're ready to implement an ad.AdMob offers a number of different ad formats, soyou can choose the one that best fits your app's user experience.
Rectangular ads that appear at the top or bottom of the device screen.Banner ads stay on screen while users are interacting with the app, and canrefresh automatically after a certain period of time. If you're new to mobileadvertising, they're a great place to start.
Full-screen ads that cover the interface of an app until closed by the user.They're best used at natural pauses in the flow of an app's execution, such asbetween levels of a game or just after a task is completed.
Customizable ads that match the look and feel of your app. You decide how andwhere they're placed, so the layout is more consistent with your app's design.
Ads that reward users for watching short videos and interacting with playableads and surveys. Good for monetizing free-to-play users.
Apps & Games on Google Play are adopting a new icon system to better fit diversedeveloper artwork to Google Play's various UI layouts, form factors, anddevices, as well as to bring consistency and a cleaner look to Google Play.
Uniformed shapes are visually more appealing and easier to digest. They helpusers focus on the artwork, as opposed to the shape. They fix alignment issuescaused by random open space to better present surrounding information, such asthe title, rating, and price.
This page describes the guidelines you should follow when creating assets foryour app's listing on Google Play. For example, because Google Play dynamicallyrenders rounded corners and drop shadows for your app icons, you should omitthem from your original assets.
Important: If instead you're interested in learning more about creating APKlauncher icons, which are separate from the Google Play icons described on thispage, see the resources below:
This section describes some guidelines you should follow when creating visualassets for your app on Google Play.
Icon artwork can populate the entire asset space, or you can design and positionartwork elements such as logos onto the keyline grid. When placing your artwork,use keylines as a guideline, not a hard rule.
When creating your artwork, ensure it conforms to the following:
After the asset is uploaded, Google Play dynamically applies the rounded maskand shadow to ensure consistency across all app/game icons.
Utilize the full asset space as the background when dealing with minimalisticartwork.
Use the keylines as guides for positioning artwork elements (i.e. logos).
Don't force your logo or artwork to fit the full asset space. Instead, utilizethe keyline grid.
Illustrated artwork typically works well as a full bleed icon.
Google Play will dynamically add a drop shadow around the final icon onceuploaded.
When adding shadows inside your icon artwork, consider consistency with theAndroid platform by following Google Material guidelines.
Google Play dynamically applies corner radius. This ensures consistency when theicon is resized across different UI layouts. Radius will be equivalent to 20% oficon size.
Embedded badges take away from the artwork itself and don't scale down well withthe icon.
If shapes are a critical part of a logo, do not force the artwork to full bleed.Instead place it on the new keyline grid.
If possible, pick a background color for your asset that's appropriate for yourbrand and doesn't include any transparency. Transparent assets will display thebackground color of Google Play UI.
If there is no distinct shape around a logo defining it, place it on a fullbleed background.
If your artwork is flexible enough, consider tweaking it to fully utilize theasset size. If that's not possible, revert to placing the logo on a keylinegrid.
Original icon assets that have not been updated per the new specifications willeventually be migrated to legacy mode and scaled down 75% to the keyline gridsize (512 * 0.75 = 384px).
Uploading an icon per the original specification will not be allowed as of May2019. See more details on timelines.
Migration dates are slightly different for API users, but achieve the same endresult of migrating all icons to either the new specification or 'legacy mode'by June 24, 2019.
Before June 17, 2019, developers must use the Play Console to apply the newspecification to their icons. All calls to Edits.images: uploadwill apply whichever specification is configured in the Play Console. There isno way to apply the new specification via API. The Edits.images: upload
callmay error if the old specification is still applied, and the errormessage for that specific icon will point you to this specification. Afterapplying a new specification using the Play Console, you can retry theEdits.images: upload
call. You may need to retry the call multiple timesbefore it will succeed.
Beginning on June 17, 2019, all API calls to Edits.images: upload
willautomatically apply the new specification to the icon. Following June 17, 2019,you should only upload icons that are compatible with the new specification.
To get started, download one of the provided asset templates: