Object AATKit

  • All Implemented Interfaces:

    
    public class AATKit
    
                        
    • Constructor Detail

    • Method Detail

      • init

         final static Unit init(AATKitConfiguration configuration)

        Initializes the AATKit library. Should be called once during application initialization before any other calls to AATKit.

        Parameters:
        configuration - Configuration for AATKit.
      • enableDebugScreen

         final static Unit enableDebugScreen()

        Enables debug screen that will show after shaking the device. It is already enabled by default.

      • disableDebugScreen

         final static Unit disableDebugScreen()

        Disables the debug screen appearing after shaking the device. It is enabled by default.

      • isTablet

         final static Boolean isTablet(Context context)

        Checks if AATKit recognizes given device as tablet.

        Parameters:
        context - The Context of your application.
        Returns:

        True if device is recognized as tablet, false otherwise.

      • onActivityResume

         final static Unit onActivityResume(Activity activity)

        Notifies AATKit about activity resume. Invoke this method in every activity that uses AATKit.

        Parameters:
        activity - Reference to Activity.
      • onActivityPause

         final static Unit onActivityPause(Activity activity)

        Notifies AATKit about activity pause. Invoke this method in every activity that uses AATKit.

        Parameters:
        activity - Reference to Activity.
      • createFullscreenPlacement

         final static FullscreenPlacement createFullscreenPlacement(String name)

        Creates a new fullscreen placement. If the fullscreen placement of given name already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        Returns:

        FullscreenPlacement instance, or null if placement cannot be created.

      • createInfeedBannerPlacement

         final static InfeedBannerPlacement createInfeedBannerPlacement(String name, BannerConfiguration configuration)

        Creates a new infeed banner placement. If the banner placement of given name already exists, it will be returned.

        The placement will create a copy of the configuration. Any changes made to the configuration after placement is created will be ignored.

        Parameters:
        name - Unique name of placement.
        configuration - The configuration for this placement.
        Returns:

        Infeed banner placement instance, or null if the placement cannot be created.

      • createStickyBannerPlacement

         final static StickyBannerPlacement createStickyBannerPlacement(String name, BannerPlacementSize bannerPlacementSize)

        Creates a new sticky banner placement. If the banner placement of given name already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        bannerPlacementSize - Size of the sticky banner placement.
        Returns:

        Sticky banner placement instance, or null if the placement cannot be created.

      • createMultiSizeBannerPlacement

         final static MultiSizeBannerPlacement createMultiSizeBannerPlacement(String name)

        Creates a new multisize banner placement. If the banner placement of given name already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        Returns:

        Multisize banner placement instance, or null if the placement cannot be created.

      • createAutoLoadBannerPlacement

         final static AutoLoadBannerPlacement createAutoLoadBannerPlacement(String name, BannerPlacementSize bannerPlacementSize)

        Creates a new automatically loading banner placement. If the banner placement of given name and size already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        bannerPlacementSize - Size of the sticky banner placement.
        Returns:

        AutoLoadBannerPlacement instance, or null if the placement cannot be created.

      • createAutoLoadMultiSizeBannerPlacement

         final static AutoLoadMultiSizeBannerPlacement createAutoLoadMultiSizeBannerPlacement(String name)

        Creates a new automatically loading multisize banner placement. If the banner placement of given name already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        Returns:

        AutoLoadMultiSizeBannerPlacement instance, or null if the placement cannot be created.

      • createRewardedVideoPlacement

         final static RewardedVideoPlacement createRewardedVideoPlacement(String name)

        Creates a new rewarded video placement. If the rewarded video ad placement of given name already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        Returns:

        Rewarded video placement instance, or null if the placement cannot be created.

      • createNativeAdPlacement

         final static NativeAdPlacement createNativeAdPlacement(String name, Boolean supportsMainImage)

        Creates a new native ad placement. If the native ad placement of given name already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        supportsMainImage - True if the native ads returned should have main image asset.
        Returns:

        NativeAd placement instance, or null if the placement cannot be created.

      • createAppOpenAdPlacement

         final static AppOpenAdPlacement createAppOpenAdPlacement(String name)

        Creates a new App Open Ad placement. If the App Open Ad placement of given name already exists, it will be returned.

        Parameters:
        name - Unique name of placement.
        Returns:

        App Open Ad placement instance, or null if the placement cannot be created.

      • createBannerCache

         final static BannerCache createBannerCache(BannerCacheConfiguration configuration)

        Creates a cache of automatically preloaded banner ads. The cache will always try to have a defined amount of banners available for immediate handout to the app whenever they are needed. The BannerCache needs to be destroyed when no longer needed.

        Parameters:
        configuration - BannerCacheConfiguration instance used to configure the cache.
      • setAdChoicesIconPosition

         final static Unit setAdChoicesIconPosition(AATKit.AdChoicesIconPosition position)

        Allows to set the desired position of AdChoices icon in Google native ads. Set null to use the ad network's default.

        Parameters:
        position - desired AdChoices icon position.
      • setNetworkEnabled

         final static Unit setNetworkEnabled(AdNetwork network, Boolean enabled)

        Allows to enable or disable selected ad networks. By default all networks are enabled.

        Parameters:
        network - Ad network.
        enabled - True to enable, false to disable.
      • isNetworkEnabled

         final static Boolean isNetworkEnabled(AdNetwork network)

        Returns true if ad network is enabled, false otherwise.

        Parameters:
        network - Ad network.
        Returns:

        True if ad network is enabled, false otherwise.

      • getOption

         final static String getOption(String optionName)

        Get option from AATKit. Options can be obtained from the server or set using the setOption method.

        Parameters:
        optionName - The name of the option to be checked.
        Returns:

        Value of the option or null if it is not set.

      • isOptionEnabled

         final static Boolean isOptionEnabled(String optionName)

        Convenience method for checking if option is enabled in AATKit. Options can be obtained from the server or set using the setOption method.

        Parameters:
        optionName - The name of the option to be checked.
        Returns:

        True if option value is "Yes", false otherwise.

      • setOption

         final static Unit setOption(String optionName, String optionValue)

        Set option in AATKit. Options can also be obtained from the server.

        Parameters:
        optionName - The name of the option to be set.
        optionValue - The value of the option to be set.
      • isConsentOptIn

         final static Boolean isConsentOptIn()

        Checks if consent is of opt-in type (like GDPR) or not

      • setTargetingInfo

         final static Unit setTargetingInfo(Map<String, List<String>> info)

        Sets the targeting information for the application. This information will be used only if no placement-specific targeting is available.

        Parameters:
        info - Map with targeting information
      • setContentTargetingUrl

         final static Unit setContentTargetingUrl(String targetingUrl)

        Sets the content targeting url for the application. This information will be used only if no placement-specific targeting is available.

        Parameters:
        targetingUrl - The targeting url
      • addAdNetworkForKeywordTargeting

         final static Unit addAdNetworkForKeywordTargeting(AdNetwork network)

        Adds an ad network to the list of ad networks that receive targeting keywords (if any set). If no ad networks are added, any set keywords will be delivered to all ad networks supporting keyword targeting.

        Parameters:
        network - Chosen ad network.
      • removeAdNetworkForKeywordTargeting

         final static Unit removeAdNetworkForKeywordTargeting(AdNetwork network)

        Removes an ad network from the list of ad networks that receive targeting keywords (if any set). If no ad networks are added to the list, any set keywords will be delivered to all ad networks supporting keyword targeting.

        Parameters:
        network - Chosen ad network.
      • getLogLevel

         final static Integer getLogLevel()

        Returns the log level used by AATKit. Note that the used log level does not have to come from setLogLevel, as it can also be influenced by server configs and adb shell setprop method.

      • setIsChildDirected

         final static Unit setIsChildDirected(Boolean isChildDirected)

        Allows to set if app should be treated as child-directed.

        Parameters:
        isChildDirected - True if app is child directed, false otherwise.
      • muteVideoAds

         final static Unit muteVideoAds(Boolean mute)

        Allows to mute video ads.

        Parameters:
        mute - True to enable, false to disable ad muting.
      • getDebugInfoObject

         final static AATKitDebugInfo getDebugInfoObject()

        Used for obtaining debug information (the same that would be presented in dialog after shaking the device if debug screen is enabled)

        Returns:

        AATKit debug info.