SDK Configuration

This article provides detailed instructions on advanced configurations for the RTB-Stack SDK, focusing on saving the Android Advertising ID (AAID) in local storage and customizing the video player settings

Save Android Advertising ID in Local Storage

By default, the RTB-Stack SDK retrieves the AAID from Google Play Services before the first ad request and keeps this value in memory. To expedite the first ad request, you can save the AAID in Shared Preferences and retrieve it before subsequent ad requests.

To Save AAID:

SDKSettings.setShouldSaveAAID(true, this);

If you want to remove the AAID from Shared Preferences, you have to pass false as the first parameter at least once:

SDKSettings.setShouldSaveAAID(false, this);

Change Background Color in Video Player

Customize the background color of both instream and non-instream video players using global settings.

VideoPlayerSettings.getVideoPlayerSettings().setInstreamBackgroundColor("#00FF00");
VideoPlayerSettings.getVideoPlayerSettings().setPlayerBackgroundColor("#FF0000");

Change Text for Buttons in Video Player

Modify the default text for "Learn more" and "Skip" buttons in the video player. Note the maximum length restrictions for each button.

// The maximum length of text is 50 symbols
VideoPlayerSettings.getVideoPlayerSettings().setLearnMoreLabelName("Learn more");

// The maximum length of text is 15 symbols
VideoPlayerSettings.getVideoPlayerSettings().setSkipLabelName("Skip");

Hide Buttons in Video Player

Control the visibility of the "Learn more", "Mute", and "Skip" buttons in the video player through global settings.

VideoPlayerSettings.getVideoPlayerSettings().shouldShowClickThroughControl(false);
VideoPlayerSettings.getVideoPlayerSettings().shouldShowVolumeControl(false);
VideoPlayerSettings.getVideoPlayerSettings().shouldShowSkip(false);
Updated on November 01, 2024