Object AATKit
-
- All Implemented Interfaces:
public class AATKit
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumAATKit.AdChoicesIconPositionDefines possible positions for AdChoices icon for Google native ads.
public interfaceAATKit.DelegateNotifies about AATKit events.
public interfaceAATKit.StatisticsListenerNotifies about placement reporting events, like counted adspace, request etc.
-
Field Summary
Fields Modifier and Type Field Description private final static Stringversionprivate final static StringfullVersionprivate final static StringdebugInfoprivate final static BooleanisInitializedpublic final static AATKitINSTANCE
-
Method Summary
Modifier and Type Method Description final static Unitinit(AATKitConfiguration configuration)Initializes the AATKit library. final static UnitenableDebugScreen()Enables debug screen that will show after shaking the device. final static UnitdisableDebugScreen()Disables the debug screen appearing after shaking the device. final static Unitreconfigure(AATKitRuntimeConfiguration configuration)Allows to reconfigure the options for GDPR consent. final static BooleanisTablet(Context context)Checks if AATKit recognizes given device as tablet. final static BannerPlacementSizemaximumBannerSizePortrait(Context context)Returns the BannerPlacementSize with maximum width that will fit on a given device in portrait screen orientation. final static BannerPlacementSizemaximumBannerSizeLandscape(Context context)Returns the BannerPlacementSize with maximum width that will fit on a given device in landscape screen orientation. final static Set<BannerSize>fittingBannerSizesPortrait(Context context)Returns the set of BannerSize that will fit on a given device in portrait screen orientation. final static Set<BannerSize>fittingBannerSizesLandscape(Context context)Returns the set of BannerSize that will fit on a given device in landscape screen orientation. final static UnitonActivityResume(Activity activity)Notifies AATKit about activity resume. final static UnitonActivityPause(Activity activity)Notifies AATKit about activity pause. final static FullscreenPlacementcreateFullscreenPlacement(String name)Creates a new fullscreen placement. final static InfeedBannerPlacementcreateInfeedBannerPlacement(String name, BannerConfiguration configuration)Creates a new infeed banner placement. final static StickyBannerPlacementcreateStickyBannerPlacement(String name, BannerPlacementSize bannerPlacementSize)Creates a new sticky banner placement. final static MultiSizeBannerPlacementcreateMultiSizeBannerPlacement(String name)Creates a new multisize banner placement. final static AutoLoadBannerPlacementcreateAutoLoadBannerPlacement(String name, BannerPlacementSize bannerPlacementSize)Creates a new automatically loading banner placement. final static AutoLoadMultiSizeBannerPlacementcreateAutoLoadMultiSizeBannerPlacement(String name)Creates a new automatically loading multisize banner placement. final static RewardedVideoPlacementcreateRewardedVideoPlacement(String name)Creates a new rewarded video placement. final static NativeAdPlacementcreateNativeAdPlacement(String name, Boolean supportsMainImage)Creates a new native ad placement. final static AppOpenAdPlacementcreateAppOpenAdPlacement(String name)Creates a new App Open Ad placement. final static BannerCachecreateBannerCache(BannerCacheConfiguration configuration)Creates a cache of automatically preloaded banner ads. final static UnitsetAdChoicesIconPosition(AATKit.AdChoicesIconPosition position)Allows to set the desired position of AdChoices icon in Google native ads. final static UnitsetNetworkEnabled(AdNetwork network, Boolean enabled)Allows to enable or disable selected ad networks. final static BooleanisNetworkEnabled(AdNetwork network)Returns true if ad network is enabled, false otherwise. final static StringgetOption(String optionName)Get option from AATKit. final static BooleanisOptionEnabled(String optionName)Convenience method for checking if option is enabled in AATKit. final static UnitsetOption(String optionName, String optionValue)Set option in AATKit. final static BooleanisConsentOptIn()Checks if consent is of opt-in type (like GDPR) or not final static UnitsetRewardedAdSSVInfo(RewardedAdSSVInfo info)final static UnitsetDFPBiddingValues(List<DFPBiddingValue> values)Sets custom targeting values used for DFP Bidding. final static UnitsetDFPBiddingTargetingKey(String key)Sets custom targeting key used for DFP Bidding. final static UnitsetTargetingInfo(Map<String, List<String>> info)Sets the targeting information for the application. final static UnitsetUserTargeting(AATKitUserTargeting userTargeting)Sets the user targeting information for the application. final static UnitsetContentTargetingUrl(String targetingUrl)Sets the content targeting url for the application. final static UnitaddAdNetworkForKeywordTargeting(AdNetwork network)Adds an ad network to the list of ad networks that receive targeting keywords (if any set). final static UnitremoveAdNetworkForKeywordTargeting(AdNetwork network)Removes an ad network from the list of ad networks that receive targeting keywords (if any set). final static UnitsetLogLevel(Integer logLevel)Allows to set log level from code. final static IntegergetLogLevel()Returns the log level used by AATKit. final static UnitsetIsChildDirected(Boolean isChildDirected)Allows to set if app should be treated as child-directed. final static UnitmuteVideoAds(Boolean mute)Allows to mute video ads. final static UnitconfigureDebugScreen(AATKitDebugScreenConfiguration configuration)Used to configure the debug screen presentation final static AATKitDebugInfogetDebugInfoObject()Used for obtaining debug information (the same that would be presented in dialog after shaking the device if debug screen is enabled) final static UnitshowDebugDialog()Shows AATKit debug screen. final static Unitdestroy()final static StringgetVersion()final static StringgetFullVersion()final static StringgetDebugInfo()final static BooleanisInitialized()-
-
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.
-
reconfigure
final static Unit reconfigure(AATKitRuntimeConfiguration configuration)
Allows to reconfigure the options for GDPR consent.
- Parameters:
configuration- New configuration.
-
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.
-
maximumBannerSizePortrait
final static BannerPlacementSize maximumBannerSizePortrait(Context context)
Returns the BannerPlacementSize with maximum width that will fit on a given device in portrait screen orientation.
- Parameters:
context- The Context of your application.- Returns:
BannerPlacementSize best fitting current device
-
maximumBannerSizeLandscape
final static BannerPlacementSize maximumBannerSizeLandscape(Context context)
Returns the BannerPlacementSize with maximum width that will fit on a given device in landscape screen orientation.
- Parameters:
context- The Context of your application.- Returns:
BannerPlacementSize best fitting current device
-
fittingBannerSizesPortrait
final static Set<BannerSize> fittingBannerSizesPortrait(Context context)
Returns the set of BannerSize that will fit on a given device in portrait screen orientation.
- Parameters:
context- The Context of your application.- Returns:
Set of BannerSize fitting current device
-
fittingBannerSizesLandscape
final static Set<BannerSize> fittingBannerSizesLandscape(Context context)
Returns the set of BannerSize that will fit on a given device in landscape screen orientation.
- Parameters:
context- The Context of your application.- Returns:
Set of BannerSize fitting current device
-
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
-
setRewardedAdSSVInfo
final static Unit setRewardedAdSSVInfo(RewardedAdSSVInfo info)
-
setDFPBiddingValues
final static Unit setDFPBiddingValues(List<DFPBiddingValue> values)
Sets custom targeting values used for DFP Bidding.
-
setDFPBiddingTargetingKey
final static Unit setDFPBiddingTargetingKey(String key)
Sets custom targeting key used for DFP Bidding.
-
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
-
setUserTargeting
final static Unit setUserTargeting(AATKitUserTargeting userTargeting)
Sets the user targeting information for the application.
- Parameters:
userTargeting- AATKitUserTargeting
-
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.
-
setLogLevel
final static Unit setLogLevel(Integer logLevel)
Allows to set log level from code.
- Parameters:
logLevel- Desired log level, as in android.util.Log class.
-
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 setpropmethod.
-
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.
-
configureDebugScreen
final static Unit configureDebugScreen(AATKitDebugScreenConfiguration configuration)
Used to configure the debug screen presentation
-
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.
-
showDebugDialog
final static Unit showDebugDialog()
Shows AATKit debug screen.
-
getVersion
final static String getVersion()
-
getFullVersion
final static String getFullVersion()
-
getDebugInfo
final static String getDebugInfo()
-
isInitialized
final static Boolean isInitialized()
-
-
-
-