| Modifier and Type | Class and Description |
|---|---|
static interface |
AATKit.Consent
Used for passing of detailed GDPR consent.
|
static interface |
AATKit.Delegate
Notifies about AATKit events.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
BANNER_DEFAULT_RELOAD_INTERVAL_IN_SECONDS |
static int |
BANNER_MAX_RELOAD_INTERVAL_IN_SECONDS |
static int |
BANNER_MIN_RELOAD_INTERVAL_IN_SECONDS |
| Constructor and Description |
|---|
AATKit() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAdNetworkForKeywordTargeting(AdNetwork network)
Adds an ad network to the list of ad networks that receive targeting keywords (if any set).
|
static void |
attachNativeAdToLayout(NativeAdData nativeAd,
ViewGroup layout)
Deprecated.
This method is deprecated and will be removed in the future. Please use
attachNativeAdToLayout(NativeAdData, ViewGroup, View, View, View) instead. |
static void |
attachNativeAdToLayout(NativeAdData nativeAd,
ViewGroup layout,
View mainImageView,
View iconView)
Deprecated.
This method is deprecated and will be removed in the future. Please use
attachNativeAdToLayout(NativeAdData, ViewGroup, View, View, View) instead. |
static void |
attachNativeAdToLayout(NativeAdData nativeAd,
ViewGroup layout,
View mainImageView,
View iconView,
View CTAView)
Binds the native ad instance with given ViewGroup.
|
static BannerPlacement |
createBannerPlacement(String name,
BannerConfiguration configuration)
Creates a new banner placement.
|
static int |
createNativeAdPlacement(String name,
boolean supportsMainImage)
Creates a new native ad placement.
|
static int |
createPlacement(String name,
PlacementSize size)
Creates placement with given name and size.
|
static int |
createRewardedVideoPlacement(String name)
Creates a new rewarded video placement.
|
static int |
currentlyLoadingNativeAdsOnPlacement(int placementId)
Returns how many ads are currently loading for given native ad placement.
|
static void |
detachNativeAdFromLayout(NativeAdData nativeAd)
Removes the binding between native ad and ViewGroup.
|
static void |
disableDebugScreen()
Disables the debug screen appearing after shaking the device.
|
static void |
enableDebugScreen()
Enables debug screen that will show after shaking the device.
|
static void |
enableTestMode(int testAppId)
Deprecated.
use
init(AATKitConfiguration) with setting the test mode in configuration object instead. |
static Set<BannerSize> |
fittingBannerSizesLandscape(Context context)
Returns the set of
BannerSize that will fit on a given device in landscape screen orientation. |
static Set<BannerSize> |
fittingBannerSizesPortrait(Context context)
Returns the set of
BannerSize that will fit on a given device in portrait screen orientation. |
static String |
getDebugInfo()
Used for obtaining debug information (the same that would be presented in dialog after shaking the device if debug screen is enabled)
|
static String |
getFullVersion() |
static NativeAdData |
getNativeAd(int placementId)
Returns the instance of native ad for given native ad placement.
|
static String |
getNativeAdAdvertiser(NativeAdData nativeAd)
Returns the advertiser asset of native ad (not the same as ad network providing it).
|
static View |
getNativeAdBrandingLogo(NativeAdData nativeAd)
Returns the view with branding logo or ad information related to the ad network providing the native ad.
|
static String |
getNativeAdCallToAction(NativeAdData nativeAd)
Returns the call to action of native ad.
|
static String |
getNativeAdDescription(NativeAdData nativeAd)
Returns the description of native ad.
|
static String |
getNativeAdIconUrl(NativeAdData nativeAd)
Returns the URL of the icon asset of native ad.
|
static String |
getNativeAdImageUrl(NativeAdData nativeAd)
Returns the URL of the image asset of native ad.
|
static AdNetwork |
getNativeAdNetwork(NativeAdData nativeAd)
Returns the ad network providing given native ad
|
static NativeAd.NativeAdRating |
getNativeAdRating(NativeAdData nativeAd)
Returns the rating asset of native ad.
|
static String |
getNativeAdTitle(NativeAdData nativeAd)
Returns the title of native ad.
|
static NativeAd.Type |
getNativeAdType(NativeAdData nativeAd)
Deprecated.
For Google Native Ads, it is now recommended to use the Unified ad type. See our documentation on native ads integration to learn more.
|
static String |
getOption(String optionName)
Get option from AATKit.
|
static int |
getPlacementIdForName(String placementName)
Returns identifier of placement with given name, or -1 if placement with given name does not exist.
|
static View |
getPlacementView(int placementId)
Returns placement view.
|
static int |
getPlacmentIdForName(String placementName)
Deprecated.
This method is deprecated and will be removed in the future. Please use
getPlacementIdForName(String) method instead. |
static String |
getVersion() |
static boolean |
hasAdForPlacement(int placementId)
Returns true if there is an ad loaded for given placementId.
|
static void |
init(AATKitConfiguration configuration)
Initializes the AATKit library.
|
static void |
init(Application application,
AATKit.Delegate delegate)
Deprecated.
use
init(AATKitConfiguration) instead. |
static void |
init(Application application,
AATKit.Delegate delegate,
boolean enableRuleCaching,
String initialRules)
Deprecated.
use
init(AATKitConfiguration) instead. |
static void |
init(Application application,
AATKit.Delegate delegate,
int testId)
Deprecated.
use
init(AATKitConfiguration) instead. |
static void |
initWithoutDebugScreen(Application application,
AATKit.Delegate delegate)
Deprecated.
use
init(AATKitConfiguration) instead. |
static boolean |
isFrequencyCapReachedForNativePlacement(int placementId)
Deprecated.
This method is deprecated and will be removed in the future. Please use
isFrequencyCapReachedForPlacement(int) method instead. |
static boolean |
isFrequencyCapReachedForPlacement(int placementId)
Checks if desired impression cap (set on AddApptr Dashboard) is reached for given native ad, fullscreen, rewarded video or VAST placement.
|
static boolean |
isNativeAdExpired(NativeAdData nativeAd)
Returns if the native ad has expired and shall no longer be used.
|
static boolean |
isNativeAdReady(NativeAdData nativeAd)
Returns if the native ad is ready to be displayed.
|
static boolean |
isNetworkEnabled(AdNetwork network)
Returns true if ad network is enabled, false otherwise.
|
static boolean |
isOptionEnabled(String optionName)
Convenience method for checking if option is enabled in AATKit.
|
static boolean |
isTablet(Context context)
Checks if AATKit recognizes given device as tablet.
|
static PlacementSize |
maximumBannerSizeLandscape(Context context)
Returns the
PlacementSize with maximum width that will fit on a given device in landscape screen orientation. |
static PlacementSize |
maximumBannerSizePortrait(Context context)
Returns the
PlacementSize with maximum width that will fit on a given device in portrait screen orientation. |
static void |
onActivityPause(Activity activity)
Notifies AATKit about activity pause.
|
static void |
onActivityResume(Activity activity)
Notifies AATKit about activity resume.
|
static void |
reconfigure(AATKitRuntimeConfiguration configuration)
Allows to reconfigure the options for GDPR consent.
|
static boolean |
reloadPlacement(int placementId)
Requests placement reload.
|
static boolean |
reloadPlacement(int placementId,
boolean forceLoad)
Requests placement reload.
|
static void |
removeAdNetworkForKeywordTargeting(AdNetwork network)
Removes an ad network from the list of ad networks that receive targeting keywords (if any set).
|
static void |
reportAdSpaceForNativePlacement(int placementId)
Deprecated.
Please use
reportAdSpaceForPlacement(int) instead. |
static void |
reportAdSpaceForPlacement(int placementId)
Indicates that the application wants to display a native or VAST ad for given placement.
|
static void |
reportVASTClick(VASTAdData data)
Reports the VAST ad click.
|
static void |
reportVASTImpression(VASTAdData data)
Reports the VAST ad impression.
|
static void |
reportVASTViewableImpression(VASTAdData data)
Reports the VAST ad viewable impression.
|
static void |
setContentTargetingUrl(int placementId,
String targetingUrl)
Sets the content targeting url for the given placement.
|
static void |
setContentTargetingUrl(String targetingUrl)
Sets the content targeting url for the application.
|
static void |
setInitialRules(String rules)
Allows setting of ad rules that will be used before real rules from the server are downloaded.
|
static void |
setLogLevel(int logLevel)
Allows to set log level from code.
|
static void |
setNetworkEnabled(AdNetwork network,
boolean enabled)
Allows to enable or disable selected ad networks.
|
static void |
setOption(String optionName,
String optionValue)
Set option in AATKit.
|
static void |
setPlacementAutoreloadInterval(int placementId,
int seconds)
Sets reload time that will be used instead of time configured on addapptr.com account.
|
static void |
setPlacementContentGravity(int placementId,
int gravity)
Sets gravity for ads that don't fill entire placement area.
|
static void |
setPlacementDefaultImageBitmap(int placementId,
Bitmap image)
Sets placement default image.
|
static void |
setPlacementDefaultImageResource(int placementId,
int resId)
Sets placement default image.
|
static void |
setRuleCachingEnabled(boolean enabled)
Allows the AATKit to preserve last downloaded ad rules when the application is closed.
|
static void |
setTargetingInfo(int placementId,
Map<String,List<String>> info)
Sets the targeting information for the given placement.
|
static void |
setTargetingInfo(Map<String,List<String>> info)
Sets the targeting information for the application.
|
static void |
setVASTRequestParameters(int placementId,
VASTRequestParameters parameters)
Sets VAST ad request parameters.
|
static boolean |
showPlacement(int placementId)
Shows interstitial ad if ad is ready.
|
static void |
startPlacementAutoReload(int placementId)
Enables automatic reloading of placement.
|
static void |
startPlacementAutoReload(int placementId,
int seconds)
Enables automatic reloading of placement and sets custom reload time.
|
static void |
stopPlacementAutoReload(int placementId)
Disables automatic reloading of placement.
|
public static final int BANNER_DEFAULT_RELOAD_INTERVAL_IN_SECONDS
public static final int BANNER_MIN_RELOAD_INTERVAL_IN_SECONDS
public static final int BANNER_MAX_RELOAD_INTERVAL_IN_SECONDS
public AATKit()
public static String getVersion()
public static String getFullVersion()
public static void init(AATKitConfiguration configuration)
configuration - Configuration for AATKit.AATKitConfiguration@Deprecated public static void init(Application application, AATKit.Delegate delegate)
init(AATKitConfiguration) instead.application - Reference to Application.delegate - Optional delegate allowing to listen for AATKit events.AATKit.Delegate@Deprecated public static void init(Application application, AATKit.Delegate delegate, boolean enableRuleCaching, String initialRules)
init(AATKitConfiguration) instead.application - Reference to Application.delegate - Optional delegate allowing to listen for AATKit events.enableRuleCaching - Sets if AATKit should preserve last downloaded ad rules when the application is closed.initialRules - Optional parameter (can be null). Allows to set initial rules that will be used before real config is downloaded from the server.AATKit.Delegate@Deprecated public static void init(Application application, AATKit.Delegate delegate, int testId)
init(AATKitConfiguration) instead.application - Reference to Application.delegate - Optional delegate allowing to listen for AATKit events.testId - Test application id obtained from addapptr.com account.@Deprecated public static void initWithoutDebugScreen(Application application, AATKit.Delegate delegate)
init(AATKitConfiguration) instead.init(Application, Delegate) method instead. Should be called once during application initialization before any other calls
to AATKit.application - Reference to Application.delegate - Optional delegate allowing to listen for AATKit events.AATKit.Delegate@Deprecated public static void enableTestMode(int testAppId)
init(AATKitConfiguration) with setting the test mode in configuration object instead.testAppId - Test application id obtained from addapptr.com account.public static void enableDebugScreen()
public static void disableDebugScreen()
public static String getDebugInfo()
public static void reconfigure(AATKitRuntimeConfiguration configuration)
configuration - New configuration.public static boolean isTablet(Context context)
context - The Context of your application.public static PlacementSize maximumBannerSizePortrait(Context context)
PlacementSize with maximum width that will fit on a given device in portrait screen orientation.context - The Context of your application.PlacementSize best fitting current devicepublic static PlacementSize maximumBannerSizeLandscape(Context context)
PlacementSize with maximum width that will fit on a given device in landscape screen orientation.context - The Context of your application.PlacementSize best fitting current devicepublic static Set<BannerSize> fittingBannerSizesPortrait(Context context)
BannerSize that will fit on a given device in portrait screen orientation.context - The Context of your application.BannerSize fitting current devicepublic static Set<BannerSize> fittingBannerSizesLandscape(Context context)
BannerSize that will fit on a given device in landscape screen orientation.context - The Context of your application.BannerSize fitting current devicepublic static void onActivityResume(Activity activity)
activity - Reference to Activity.public static void onActivityPause(Activity activity)
activity - Reference to Activity.public static int createPlacement(String name, PlacementSize size)
name - Unique name of placement. The same name will be used in addapptr.com account.size - Size of placement. Use PlacementSize.Fullscreen for interstitials, PlacementSize.Native for native ads and other sizes for banner ads.public static int createNativeAdPlacement(String name, boolean supportsMainImage)
name - Unique name of placement. The same name will be used in addapptr.com account.supportsMainImage - True if the native ads returned should have main image asset. Keep in mind that if main image is used, it has to be displayed.public static BannerPlacement createBannerPlacement(String name, BannerConfiguration configuration)
The placement will create a copy of the configuration. Any changes made to the configuration after placement is created will be ignored.
name - Unique name of placement. The same name will be used in addapptr.com account.configuration - The configuration for this placement. The placement will ignore any changes made to configuration after it was created.public static int createRewardedVideoPlacement(String name)
name - Unique name of placement. The same name will be used in addapptr.com account.public static void startPlacementAutoReload(int placementId)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).public static void startPlacementAutoReload(int placementId, int seconds)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).seconds - Interval between ad reloads. Should be a value from 30 to 600 seconds.public static void stopPlacementAutoReload(int placementId)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).public static void setPlacementAutoreloadInterval(int placementId, int seconds)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).seconds - Interval between ad reloads. Should be a value from 30 to 600 seconds.public static boolean reloadPlacement(int placementId)
For banners it will not cause new banner to show more often than set banner refresh interval (default: 30s) - instead, it will set a timer to reload and show next ad when the refresh interval passes. To force ad reload and display before this delay, use the method reloadPlacement(int, boolean) instead.
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).reloadPlacement(int, boolean)public static boolean reloadPlacement(int placementId, boolean forceLoad)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).forceLoad - True if you want to be able to reload and show new banner before set banner reload interval (default: 30s) between reloads, false otherwise.reloadPlacement(int)public static View getPlacementView(int placementId)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).placementId is not valid.@Deprecated public static void attachNativeAdToLayout(NativeAdData nativeAd, ViewGroup layout)
attachNativeAdToLayout(NativeAdData, ViewGroup, View, View, View) instead.nativeAd - Native ad instance.layout - ViewGroup used to render the native ad.@Deprecated public static void attachNativeAdToLayout(NativeAdData nativeAd, ViewGroup layout, View mainImageView, View iconView)
attachNativeAdToLayout(NativeAdData, ViewGroup, View, View, View) instead.nativeAd - Native ad instance.layout - ViewGroup used to render the native ad.mainImageView - View used to show the main image of the ad. Can be null.iconView - View used to show the icon of the native ad.public static void attachNativeAdToLayout(NativeAdData nativeAd, ViewGroup layout, View mainImageView, View iconView, View CTAView)
nativeAd - Native ad instance.layout - ViewGroup used to render the native ad.mainImageView - View used to show the main image of the ad. Can be null.iconView - View used to show the icon of the native ad.CTAView - View used to show the Call To Action of the native ad. Can be null.public static void detachNativeAdFromLayout(NativeAdData nativeAd)
nativeAd - Native ad instance.public static String getNativeAdTitle(NativeAdData nativeAd)
nativeAd - Native ad instance.public static String getNativeAdDescription(NativeAdData nativeAd)
nativeAd - Native ad instance.public static String getNativeAdCallToAction(NativeAdData nativeAd)
nativeAd - Native ad instance.public static String getNativeAdImageUrl(NativeAdData nativeAd)
nativeAd - Native ad instance.public static String getNativeAdIconUrl(NativeAdData nativeAd)
nativeAd - Native ad instance.public static NativeAd.NativeAdRating getNativeAdRating(NativeAdData nativeAd)
nativeAd - Native ad instance.public static View getNativeAdBrandingLogo(NativeAdData nativeAd)
nativeAd - Native ad insance.public static String getNativeAdAdvertiser(NativeAdData nativeAd)
nativeAd - Native ad instance.@Deprecated public static NativeAd.Type getNativeAdType(NativeAdData nativeAd)
NativeAd.Type.UNKNOWNnativeAd - Native ad instance.public static AdNetwork getNativeAdNetwork(NativeAdData nativeAd)
nativeAd - Native ad instance.public static boolean isNativeAdExpired(NativeAdData nativeAd)
nativeAd - Native ad instance.public static boolean isNativeAdReady(NativeAdData nativeAd)
nativeAd - Native ad instance.@Deprecated public static void reportAdSpaceForNativePlacement(int placementId)
reportAdSpaceForPlacement(int) instead.placementId - Placement identifier obtained from
createPlacement(String, PlacementSize).public static void reportAdSpaceForPlacement(int placementId)
placementId - Placement identifier obtained from
createPlacement(String, PlacementSize).public static int currentlyLoadingNativeAdsOnPlacement(int placementId)
placementId - Placement identifier obtained from
createPlacement(String, PlacementSize).@Deprecated public static boolean isFrequencyCapReachedForNativePlacement(int placementId)
isFrequencyCapReachedForPlacement(int) method instead.placementId - Placement identifier obtained from
createPlacement(String, PlacementSize).public static boolean isFrequencyCapReachedForPlacement(int placementId)
placementId - Placement identifier obtained from
createPlacement(String, PlacementSize).public static NativeAdData getNativeAd(int placementId)
placementId - Placement identifier obtained from
createPlacement(String, PlacementSize).@Deprecated public static int getPlacmentIdForName(String placementName)
getPlacementIdForName(String) method instead.placementName - Placent name, used when creating placement with createPlacement(String, PlacementSize) method.public static int getPlacementIdForName(String placementName)
placementName - Placent name, used when creating placement with createPlacement(String, PlacementSize) method.public static boolean hasAdForPlacement(int placementId)
placementId - Placement identifier obtained from
createPlacement(String, PlacementSize).public static boolean showPlacement(int placementId)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).public static void setNetworkEnabled(AdNetwork network, boolean enabled)
network - Ad network.enabled - True to enable, false to disable.public static boolean isNetworkEnabled(AdNetwork network)
network - Ad network.public static void setPlacementDefaultImageBitmap(int placementId, Bitmap image)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).image - The bitmap to set.public static void setPlacementDefaultImageResource(int placementId, int resId)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).resId - The identifier of the resource.public static String getOption(String optionName)
setOption(String, String) method.optionName - The name of the option to be checked.public static boolean isOptionEnabled(String optionName)
setOption(String, String) method.optionName - The name of the option to be checked.public static void setOption(String optionName, String optionValue)
optionName - The name of the option to be set.optionValue - The value of the option to be set.public static void setTargetingInfo(Map<String,List<String>> info)
info - Map with targeting informationsetTargetingInfo(int, Map)public static void setTargetingInfo(int placementId, Map<String,List<String>> info)
setTargetingInfo(Map).placementId - Placement identifier obtained from createPlacement(String, PlacementSize).info - Map with targeting informationpublic static void setContentTargetingUrl(String targetingUrl)
targetingUrl - The targeting urlsetContentTargetingUrl(int, String)public static void setContentTargetingUrl(int placementId, String targetingUrl)
setContentTargetingUrl(String).placementId - Placement identifier obtained from createPlacement(String, PlacementSize).targetingUrl - The targeting urlpublic static void addAdNetworkForKeywordTargeting(AdNetwork network)
network - Chosen ad network.public static void removeAdNetworkForKeywordTargeting(AdNetwork network)
network - Chosen ad network.public static void setPlacementContentGravity(int placementId, int gravity)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).gravity - The Gravity to set.public static void setInitialRules(String rules)
rules - String containing the rules to be used.public static void setRuleCachingEnabled(boolean enabled)
enabled - True to enable, false to disable.public static void setLogLevel(int logLevel)
logLevel - Desired log level, as in Log class.public static void reportVASTImpression(VASTAdData data)
data - The data for a VAST ad which has been impressed.public static void reportVASTViewableImpression(VASTAdData data)
data - The VAST ad data for which the viewable impression should be counted.public static void reportVASTClick(VASTAdData data)
data - The data for a VAST ad which has been clicked.public static void setVASTRequestParameters(int placementId, VASTRequestParameters parameters)
placementId - Placement identifier obtained from createPlacement(String, PlacementSize).parameters - Parameters to set for a given placement identifier.