public class AdSettings extends Object
Constructor and Description |
---|
AdSettings() |
Modifier and Type | Method and Description |
---|---|
static void |
addTestDevice(String deviceIdHash)
Adds a test device.
|
static void |
addTestDevices(Collection<String> deviceIdHashes)
Adds a collection of test devices.
|
static void |
clearTestDevices()
Clears the collection of test devices.
|
static String |
getUrlPrefix()
Gets the url prefix.
|
static boolean |
isChildDirected()
Gets whether the ad control is targeting a child.
|
static boolean |
isTestMode(Context context)
Gets whether ad controls are working in test mode.
|
static void |
setIsChildDirected(boolean childDirected)
Sets whether the ad control is targeting a child.
|
static void |
setUrlPrefix(String urlPrefix)
Sets the url prefix to use when making requests.
|
public static final String TAG
public static void addTestDevice(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(Collection<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(Context context)
context
- android contextpublic static void setUrlPrefix(String urlPrefix)
urlPrefix
- url prefixpublic static String getUrlPrefix()
public static void setIsChildDirected(boolean childDirected)
childDirected
- whether the ad control is targeting a childpublic static boolean isChildDirected()