A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/admob/android/reference/com/google/android/gms/ads/nativead/NativeAd below:

NativeAd | Android | Google for Developers

Skip to main content

Stay organized with collections Save and categorize content based on your preferences.

public abstract class NativeAd

A Google native ad.

Summary Public methods
public abstract void cancelUnconfirmedClick()

Cancels an unconfirmed click that was previously recorded for the ad.

public abstract void destroy()

Destroys the ad object. No other methods should be called on the ad object after destroy is called.

public abstract void enableCustomClickGesture()
This method is deprecated.

Use enableCustomClickGestureDirection.

Enables publishers reporting clicks using custom gestures for this NativeAd. The ad unit must be allowlisted to be able to use this method.

By default SDK tracks clicks on asset views. If this method is called, SDK will no longer track clicks for this NativeAd. It should be called before showing the ad.

public abstract @Nullable String getAdvertiser()

Returns text that identifies the advertiser. Apps are not required to display this asset, though it's recommended.

public abstract @Nullable String getCallToAction()

Returns the ad's call to action (such as "Buy" or "Install"). Apps are not required to display this asset, though it's recommended.

public abstract Bundle getExtras()

Returns a bundle of extra assets associated with the native ad. If a mediation partner's ad have assets besides the standard ones (price, store, etc.), they can be set by calling the method in setExtras, and can be retrieved via this method. For non-mediation flow, it returns an empty bundle.

public abstract @Nullable NativeAd.Image getIcon()

Returns a small image identifying the advertiser. Apps are not required to display this asset, though it's recommended.

public abstract List<NativeAd.ImagegetImages()

Returns a list of large images. Apps are not required to display this asset, though it's recommended.

public abstract @Nullable String getPrice()

For ads about apps, returns a string representing how much the app costs. Apps are not required to display this asset, though it's recommended.

public abstract @Nullable Double getStarRating()

For ads about apps, returns a star rating from 0 to 5 representing how many stars the app has in the store offering it. Apps are not required to display this asset, though it's recommended.

public abstract @Nullable String getStore()

For ads about apps, returns the name of the store offering the app for download. For example, "Google Play". Apps are not required to display this asset, though it's recommended.

isCustomClickGestureEnabled

public abstract boolean isCustomClickGestureEnabled()
This method is deprecated.

When loading an ad using enableCustomClickGestureDirection, all ads returned will support custom click gesture. If your account is not allowlisted for this feature, the ad request will no fill.

Indicates whether clicks can be reported using custom click gestures. Reach out to your account manager to allowlist your ad unit for this feature.

public abstract void performClick(Bundle clickData)

Should be called when the user has clicked on the ad. The ad unit must be allowlisted to be able to use this api. This method should only be used by Unity plugin publishers.

Parameters Bundle clickData

bundle of the app environment when the click happens. For details to construct the click data Bundle, see NativeAdConstants.

public abstract boolean recordImpression(Bundle impressionData)

Should be called when the ad is first displayed. The ad unit must be allowlisted to be able to use this api.

Parameters Bundle impressionData

bundle of the app environment when the impression happens. For details to construct the click data Bundle, see NativeAdConstants.

Returns boolean

true if the impression is recorded successfully

public abstract void reportTouchEvent(Bundle touchEventData)

Should be called when a touch event happens on the ad. The ad unit must be allowlisted to be able to use this api. If you are interested in using this feature, reach out to your account manager.

Parameters Bundle touchEventData

bundle of touch event coordinates and duration.

Example JSON representation of touchEventData Bundle:

  {    "x": "100",  // The x-coordinate of the touch event relative to the window.    "y": "50",  // The y-coordinate of the touch event relative to the window.    "duration_millis": "500",  // The amount of milliseconds the user pressed on the asset.  }
public abstract void setPlacementId(long placementId)

Sets a placement ID for the native ad.

To ensure this placement ID is included in reporting, call this method before associating the ad with a NativeAdView.

Parameters long placementId

A long integer provided by the AdMob UI for the configured placement.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-24 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-24 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4