Mapping class for Google AdMob native ads.
Mediation adapters that load a native ad must extend this class to provide a mapping from
the mediated ad network's native ad object to NativeAd.
| View |
getAdChoicesContent()
Returns the view being used as AdChoices content.
|
| final String |
getAdvertiser()
Returns the text that identifies the advertiser.
|
| final String |
getBody()
Returns body text.
|
| final String |
getCallToAction()
Returns the text that encourages the user to take some action with the ad.
|
| float |
getCurrentTime()
Gets the video's current time.
|
| float |
getDuration()
Gets the video's duration.
|
| final Bundle |
getExtras()
Returns the bundle of extras passed in via the setExtras method.
|
| final String |
getHeadline()
Returns the primary text headline.
|
| final NativeAd.Image |
getIcon()
Returns a small image identifying the advertiser.
|
| final List<NativeAd.Image> |
getImages()
Returns a list of large images.
|
| float |
getMediaContentAspectRatio()
Returns the aspect ratio of the media to be rendered in the
MediaView.
|
| final boolean |
getOverrideClickHandling()
Returns true if the ad network does click handling on its own.
|
| final boolean |
getOverrideImpressionRecording()
Returns true if the ad network does impression tracking on its own.
|
| final String |
getPrice()
For ads about apps, returns a string representing how much the app costs.
|
| final 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.
|
| final String |
getStore()
For ads about apps, returns the name of the store offering the app for
download.
|
| void |
handleClick(View view)
Subclasses should implement this method if the network requires the developer
to explicitly handle click events of views rendered to screen.
|
| boolean |
hasVideoContent()
Returns true if the current ad has video content.
|
| void |
recordImpression()
Subclasses should implement this method if the network requires the developer
to explicitly record an impression of a view rendered to screen.
|
| void | |
| final void | |
| final void | |
| final void | |
| final void | |
| void |
setHasVideoContent(boolean hasVideoContent)
Set to true if the current ad has video content.
|
| final void | |
| final void | |
| final void | |
| void |
setMediaContentAspectRatio(float mediaContentAspectRatio)
Sets the aspect ratio of the media to be rendered in the
MediaView.
|
| void | |
| final void |
setOverrideClickHandling(boolean overrideClickHandling)
Set to true if the ad network does click handling on its own.
|
| final void |
setOverrideImpressionRecording(boolean overrideImpressionRecording)
Set to true if the ad network does impression tracking on its own.
|
| final void | |
| final void |
setStarRating(Double starRating)
For ads about apps, sets a star rating from 0 to 5 representing how many stars
the app has in the store offering it.
|
| final void | |
| void | |
| void |
untrackView(View view)
Subclasses should implement this method if the mediated network's SDK offers a
way to stop tracking a native ad view for the ad mapped by this object.
|
Returns the view being used as AdChoices content.
Returns the text that identifies the advertiser.
Returns body text.
Returns the text that encourages the user to take some action with the ad.
Gets the video's current time. Returns zero by default. Subclasses should override this method to return a nonzero current time for video ads.
Gets the video's duration. Returns zero by default. Subclasses should override this method to return a nonzero duration for video ads.
Returns the bundle of extras passed in via the setExtras method.
Returns the primary text headline.
Returns a small image identifying the advertiser.
Returns a list of large images.
Returns the aspect ratio of the media to be rendered in the MediaView.
Returns zero if the aspect ratio is not available.
Returns true if the ad network does click handling on its own.
Returns true if the ad network does impression tracking on its own.
For ads about apps, returns a string representing how much the app costs.
For ads about apps, returns a star rating from 0 to 5 representing how many stars the app has in the store offering it.
For ads about apps, returns the name of the store offering the app for download. For example, "Google Play".
Subclasses should implement this method if the network requires the developer to explicitly handle click events of views rendered to screen.
Returns true if the current ad has video content.
Subclasses should implement this method if the network requires the developer to explicitly record an impression of a view rendered to screen.
Sets a view to be used as AdChoices content.
Sets a text that identifies the advertiser. Apps are not required to display this asset, though it's recommended.
| advertiser | The text to set |
|---|
Sets body text. Apps are not required to display this asset, though it's recommended.
| body | The description to set |
|---|
Sets the ad's call to action (such as "Buy" or "Install"). Apps are not required to display this asset, though it's recommended.
| callToAction | The text to set |
|---|
Sets a bundle of extras containing assets or attributes that do not directly map to those expected for a Google native ad object (headline, body, etc).
Set to true if the current ad has video content.
Sets the primary text headline. Apps are required to display this asset.
Sets a small image identifying the advertiser. Apps are not required to display this asset, though it's recommended.
Sets a list of large images. Apps are not required to display this asset, though it's recommended.
Sets the aspect ratio of the media to be rendered in the MediaView.
| mediaContentAspectRatio | the aspect ratio to set |
|---|
Sets mediated view that displays media. This is typically the View provided by the mediated SDK to display video content for an ad, but should display an image asset if no video is present. Adapters are expected to set a View for this property for every ad.
Set to true if the ad network does click handling on its own.
Set to true if the ad network does impression tracking on its own.
For ads about apps, sets a string representing how much the app costs. Apps are not required to display this asset, though it's recommended.
| price | The string representing how much the app costs. |
|---|
For ads about apps, sets 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.
For ads about apps, sets 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.
| store | the name of the app store to set |
|---|
Subclasses should implement this method if the network requires the developer to
prepare state for recording an impression and/or click before a view is rendered to
screen. Find the asset names in NativeAdAssetNames.
Subclasses should implement this method if the mediated network's SDK offers a way to stop tracking a native ad view for the ad mapped by this object.