public class AdTargetingOptions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AdTargetingOptions.Gender
If your app collects gender information from the user, then
you can pass that information to the Amazon Mobile Ad Network.
|
Constructor and Description |
---|
AdTargetingOptions()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsAdvancedOption(java.lang.String key)
Returns whether an advanced option has been set.
|
AdTargetingOptions |
enableGeoLocation(boolean enable)
If your app or the device is enabled to provide the latitude and longitude
coordinates, you can allow the Amazon Mobile Ads API to send these values
to the Amazon Mobile Ad Network.
|
java.lang.String |
getAdvancedOption(java.lang.String key)
Gets the value of an advanced option.
|
int |
getAge()
Gets the current value of the age option.
|
AdTargetingOptions.Gender |
getGender()
Gets the current value of the gender option.
|
boolean |
isGeoLocationEnabled()
Returns the current value of the use geo-location option.
|
AdTargetingOptions |
setAdvancedOption(java.lang.String key,
java.lang.String value)
Sets advanced options using String key/value pairs.
|
AdTargetingOptions |
setAge(int age)
If your app collects age information from the user, then you can pass that
information to the Amazon Mobile Ad Network.
|
AdTargetingOptions |
setGender(AdTargetingOptions.Gender gender)
If your app collects gender information from the user, then you can pass that
information to the Amazon Mobile Ad Network.
|
public AdTargetingOptions enableGeoLocation(boolean enable)
enable
- Whether to use latitude and longitude information when requesting ads.public boolean isGeoLocationEnabled()
public AdTargetingOptions setGender(AdTargetingOptions.Gender gender)
gender
- The user's gender.public AdTargetingOptions.Gender getGender()
public AdTargetingOptions setAge(int age)
age
- The user's age.public int getAge()
public AdTargetingOptions setAdvancedOption(java.lang.String key, java.lang.String value)
AdLayout.loadAd(AdTargetingOptions)
requests
you can specify a floor price in micro-dollars. For example,
if you wanted to earn a minimum of $0.85 per thousand ads returned, then you would specify
'850000' as the value in micro-dollarskey
- The advanced option key.value
- The advanced option value. Passing null will remove the advanced option specified by the key.java.lang.IllegalArgumentException
- if the key is null or empty stringpublic boolean containsAdvancedOption(java.lang.String key)
key
- The key of the advanced option to check for.public java.lang.String getAdvancedOption(java.lang.String key)
key
- The key of the advanced option.