Stay organized with collections Save and categorize content based on your preferences.
public class AdRequest
An AdRequest
contains targeting information used to fetch an ad. Ad requests are created using AdRequest.Builder
.
Publishers using Ad Manager should use com.google.android.gms.ads.admanager.AdManagerAdRequest
.
public static final int ERROR_CODE_APP_ID_MISSING = 8
The ad request was not made due to a missing app ID.
ERROR_CODE_INTERNAL_ERRORpublic static final int ERROR_CODE_INTERNAL_ERROR = 0
Something happened internally; for instance, an invalid response was received from the ad server.
ERROR_CODE_INVALID_AD_STRINGpublic static final int ERROR_CODE_INVALID_AD_STRING = 11
The ad string is invalid. For example, there is no request ID in the ad string.
ERROR_CODE_INVALID_REQUESTpublic static final int ERROR_CODE_INVALID_REQUEST = 1
The ad request was invalid; for instance, the ad unit ID was incorrect.
ERROR_CODE_MEDIATION_NO_FILLpublic static final int ERROR_CODE_MEDIATION_NO_FILL = 9
The mediation adapter did not fill the ad request. If this error is returned from getCode
, check getCause
for the underlying cause.
public static final int ERROR_CODE_NO_FILL = 3
The ad request was successful, but no ad was returned due to lack of ad inventory.
Public methodspublic String getContentUrl()
Returns the content URL targeting information. Returns null
if the contentUrl was not set.
public Set<String> getKeywords()
Returns targeting information keywords. Returns an empty Set
if no keywords were added.
public boolean isTestDevice(Context context)
Returns true
if this device will receive test ads.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-24 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-24 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4