Triton Mobile SDK for Android 3.5.1 This is a custom android player made by Triton Digital

Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
com.tritondigital.ads.AdRequestBuilder Class Reference

Helps create on-demand ad request URLs. More...

## Public Member Functions
String | getHost ()
| Returns the ad server host.
AdRequestBuilder | setHost (String host)
| Sets ad server host.
| AdRequestBuilder (Context context)
| Constructor.
AdRequestBuilder | addQueryParameter (String key, String value)
| Adds a key/value pair to the URL query parameters.
AdRequestBuilder | addQueryParameter (String key, boolean value)
| /copydoc addQueryParameter(String, String)
AdRequestBuilder | addQueryParameter (String key, char value)
| /copydoc addQueryParameter(String, String)
AdRequestBuilder | addQueryParameter (String key, int 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, long value)
| /copydoc addQueryParameter(String, String)
AdRequestBuilder | resetQueryParameters ()
| Clears the the previously set query.
HashMap< String, String > | getQueryParameters ()
| Returns the query parameters.
AdRequestBuilder | enableLocationTracking (boolean enable)
| Enables the location tracking using the device's location manager.
AdRequestBuilder | addTtags (String[] ttags)
| Set the Ttags for the Requested URL.
String | build ()
| Returns an URL from the previously set data.

## Static Public Attributes
static final String | STATION_ID = "stid"
| int - Station ID
static final String | BUNDLE_ID = "bundle-id"
static final String | STORE_ID = "store-id"
static final String | STORE_URL = "store-url"
| URL encoded string.
static final String | STATION_NAME = "stn"
| String - Station Name
static final String | TYPE = "type"
| String - Ad type (default: preroll)
static final String | TYPE_VALUE_PREROLL = "preroll"
| Possible AdRequestBuilder.TYPE value.
static final String | TYPE_VALUE_MIDROLL = "midroll"
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 | 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"
static final String | MIN_FILE_SIZE = "minsz"
| int - Min file size in KB
static final String | MAX_FILE_SIZE = "maxsz"
| int - Max file size in KB
static final String | FILE_FORMAT = "cntnr"
| String (comma-separated list) - File Format
static final String | FILE_FORMAT_VALUE_MP3 = "mp3"
| Possible AdRequestBuilder.FILE_FORMAT value.
static final String | FILE_FORMAT_VALUE_ADTS = "adts"
static final String | FILE_FORMAT_VALUE_FLV = "flv"
static final String | FILE_FORMAT_VALUE_MP4 = "mp4"
static final String | MIN_DURATION = "mindur"
| int - Min duration in seconds
static final String | MAX_DURATION = "maxdur"
| int - Max duration in seconds
static final String | MIN_BITRATE = "mindbr"
| int - Min bitrate in kbps
static final String | MAX_BITRATE = "maxbr"
| int - Max bitrate in kbps
static final String | VIDEO_MIN_WIDTH = "minw"
| int - Video min width in density-independent pixels
static final String | VIDEO_MAX_WIDTH = "maxw"
| int - Video max width in density-independent pixels
static final String | VIDEO_MIN_HEIGHT = "minh"
| int - Video min height in density-independent pixels
static final String | VIDEO_MAX_HEIGHT = "maxdh"
| int - Video max height in density-independent pixels
static final String | AUDIO_CODEC = "acodec"
| String (comma-separated list) - Audio codec
static final String | AUDIO_CODEC_VALUE_MP3 = "mp3"
| Possible AdRequestBuilder.AUDIO_CODEC value.
static final String | AUDIO_CODEC_VALUE_AAC_HEV1 = "aac_hev1"
static final String | AUDIO_CODEC_VALUE_AAC_HEV2 = "aac_hev2"
static final String | AUDIO_CODEC_VALUE_AAC_LC = "aac_lc"
static final String | AUDIO_MIN_CHANNELS = "minach"
| int - Audio min channels
static final String | AUDIO_MAX_CHANNELS = "maxach"
| int - Audio max channels
static final String | AUDIO_SAMPLE_RATE = "asr"
| String (comma-separated list) - Audio Sample Rates in Hz
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"
static final String | VIDEO_ASPECT_RATIO = "vaspect"
| String (comma-separated list) - Video Aspect Ratio
static final String | VIDEO_ASPECT_RATIO_VALUE_4_3 = "4:3"
| Possible AdRequestBuilder.VIDEO_ASPECT_RATIO value.
static final String | VIDEO_ASPECT_RATIO_VALUE_16_9 = "16:9"
static final String | VIDEO_ASPECT_RATIO_VALUE_OTHER = "other"
static final String | VIDEO_MIN_FRAME_RATE = "minfps"
| float - Video min frame rate
static final String | VIDEO_MAX_FRAME_RATE = "maxfps"
| float - Video max frame rate
static final String | LATITUDE = "lat"
| float - Latitude (-90.0f to 90.0f)
static final String | LONGITUDE = "long"
| float - Longitude (-180.0f to 180.0f)
static final String | POSTAL_CODE = "postalcode"
| String - Postal/ZIP code
static final String | COUNTRY_CODE = "country"
| String - Country code (ISO 3166-1 alpha-2)
static final String | AGE = "age"
| int - Age (1 to 125)
static final String | DATE_OF_BIRTH = "dob"
| String - Date of birth formatted as "YYYY-MM-DD"
static final String | YEAR_OF_BIRTH = "yob"
| int - Year of birth (1900 to 2005)
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'
static final char | GENDER_VALUE_OTHER = 'o'
static final String | CUSTOM_SEGMENT_ID = "csegid"
| int - Custom segment ID (1 to 1000000)
static final String | BANNERS = "banners"
| String (comma-separated list) - Banner capabilities
static final String | ADS_GUIDE_VERSION_KEY = "version"
static final String | ADS_GUIDE_VERSION_VALUE = "1.5.1"

## Detailed Description

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.

## Member Function Documentation

## ◆ addQueryParameter()

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.

## ◆ build()

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.

## ◆ enableLocationTracking()

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.

See Android location manager.

AndroidManifest.xml Permissions
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

## ◆ setHost()

AdRequestBuilder com.tritondigital.ads.AdRequestBuilder.setHost | ( | String | host | ) |

Sets ad server host.

Note
  Please contact Triton Digital Customer Support to obtain the correct On-Demand Ad Service Host name to use for on-demand ad requests for pre-production and production uses.

## Member Data Documentation

## ◆ AGE

final String com.tritondigital.ads.AdRequestBuilder.AGE = "age"
| static

int - Age (1 to 125)

Clients/players must specify only one of AdRequestBuilder.AGE, AdRequestBuilder.DATE_OF_BIRTH or AdRequestBuilder.YEAR_OF_BIRTH.

## ◆ BANNERS

final String com.tritondigital.ads.AdRequestBuilder.BANNERS = "banners"
| 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.

Note
  Before attempting to use player capability targeting, please contact the Triton Digital Support Team to enable Player Capability Targeting for your broadcaster. Currently, Player Capability Targeting only works with Tap advertising.

Supported Formats

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

## ◆ COUNTRY_CODE

final String com.tritondigital.ads.AdRequestBuilder.COUNTRY_CODE = "country"
| static

String - Country code (ISO 3166-1 alpha-2)

Not required individually. If using, however, we recommend that you specify AdRequestBuilder.POSTAL_CODE.

## ◆ CUSTOM_SEGMENT_ID

final String com.tritondigital.ads.AdRequestBuilder.CUSTOM_SEGMENT_ID = "csegid"
| 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.

Note
  Before use by players, please contact the Triton Digital Support Team to enable Custom Segment ID Targeting for your broadcaster. Currently, Custom Segment ID Targeting only works with Tap advertising.

## ◆ DATE_OF_BIRTH

final String com.tritondigital.ads.AdRequestBuilder.DATE_OF_BIRTH = "dob"
| static

String - Date of birth formatted as "YYYY-MM-DD"

## ◆ LATITUDE

final String com.tritondigital.ads.AdRequestBuilder.LATITUDE = "lat"
| static

float - Latitude (-90.0f to 90.0f)

Not required individually. If using, you must specify AdRequestBuilder.LONGITUDE.

## ◆ LONGITUDE

final String com.tritondigital.ads.AdRequestBuilder.LONGITUDE = "long"
| static

float - Longitude (-180.0f to 180.0f)

Not required individually. If using, you must specify AdRequestBuilder.LATITUDE.

## ◆ POSTAL_CODE

final String com.tritondigital.ads.AdRequestBuilder.POSTAL_CODE = "postalcode"
| 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.

## ◆ STATION_ID

final String com.tritondigital.ads.AdRequestBuilder.STATION_ID = "stid"
| 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.

## ◆ STATION_NAME

final String com.tritondigital.ads.AdRequestBuilder.STATION_NAME = "stn"
| static

String - Station Name

## ◆ YEAR_OF_BIRTH

final String com.tritondigital.ads.AdRequestBuilder.YEAR_OF_BIRTH = "yob"
| static

int - Year of birth (1900 to 2005)

The documentation for this class was generated from the following file:

- ads/src/main/java/com/tritondigital/ads/AdRequestBuilder.java