| Known Direct Subclasses |
An AdRequest contains
targeting information used to fetch an ad. Ad requests are created using AdRequest.Builder.
Publishers using Ad Manager or Search Ads for Apps should use AdManagerAdRequest
or DynamicHeightSearchAdRequest,
respectively.
| class | AdRequest.Builder | Builds an AdRequest. |
|
| String | DEVICE_ID_EMULATOR | The deviceId for emulators to be
used with
RequestConfiguration.Builder.setTestDeviceIds(List). |
| int | ERROR_CODE_APP_ID_MISSING | The ad request was not made due to a missing app ID. |
| int | ERROR_CODE_INTERNAL_ERROR | Something happened internally; for instance, an invalid response was received from the ad server. |
| int | ERROR_CODE_INVALID_AD_STRING | The ad string is invalid. |
| int | ERROR_CODE_INVALID_REQUEST | The ad request was invalid; for instance, the ad unit ID was incorrect. |
| int | ERROR_CODE_MEDIATION_NO_FILL | The mediation adapter did not fill the ad request. |
| 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 | ERROR_CODE_REQUEST_ID_MISMATCH | The AdInfo object inside the ad
request has mismatching request IDs or the request ID in the ad string is not
found. |
| int | GENDER_FEMALE | Female gender. |
| int | GENDER_MALE | Male gender. |
| int | GENDER_UNKNOWN | Unknown gender. |
| int | MAX_CONTENT_URL_LENGTH | The maximum content URL length. |
| 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.
|
| Set<String> |
getKeywords()
Returns targeting information keywords.
|
| Location |
getLocation()
Returns the user's location targeting information.
|
| List<String> |
getNeighboringContentUrls()
Returns the list of neighboring content URLs or an empty list if no URLs were
set.
|
| <T extends MediationExtrasReceiver> Bundle |
getNetworkExtrasBundle(Class<T>
adapterClass)
Returns extra parameters to pass to a specific ad network adapter.
|
| boolean |
The deviceId for emulators to be used with
RequestConfiguration.Builder.setTestDeviceIds(List).
The ad request was not made due to a missing app ID.
Something happened internally; for instance, an invalid response was received from the ad server.
The ad string is invalid. For example, there is no request ID in the ad string.
The ad request was invalid; for instance, the ad unit ID was incorrect.
The mediation adapter did not fill the ad request. If this error is returned from
AdError.getCode(),
check AdError.getCause()
for the underlying cause.
The ad request was unsuccessful due to network connectivity.
The ad request was successful, but no ad was returned due to lack of ad inventory.
The AdInfo object inside the ad request has mismatching request IDs or
the request ID in the ad string is not found.
Female gender.
Male gender.
Unknown gender.
The maximum content URL length.
Returns the content URL targeting information. Returns null if the
contentUrl was not set.
Returns extra parameters to pass to a specific custom event adapter. Returns
null if no custom event extras of the provided type were set.
Returns targeting information keywords. Returns an empty Set if no keywords
were added.
Returns the user's location targeting information. Returns null if the
location was not set.
Returns the list of neighboring content URLs or an empty list if no URLs were set.
Returns extra parameters to pass to a specific ad network adapter. Returns
null if no network extras of the provided type were set.
Returns true if this device will receive test ads.