public class AdSettings
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
Constructor and Description |
---|
AdSettings() |
Modifier and Type | Method and Description |
---|---|
static void |
addTestDevice(java.lang.String deviceIdHash)
Adds a test device.
|
static void |
addTestDevices(java.util.Collection<java.lang.String> deviceIdHashes)
Adds a collection of test devices.
|
static void |
clearTestDevices()
Clears the collection of test devices.
|
static java.lang.String |
getMediationService()
Returns the name of the mediation service that is mediating Audience Network
|
static java.lang.String |
getUrlPrefix()
Gets the url prefix.
|
static boolean |
isChildDirected()
Gets whether the ad control is targeting a child.
|
static boolean |
isTestMode(android.content.Context context)
Gets whether ad controls are working in test mode.
|
static boolean |
isVideoAutoplay()
Gets whether video autoplay is enabled
|
static boolean |
isVideoAutoplayOnMobile()
Gets whether video autoplay is only enabled on Wifi or not
|
static void |
setIsChildDirected(boolean childDirected)
Sets whether the ad control is targeting a child.
|
static void |
setMediationService(java.lang.String mediationService)
Sets the name of the mediation service that is mediating Audience Network.
|
static void |
setUrlPrefix(java.lang.String urlPrefix)
Sets the url prefix to use when making requests.
|
static void |
setVideoAutoplay(boolean enabled)
Sets the setting for video autoplay
|
static void |
setVideoAutoplayOnMobile(boolean enabled)
Sets the setting for video autoplay on mobile networks
|
public static final boolean DEBUG
public static void addTestDevice(java.lang.String deviceIdHash)
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.
deviceIdHash
- id of the device to use test mode, can be obtained from debug logpublic static void addTestDevices(java.util.Collection<java.lang.String> deviceIdHashes)
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.
deviceIdHashes
- ids of the device to use test mode, can be obtained from debug logpublic static void clearTestDevices()
public static boolean isTestMode(android.content.Context context)
context
- android contextpublic static void setUrlPrefix(java.lang.String urlPrefix)
urlPrefix
- url prefixpublic static java.lang.String getUrlPrefix()
public static boolean isVideoAutoplay()
public static boolean isVideoAutoplayOnMobile()
public static void setVideoAutoplay(boolean enabled)
enabled
- whether video autoplay should be enabled or notpublic static void setVideoAutoplayOnMobile(boolean enabled)
enabled
- whether video autoplay should be enabled only on Wifipublic static void setMediationService(java.lang.String mediationService)
If an ad provider service is mediating Audience Network in their sdk, it is required to set the name of the mediation service.
mediationService
- string representing the name of the mediation service
that is mediating Audience Networkpublic static java.lang.String getMediationService()
public static void setIsChildDirected(boolean childDirected)
childDirected
- whether the ad control is targeting a childpublic static boolean isChildDirected()