AdSettings
这个类有新版本。查看 最新版本。

AdSettings contains global settings for all ad controls.

扩展:Object
应用安装包:ads
构造函数
AdSettings()
public AdSettings()
类方法
addTestDevice(String)

Adds a test device.

Copy the current device Id from debug log and add it as a test device to get test ads. Apps running on emulator will automatically get test ads. Test devices should be added before Ad.loadAd() is called.

public static void addTestDevice(String deviceIdHash)
参数描述
deviceIdHashId of the device to use test mode, can be obtained from debug log
addTestDevices(Collection)

Adds a collection of test devices.

Copy the current device Id from debug log and add it as a test device to get test ads. Apps running on emulator will automatically get test ads. Test devices should be added before Ad.loadAd() is called.

public static void addTestDevices(Collection deviceIdHashes)
参数描述
deviceIdHashesIds of the device to use test mode, can be obtained from debug log
clearTestDevices()

Clears the collection of test devices.

public static void clearTestDevices()
isTestMode(Context)

Gets whether ad controls are working in test mode.

public static boolean isTestMode(Context context)
参数描述
contextAndroid context
Returns
Whether in test mode
setUrlPrefix(String)

Sets the url prefix to use when making requests. This method should never be used in production.

public static void setUrlPrefix(String urlPrefix)
参数描述
urlPrefixUrl prefix
getUrlPrefix()

Gets the url prefix.

public static String getUrlPrefix()
Returns
Url prefix
setIsChildDirected(boolean)

Sets whether the ad control is targeting a child.

public static void setIsChildDirected(boolean childDirected)
参数描述
childDirectedWhether the ad control is targeting a child
isChildDirected()

Gets whether the ad control is targeting a child.

public static boolean isChildDirected()
Returns
Whether the ad control is targeting a child
常量
TAG
public static final String TAG