Ir a la consola

AdRequest

public final class AdRequest extends Object

An AdRequest contains targeting information used to fetch an ad. Ad requests are created using AdRequest.Builder.

Publishers using DoubleClick for Publishers or Search Ads for Apps should use PublisherAdRequest or SearchAdRequest, respectively.

Nested Class Summary

class AdRequest.Builder Builds an AdRequest
@interface AdRequest.MaxAdContentRating This @interface is deprecated. Use RequestConfiguration.MaxAdContentRating  
@interface AdRequest.TagForUnderAgeOfConsent This @interface is deprecated. Use RequestConfiguration.TagForUnderAgeOfConsent  

Constant Summary

String DEVICE_ID_EMULATOR The deviceId for emulators to be used with addTestDevice(String).
int ERROR_CODE_INTERNAL_ERROR Something happened internally; for instance, an invalid response was received from the ad server.
int ERROR_CODE_INVALID_REQUEST The ad request was invalid; for instance, the ad unit ID was incorrect.
int ERROR_CODE_NETWORK_ERROR The ad request was unsuccessful due to network connectivity.
int ERROR_CODE_NO_FILL The ad request was successful, but no ad was returned due to lack of ad inventory.
int GENDER_FEMALE Female gender.
int GENDER_MALE Male gender.
int GENDER_UNKNOWN Unknown gender.
String MAX_AD_CONTENT_RATING_G Content suitable for general audiences, including families.
String MAX_AD_CONTENT_RATING_MA Content suitable only for mature audiences.
String MAX_AD_CONTENT_RATING_PG Content suitable for most audiences with parental guidance.
String MAX_AD_CONTENT_RATING_T Content suitable for teen and older audiences.
int MAX_CONTENT_URL_LENGTH The maximum content URL length.
int TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE Indicates the publisher specified that the ad request should not receive treatment for users in the European Economic Area (EEA) under the age of consent.
int TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE Indicates the publisher specified that the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent.
int TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED Indicates that the publisher has not specified whether the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent.

Public Method Summary

Date
getBirthday()
This method is deprecated. No replacement.
String
getContentUrl()
Returns the content URL targeting information.
<T extends CustomEvent> Bundle
getCustomEventExtrasBundle(Class<T> adapterClass)
Returns extra parameters to pass to a specific custom event adapter.
int
getGender()
This method is deprecated. No replacement.
Set<String>
getKeywords()
Returns targeting information keywords.
Location
getLocation()
Returns the user's location targeting information.
<T extends NetworkExtras> T
getNetworkExtras(Class<T> networkExtrasClass)
Returns extra parameters to pass to a specific ad network adapter.
<T extends MediationExtrasReceiver> Bundle
getNetworkExtrasBundle(Class<T> adapterClass)
Returns extra parameters to pass to a specific ad network adapter.
boolean
isTestDevice(Context context)
Returns true if this device will receive test ads.

Inherited Method Summary