java.lang.Object | |
↳ | com.google.android.gms.ads.search.SearchAdRequest.Builder |
Builds a SearchAdRequest
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add extra parameters to pass to a specific custom event adapter.
| |||||||||||
Add extra parameters to pass to a specific ad network adapter.
| |||||||||||
Add extra parameters to pass to a specific ad network adapter.
| |||||||||||
Causes a device to receive test ads.
| |||||||||||
Constructs a
SearchAdRequest with the specified attributes. | |||||||||||
Sets the color of the ad URL.
| |||||||||||
Sets the background color of the ad.
| |||||||||||
Sets a gradient for the ad background.
| |||||||||||
Sets the border color of the ad container.
| |||||||||||
Sets the thickness of the border in pixels around the ad container.
| |||||||||||
Sets the type of border around the ad container.
| |||||||||||
Sets the color of the call button when a call extension is shown.
| |||||||||||
Sets custom channels for the ad request.
| |||||||||||
Sets the color of the ad description.
| |||||||||||
Sets the font used to render the ad.
| |||||||||||
Sets the text color of the ad header.
| |||||||||||
Sets the font size of the header text in pixels.
| |||||||||||
Sets the user's location for targeting purposes.
| |||||||||||
Sets the query for requesting a search ad.
| |||||||||||
Sets the request agent string to identify the ad request's origin.
| |||||||||||
This method allows you to specify whether you would like your app to be treated as
child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA) -
http://business.ftc.gov/privacy-and-security/childrens-privacy.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Add extra parameters to pass to a specific custom event adapter.
Parameters | |
---|---|
adapterClass |
Class :
The Class of the custom event adapter for which you are providing
extras. |
customEventExtras |
Bundle :
A Bundle of extra information to pass to a custom event
adapter.
|
Returns | |
---|---|
SearchAdRequest.Builder |
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.
Parameters | |
---|---|
networkExtras |
NetworkExtras
|
Returns | |
---|---|
SearchAdRequest.Builder |
Add extra parameters to pass to a specific ad network adapter.
Parameters | |
---|---|
adapterClass |
Class :
The Class of the adapter for the network for which you are
providing extras. |
networkExtras |
Bundle :
A Bundle of extra information to pass to a mediation adapter.
|
Returns | |
---|---|
SearchAdRequest.Builder |
Causes a device to receive test ads. The deviceId
can be obtained by viewing the
logcat output after creating a new ad. For emulators, use DEVICE_ID_EMULATOR
.
Parameters | |
---|---|
deviceId |
String
|
Returns | |
---|---|
SearchAdRequest.Builder |
Constructs a SearchAdRequest
with the specified attributes.
Returns | |
---|---|
SearchAdRequest |
Sets the color of the ad URL. Transparency is not supported. rgb(int, int, int)
can be used to
specify this color.
Parameters | |
---|---|
anchorTextColor |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the background color of the ad. Calling this method will override any previous calls to
setBackgroundColor(int)
or setBackgroundGradient(int, int)
. Transparency is not supported.
rgb(int, int, int)
can be used to specify this color.
Parameters | |
---|---|
backgroundColor |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets a gradient for the ad background. Calling this method will override any previous calls
to setBackgroundColor(int)
or setBackgroundGradient(int, int)
. Transparency is not
supported. rgb(int, int, int)
can be used to specify these colors.
Parameters | |
---|---|
top |
int :
The color of the gradient at the top of the ad. |
bottom |
int :
The color of the gradient at the bottom of the ad.
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the border color of the ad container. Transparency is not supported. rgb(int, int, int)
can be used to specify this color. This setting is ignored if setBorderType(int)
is set
to BORDER_TYPE_NONE
.
Parameters | |
---|---|
borderColor |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the thickness of the border in pixels around the ad container. This setting is ignored
if setBorderType(int)
is set to BORDER_TYPE_NONE
.
Parameters | |
---|---|
borderThickness |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the type of border around the ad container. This value must be one of BORDER_TYPE_NONE
, BORDER_TYPE_DASHED
, BORDER_TYPE_DOTTED
, BORDER_TYPE_SOLID
.
Parameters | |
---|---|
borderType |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the color of the call button when a call extension is shown. This value must be one of
CALL_BUTTON_COLOR_DARK
, CALL_BUTTON_COLOR_LIGHT
, CALL_BUTTON_COLOR_MEDIUM
.
Parameters | |
---|---|
callButtonColor |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets custom channels for the ad request. Custom channels allow publishers to track the performance of specific groups of ads. These custom channels need to created on the AdSense website. Reports can then be created based on the channels.
Parameters | |
---|---|
channelIds |
String :
A list of channel IDs separated by '+'.
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the color of the ad description. Transparency is not supported. rgb(int, int, int)
can be
used to specify this color.
Parameters | |
---|---|
descriptionTextColor |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the font used to render the ad. The same font is used in the header, the description and
the anchor. Fonts are specified using the same value that would be used in CSS (e.g., "arial"
).
Parameters | |
---|---|
fontFace |
String
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the text color of the ad header. Transparency is not supported. rgb(int, int, int)
can be
used to specify this color.
Parameters | |
---|---|
headerTextColor |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the font size of the header text in pixels. The font sizes for the description and the anchor are determined from the header size.
Parameters | |
---|---|
headerTextSize |
int
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the user's location for targeting purposes.
Parameters | |
---|---|
location |
Location
|
Returns | |
---|---|
SearchAdRequest.Builder |
Sets the query for requesting a search ad. The query must be set to receive an ad.
Parameters | |
---|---|
query |
String
|
Returns | |
---|---|
SearchAdRequest.Builder |
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".
Parameters | |
---|---|
requestAgent |
String
|
Returns | |
---|---|
SearchAdRequest.Builder |
This method allows you to specify whether you would like your app to be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA) - http://business.ftc.gov/privacy-and-security/childrens-privacy.
If you set this method to true
, you will indicate that your app should be treated
as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).
If you set this method to false
, you will indicate that your app should not be
treated as child-directed for purposes of the Children’s Online Privacy Protection Act
(COPPA).
If you do not set this method, ad requests will include no indication of how you would like your app treated with respect to COPPA.
By setting this method, you certify that this notification is accurate and you are authorized to act on behalf of the owner of the app. You understand that abuse of this setting may result in termination of your Google account.
Note: it may take some time for this designation to be fully implemented in applicable Google services.
This designation will only apply to ad requests for which you have set this method.
Parameters | |
---|---|
tagForChildDirectedTreatment |
boolean :
Set to true to indicate that your app should be
treated as child-directed. Set to false to indicate that your app should not be
treated as child-directed.
|
Returns | |
---|---|
SearchAdRequest.Builder |