Known Direct Subclasses |
Builds an AdRequest
.
Public Constructor Summary
Builder()
Constructs a
AdRequest.Builder .
|
Public Method Summary
AdRequest.Builder |
addCustomEventExtrasBundle(Class<? extends CustomEvent>
adapterClass, Bundle
customEventExtras)
Adds extra parameters to pass to a specific custom event adapter.
|
AdRequest.Builder | |
AdRequest.Builder |
addNetworkExtras(NetworkExtras
networkExtras)
This method is deprecated. Use
addNetworkExtrasBundle(Class, Bundle) .
|
AdRequest.Builder |
addNetworkExtrasBundle(Class<? extends MediationExtrasReceiver>
adapterClass, Bundle
networkExtras)
Adds extra parameters to pass to a specific ad network adapter.
|
AdRequest | |
AdRequest.Builder |
setContentUrl(String contentUrl)
Sets the content URL for a web site whose content matches the app's primary
content.
|
AdRequest.Builder |
setHttpTimeoutMillis(int httpTimeoutMillis)
Sets a custom timeout for HTTPS calls made by the Google Mobile Ads SDK during
an ad request.
|
AdRequest.Builder | |
AdRequest.Builder |
setNeighboringContentUrls(List<String>
neighboringContentUrls)
Sets URLs representing web content near an ad.
|
AdRequest.Builder |
setRequestAgent(String
requestAgent)
Sets the request agent string to identify the ad request's origin.
|
Inherited Method Summary
Public Constructors
public Builder ()
Constructs a AdRequest.Builder
.
Public Methods
public AdRequest.Builder addCustomEventExtrasBundle (Class<? extends CustomEvent> adapterClass, Bundle customEventExtras)
public AdRequest.Builder addKeyword (String keyword)
Adds a keyword for targeting purposes.
public AdRequest.Builder addNetworkExtras (NetworkExtras networkExtras)
This method is deprecated.
Use
addNetworkExtrasBundle(Class, Bundle)
.
Adds extra parameters to pass to a specific ad network adapter. The networkExtras
parameter should be an instance of com.google.ads.mediation.NetworkExtras
,
which is provided by ad network adapters.
public AdRequest.Builder addNetworkExtrasBundle (Class<? extends MediationExtrasReceiver> adapterClass, Bundle networkExtras)
public AdRequest.Builder setContentUrl (String contentUrl)
Sets the content URL for a web site whose content matches the app's primary content. This web site content is used for targeting and brand safety purposes.
Throws
NullPointerException | If contentUrl is {code null}. |
---|---|
IllegalArgumentException | If contentUrl is empty, or if its length exceeds 512. |
public AdRequest.Builder setHttpTimeoutMillis (int httpTimeoutMillis)
Sets a custom timeout for HTTPS calls made by the Google Mobile Ads SDK during an ad request.
If your app uses mediation, this timeout does not apply to network calls made by third-party ad network SDKs.
Parameters
httpTimeoutMillis | An integer specifying the HTTPS timeout in milliseconds. Any values lower than
5000 (5 seconds) will be ignored. The default value is
60000 (60 seconds). |
---|
public AdRequest.Builder setLocation (Location location)
Sets the user's location for mediation targeting purposes. This location data is not
used by Google for targeting, but is made available to mediation adapters via
MediationAdConfiguration.getLocation()
.
public AdRequest.Builder setNeighboringContentUrls (List<String> neighboringContentUrls)
Sets URLs representing web content near an ad. Promotes brand safety and allows displayed ads to have an app level rating (MA, T, PG, etc) that is more appropriate to neighboring content.
Parameters
neighboringContentUrls | The list of neighboring content URLs to be attached to the existing neighboring content URLs. |
---|
public AdRequest.Builder setRequestAgent (String requestAgent)
Sets the request agent string to identify the ad request's origin. Third party libraries that reference the Mobile Ads SDK should call this method to denote the platform from which the ad request originated. For example, if a third party ad network called "CoolAds network" mediates requests to the Mobile Ads SDK, it should call this method with "CoolAds".