|
Triton Mobile SDK for Android
|
Helps create on-demand ad request URLs. More...
Public Member Functions | |
| AdRequestBuilder (Context context) | |
| Constructor. | |
| AdRequestBuilder | addQueryParameter (String key, boolean value) |
| /copydoc addQueryParameter(String, String) | |
| AdRequestBuilder | addQueryParameter (String key, char value) |
| /copydoc addQueryParameter(String, String) | |
| AdRequestBuilder | addQueryParameter (String key, double value) |
| /copydoc addQueryParameter(String, String) | |
| AdRequestBuilder | addQueryParameter (String key, float value) |
| /copydoc addQueryParameter(String, String) | |
| AdRequestBuilder | addQueryParameter (String key, int value) |
| /copydoc addQueryParameter(String, String) | |
| AdRequestBuilder | addQueryParameter (String key, long value) |
| /copydoc addQueryParameter(String, String) | |
| AdRequestBuilder | addQueryParameter (String key, String value) |
| Adds a key/value pair to the URL query parameters. More... | |
| AdRequestBuilder | addTtags (String[] ttags) |
| Set the Ttags for the Requested URL. | |
| String | build () |
| Returns an URL from the previously set data. More... | |
| AdRequestBuilder | enableLocationTracking (boolean enable) |
| Enables the location tracking using the device's location manager. More... | |
| String | getHost () |
| Returns the ad server host. | |
| HashMap< String, String > | getQueryParameters () |
| Returns the query parameters. | |
| AdRequestBuilder | resetQueryParameters () |
| Clears the the previously set query. | |
| AdRequestBuilder | setHost (String host) |
| Sets ad server host. More... | |
Static Public Attributes | |
| static final String | AGE = "age" |
| int - Age (1 to 125) More... | |
| static final String | ASSET_TYPE = "at" |
| String (comma-separated list) - Asset Type | |
| static final String | ASSET_TYPE_VALUE_AUDIO = "audio" |
| Possible AdRequestBuilder.ASSET_TYPE value. | |
| static final String | ASSET_TYPE_VALUE_VIDEO = "video" |
| Possible AdRequestBuilder.ASSET_TYPE value. | |
| static final String | AUDIO_CODEC = "acodec" |
| String (comma-separated list) - Audio codec | |
| static final String | AUDIO_CODEC_VALUE_AAC_HEV1 = "aac_hev1" |
| Possible AdRequestBuilder.AUDIO_CODEC value. | |
| static final String | AUDIO_CODEC_VALUE_AAC_HEV2 = "aac_hev2" |
| Possible AdRequestBuilder.AUDIO_CODEC value. | |
| static final String | AUDIO_CODEC_VALUE_AAC_LC = "aac_lc" |
| Possible AdRequestBuilder.AUDIO_CODEC value. | |
| static final String | AUDIO_CODEC_VALUE_MP3 = "mp3" |
| Possible AdRequestBuilder.AUDIO_CODEC value. | |
| static final String | AUDIO_MAX_CHANNELS = "maxach" |
| int - Audio max channels | |
| static final String | AUDIO_MIN_CHANNELS = "minach" |
| int - Audio min channels | |
| static final String | AUDIO_SAMPLE_RATE = "asr" |
| String (comma-separated list) - Audio Sample Rates in Hz | |
| static final String | BANNERS = "banners" |
| String (comma-separated list) - Banner capabilities More... | |
| static final String | COUNTRY_CODE = "country" |
| String - Country code (ISO 3166-1 alpha-2) More... | |
| static final String | CUSTOM_SEGMENT_ID = "csegid" |
| int - Custom segment ID (1 to 1000000) More... | |
| static final String | DATE_OF_BIRTH = "dob" |
| String - Date of birth formatted as "YYYY-MM-DD" More... | |
| static final String | FILE_FORMAT = "cntnr" |
| String (comma-separated list) - File Format | |
| static final String | FILE_FORMAT_VALUE_ADTS = "adts" |
| Possible AdRequestBuilder.FILE_FORMAT value. | |
| static final String | FILE_FORMAT_VALUE_FLV = "flv" |
| Possible AdRequestBuilder.FILE_FORMAT value. | |
| static final String | FILE_FORMAT_VALUE_MP3 = "mp3" |
| Possible AdRequestBuilder.FILE_FORMAT value. | |
| static final String | FILE_FORMAT_VALUE_MP4 = "mp4" |
| Possible AdRequestBuilder.FILE_FORMAT value. | |
| static final String | GENDER = "gender" |
| char - Gender ('m' or 'f') | |
| static final char | GENDER_VALUE_FEMALE = 'f' |
| Possible AdRequestBuilder.GENDER value. | |
| static final char | GENDER_VALUE_MALE = 'm' |
| Possible AdRequestBuilder.GENDER value. | |
| static final char | GENDER_VALUE_OTHER = 'o' |
| static final String | LATITUDE = "lat" |
| float - Latitude (-90.0f to 90.0f) More... | |
| static final String | LONGITUDE = "long" |
| float - Longitude (-180.0f to 180.0f) More... | |
| static final String | MAX_BITRATE = "maxbr" |
| int - Max bitrate in kbps | |
| static final String | MAX_DURATION = "maxdur" |
| int - Max duration in seconds | |
| static final String | MAX_FILE_SIZE = "maxsz" |
| int - Max file size in KB | |
| static final String | MIN_BITRATE = "mindbr" |
| int - Min bitrate in kbps | |
| static final String | MIN_DURATION = "mindur" |
| int - Min duration in seconds | |
| static final String | MIN_FILE_SIZE = "minsz" |
| int - Min file size in KB | |
| static final String | POSTAL_CODE = "postalcode" |
| String - Postal/ZIP code More... | |
| static final String | RENDERING_FORMAT = "fmt" |
| Supported render formats for the On-Demand Ad Service. | |
| static final String | RENDERING_FORMAT_VALUE_DAAST = "daast" |
| text/xml; charset=UTF-8 DAAST 1.0 | |
| static final String | RENDERING_FORMAT_VALUE_VAST = "vast" |
| text/xml; charset=UTF-8 VAST 2.0 | |
| static final String | STATION_ID = "stid" |
| int - Station ID More... | |
| static final String | STATION_NAME = "stn" |
| String - Station Name More... | |
| static final String | STORE_URL = "store-url" |
| URL encoded string. | |
| static final String | TYPE = "type" |
| String - Ad type (default: preroll) | |
| static final String | TYPE_VALUE_MIDROLL = "midroll" |
| Possible AdRequestBuilder.TYPE value. | |
| static final String | TYPE_VALUE_PREROLL = "preroll" |
| Possible AdRequestBuilder.TYPE value. | |
| static final String | VIDEO_ASPECT_RATIO = "vaspect" |
| String (comma-separated list) - Video Aspect Ratio | |
| static final String | VIDEO_ASPECT_RATIO_VALUE_16_9 = "16:9" |
| Possible AdRequestBuilder.VIDEO_ASPECT_RATIO value. | |
| static final String | VIDEO_ASPECT_RATIO_VALUE_4_3 = "4:3" |
| Possible AdRequestBuilder.VIDEO_ASPECT_RATIO value. | |
| static final String | VIDEO_ASPECT_RATIO_VALUE_OTHER = "other" |
| Possible AdRequestBuilder.VIDEO_ASPECT_RATIO value. | |
| static final String | VIDEO_CODEC = "vcodec" |
| String (comma-separated list) - Video codec | |
| static final String | VIDEO_CODEC_VALUE_H264 = "h264" |
| Possible AdRequestBuilder.VIDEO_CODEC value. | |
| static final String | VIDEO_CODEC_VALUE_ON2_VP6 = "on2_vp6" |
| Possible AdRequestBuilder.VIDEO_CODEC value. | |
| static final String | VIDEO_MAX_FRAME_RATE = "maxfps" |
| float - Video max frame rate | |
| static final String | VIDEO_MAX_HEIGHT = "maxdh" |
| int - Video max height in density-independent pixels | |
| static final String | VIDEO_MAX_WIDTH = "maxw" |
| int - Video max width in density-independent pixels | |
| static final String | VIDEO_MIN_FRAME_RATE = "minfps" |
| float - Video min frame rate | |
| static final String | VIDEO_MIN_HEIGHT = "minh" |
| int - Video min height in density-independent pixels | |
| static final String | VIDEO_MIN_WIDTH = "minw" |
| int - Video min width in density-independent pixels | |
| static final String | YEAR_OF_BIRTH = "yob" |
| int - Year of birth (1900 to 2005) More... | |
Helps create on-demand ad request URLs.
This class is based on OnDemand_Advertising_Guide.pdf. The user tracking ID is automatically added and there is an option to use the device location manager for location targeting.
A basic validation is done when adding a query parameter.
| AdRequestBuilder com.tritondigital.ads.AdRequestBuilder.addQueryParameter | ( | String | key, |
| String | value | ||
| ) |
Adds a key/value pair to the URL query parameters.
The key and value will be encoded.
| String com.tritondigital.ads.AdRequestBuilder.build | ( | ) |
Returns an URL from the previously set data.
This method also refreshes the user tracking id and the location.
| AdRequestBuilder com.tritondigital.ads.AdRequestBuilder.enableLocationTracking | ( | boolean | enable | ) |
Enables the location tracking using the device's location manager.
Enabling this feature will overwrite the AdRequestBuilder.LATITUDE and AdRequestBuilder.LONGITUDE query parameters.
| AdRequestBuilder com.tritondigital.ads.AdRequestBuilder.setHost | ( | String | host | ) |
Sets ad server host.
|
static |
int - Age (1 to 125)
Clients/players must specify only one of AdRequestBuilder.AGE, AdRequestBuilder.DATE_OF_BIRTH or AdRequestBuilder.YEAR_OF_BIRTH.
|
static |
String (comma-separated list) - Banner capabilities
Players can provide details on their level of support for banners, such as banner sizes and formats.
The ordering of the capability formats is not important.
| Capability | Description |
|---|---|
| 970x250 | IAB Billboard (970x250) |
| 120x60 | IAB Button 2 (120x60) |
| 300x600 | IAB Half Page/Filmstrip (300x600) |
| 728x90 | IAB Leaderboard (728x90) |
| 970x100 | IAB Leaderboard (970x100) |
| 300x250 | IAB Medium Rectangle (300x250) |
| 88x31 | IAB Microbar (88x31) |
| 300x1050 | IAB Portrait (300x1050) |
| 970x90 | IAB Pushdown (970x90) |
| 180x150 | IAB Rectangle (180x150) |
| 320x480 | IAB Smartphone Portrait (320x480) |
| 300x50 | IAB Smartphone Static Banner (300x50) |
| 320x50 | IAB Smartphone Static Wide Banner (320x50) |
| 300x300 | IAB Square (300x300) |
| 970x66 | IAB Super Leaderboard (970x66) |
| 160x600 | IAB Wide Skyscraper (160x600) |
| Client-defined (w x h) | Custom banner size |
|
static |
String - Country code (ISO 3166-1 alpha-2)
Not required individually. If using, however, we recommend that you specify AdRequestBuilder.POSTAL_CODE.
|
static |
int - Custom segment ID (1 to 1000000)
Broadcasters that want to differentiate their listeners into custom broadcaster-specific segments may use the Custom Segment Targeting capability of Tap.
|
static |
String - Date of birth formatted as "YYYY-MM-DD"
Clients/players must specify only one of AdRequestBuilder.AGE, AdRequestBuilder.DATE_OF_BIRTH or AdRequestBuilder.YEAR_OF_BIRTH.
|
static |
float - Latitude (-90.0f to 90.0f)
Not required individually. If using, you must specify AdRequestBuilder.LONGITUDE.
|
static |
float - Longitude (-180.0f to 180.0f)
Not required individually. If using, you must specify AdRequestBuilder.LATITUDE.
|
static |
String - Postal/ZIP code
Valid postal or ZIP code, without spaces. E.g., 89040 or H3G1R8.
Not required individually. If using, however, we recommend that you specify AdRequestBuilder.COUNTRY_CODE.
|
static |
int - Station ID
Either AdRequestBuilder.STATION_ID or AdRequestBuilder.STATION_NAME must be specified when calling the On-Demand Ad Request Service. While both are supported, it is strongly recommended that clients use AdRequestBuilder.STATION_NAME. If both are provided, AdRequestBuilder.STATION_NAME is used (there is no validation check that AdRequestBuilder.STATION_ID matches the name).
Triton Digital assigns station IDs and names when setting up a station. Station names are case-sensitive.
|
static |
String - Station Name
Either AdRequestBuilder.STATION_ID or AdRequestBuilder.STATION_NAME must be specified when calling the On-Demand Ad Request Service. While both are supported, it is strongly recommended that clients use AdRequestBuilder.STATION_NAME. If both are provided, AdRequestBuilder.STATION_NAME is used (there is no validation check that AdRequestBuilder.STATION_ID matches the name).
Triton Digital assigns station IDs and names when setting up a station. Station names are case-sensitive.
|
static |
int - Year of birth (1900 to 2005)
Clients/players must specify only one of AdRequestBuilder.AGE, AdRequestBuilder.DATE_OF_BIRTH or AdRequestBuilder.YEAR_OF_BIRTH.