Ir a la consola

AdRequest.Builder

public static final class AdRequest.Builder extends Object

Builds an AdRequest.

Public Constructor Summary

Public Method Summary

AdRequest.Builder
addCustomEventExtrasBundle(Class<? extends CustomEvent> adapterClass, Bundle customEventExtras)
Add extra parameters to pass to a specific custom event adapter.
AdRequest.Builder
addKeyword(String keyword)
Add a keyword for targeting purposes.
AdRequest.Builder
addNetworkExtras(NetworkExtras networkExtras)
Add extra parameters to pass to a specific ad network adapter.
AdRequest.Builder
addNetworkExtrasBundle(Class<? extends MediationExtrasReceiver> adapterClass, Bundle networkExtras)
Add extra parameters to pass to a specific ad network adapter.
AdRequest.Builder
addTestDevice(String deviceId)
Causes a device to receive test ads.
AdRequest
build()
Constructs an AdRequest with the specified attributes.
AdRequest.Builder
setBirthday(Date birthday)
This method is deprecated. No replacement.
AdRequest.Builder
setContentUrl(String contentUrl)
Sets the content URL for targeting purposes.
AdRequest.Builder
setGender(int gender)
This method is deprecated. No replacement.
AdRequest.Builder
setIsDesignedForFamilies(boolean isDesignedForFamilies)
This method is deprecated. Use Ad Content Filtering.
AdRequest.Builder
setLocation(Location location)
Sets the user's location for targeting purposes.
AdRequest.Builder
setMaxAdContentRating(String maxAdContentRating)
This method is deprecated. See setMaxAdContentRating(String)
AdRequest.Builder
setRequestAgent(String requestAgent)
Sets the request agent string to identify the ad request's origin.
AdRequest.Builder
setTagForUnderAgeOfConsent(int tagForUnderAgeOfConsent)
This method is deprecated. See setTagForUnderAgeOfConsent(int)
AdRequest.Builder
tagForChildDirectedTreatment(boolean tagForChildDirectedTreatment)
This method is deprecated. See setTagForChildDirectedTreatment(int)

Inherited Method Summary

Public Constructors

public AdRequest.Builder ()

Public Methods

public AdRequest.Builder addCustomEventExtrasBundle (Class<? extends CustomEvent> adapterClass, Bundle customEventExtras)

Add extra parameters to pass to a specific custom event adapter.

Parameters
adapterClass The Class of the custom event adapter for which you are providing extras.
customEventExtras A Bundle of extra information to pass to a custom event adapter.

public AdRequest.Builder addKeyword (String keyword)

Add a keyword for targeting purposes.

public AdRequest.Builder addNetworkExtras (NetworkExtras networkExtras)

Add 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.

Note that the NetworkExtras class has been deprecated. This method is included to maintain compatibility with older adapters.

public AdRequest.Builder addNetworkExtrasBundle (Class<? extends MediationExtrasReceiver> adapterClass, Bundle networkExtras)

Add extra parameters to pass to a specific ad network adapter.

Parameters
adapterClass The Class of the adapter that should receive extras.
networkExtras A Bundle of extra information to pass to a mediation adapter.