Class StartAppAd

java.lang.Object
com.startapp.sdk.adsbase.Ad
com.startapp.sdk.adsbase.StartAppAd
All Implemented Interfaces:
com.startapp.sdk.adsbase.DeveloperInterface, Serializable

public class StartAppAd extends com.startapp.sdk.adsbase.Ad implements com.startapp.sdk.adsbase.DeveloperInterface
Represents an Interstitial Ad - a full screen ad which may be displayed during a natural transition points such as a screen change, after the game over screen, before loading the next game level, etc.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Represents different kinds of ad content

    Nested classes/interfaces inherited from class com.startapp.sdk.adsbase.Ad

    com.startapp.sdk.adsbase.Ad.AdState, com.startapp.sdk.adsbase.Ad.AdType
  • Field Summary

    Fields inherited from class com.startapp.sdk.adsbase.Ad

    activityExtra, adCacheTtl, belowMinCPM, consentData, context, errorMessage, extraData, placement
  • Constructor Summary

    Constructors
    Constructor
    Description
    StartAppAd(android.content.Context context)
    It is recommended to keep an instance in memory as a Singleton object, and then reuse it multiple times to load and show ads.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    init(android.content.Context context, String devId, String appId)
    Deprecated.
    boolean
    Deprecated.
    void
    load(com.startapp.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener callback)
    Deprecated.
    void
    Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), null);
    void
    Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), listener);
    void
    loadAd(com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
    Alias for loadAd(AdMode.AUTOMATIC, adPreferences, null);
    void
    loadAd(com.startapp.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener listener)
    Alias for loadAd(AdMode.AUTOMATIC, adPreferences, listener);
    void
    Alias for loadAd(adMode, new AdPreferences(), null);
    void
    Alias for loadAd(adMode, new AdPreferences(), listener);
    void
    loadAd(StartAppAd.AdMode adMode, com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
    Alias for loadAd(adMode, adPreferences, null);
    void
    loadAd(StartAppAd.AdMode adMode, com.startapp.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener listener)
    Loads ad according to the adMode and adPreferences given.
    protected void
    loadAds(com.startapp.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener callback)
    Deprecated.
    static void
    setReturnAdsPreferences(com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
    This method does nothing and it will be removed completely from future release of SDK 6.0.0
    void
    Sets a listener for video ad events.
    boolean
    Shows an ad, if it has been loaded.
    boolean
    Shows an ad, if it has been loaded.
    boolean
    showAd(String adTag)
    Deprecated.
    boolean
    showAd(String adTag, AdDisplayListener listener)
    Deprecated.
    static void
    showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState)
    Deprecated.
    static void
    showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.ads.splash.SplashConfig configuration)
    Deprecated.
    static void
    showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.ads.splash.SplashConfig configuration, com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
    Deprecated.
    static void
    showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.ads.splash.SplashConfig configuration, com.startapp.sdk.adsbase.model.AdPreferences adPreferences, com.startapp.sdk.ads.splash.SplashHideListener splashHideListener)
    Deprecated.
    static void
    showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
    Deprecated.

    Methods inherited from class com.startapp.sdk.adsbase.Ad

    canShowAd, getAdCacheTtl, getAdId, getAdInfoOverride, getBidToken, getConsentData, getContext, getDParam, getErrorMessage, getExtraData, getFallbackAdCacheTtl, getLastLoadTime, getNotDisplayedReason, getPlacement, getRequestUrl, getState, getType, getVideoCancelCallBack, hasAdCacheTtlPassed, isBelowMinCPM, load, load, load, load, setActivityExtra, setAdInfoOverride, setContext, setErrorMessage, setExtraData, setNotDisplayedReason, setPlacement, setRequestUrl, setState, setVideoCancelCallBack

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.startapp.sdk.adsbase.DeveloperInterface

    close, onBackPressed, onPause, onRestoreInstanceState, onResume, onSaveInstanceState
  • Constructor Details

    • StartAppAd

      public StartAppAd(@NonNull android.content.Context context)
      It is recommended to keep an instance in memory as a Singleton object, and then reuse it multiple times to load and show ads. In other words, an instance should not be linked to the Activity lifecycle, and it should survive the Activity recreation.
      Parameters:
      context - Application context
  • Method Details

    • init

      @Deprecated public static void init(android.content.Context context, String devId, String appId)
      Deprecated.
      This method will be removed in version 4.12.0
      See Also:
    • load

      @Deprecated public void load(com.startapp.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener callback)
      Deprecated.
      Overrides:
      load in class com.startapp.sdk.adsbase.Ad
      See Also:
    • loadAds

      @Deprecated protected void loadAds(com.startapp.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener callback)
      Deprecated.
      This methods does nothing.
      Specified by:
      loadAds in class com.startapp.sdk.adsbase.Ad
    • loadAd

      public void loadAd()
      Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), null);
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      See Also:
    • loadAd

      public void loadAd(@NonNull com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
      Alias for loadAd(AdMode.AUTOMATIC, adPreferences, null);
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      See Also:
    • loadAd

      public void loadAd(@NonNull AdEventListener listener)
      Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), listener);
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      See Also:
    • loadAd

      public void loadAd(@NonNull com.startapp.sdk.adsbase.model.AdPreferences adPreferences, @NonNull AdEventListener listener)
      Alias for loadAd(AdMode.AUTOMATIC, adPreferences, listener);
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      See Also:
    • loadAd

      public void loadAd(@NonNull StartAppAd.AdMode adMode)
      Alias for loadAd(adMode, new AdPreferences(), null);
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      See Also:
    • loadAd

      public void loadAd(@NonNull StartAppAd.AdMode adMode, @NonNull com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
      Alias for loadAd(adMode, adPreferences, null);
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      See Also:
    • loadAd

      public void loadAd(@NonNull StartAppAd.AdMode adMode, @NonNull AdEventListener listener)
      Alias for loadAd(adMode, new AdPreferences(), listener);
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      See Also:
    • loadAd

      public void loadAd(@NonNull StartAppAd.AdMode adMode, @Nullable com.startapp.sdk.adsbase.model.AdPreferences adPreferences, @Nullable AdEventListener listener)
      Loads ad according to the adMode and adPreferences given.
      Specified by:
      loadAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      Parameters:
      adMode - one of StartAppAd.AdMode.AUTOMATIC, StartAppAd.AdMode.FULLPAGE, StartAppAd.AdMode.VIDEO or StartAppAd.AdMode.REWARDED_VIDEO for the Rewarded Video Ad
      adPreferences - ad preferences
      listener - a callback to be invoked when ad finishes loading
    • showAd

      public boolean showAd()
      Shows an ad, if it has been loaded.
      Specified by:
      showAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      Returns:
      true if the ad has been shown
    • showAd

      @Deprecated public boolean showAd(String adTag)
      Deprecated.
      This method will be removed in version 4.12.0

      The adTag value must be set into AdPreferences and passed into loadAd(AdMode, AdPreferences, AdEventListener)

      Specified by:
      showAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      Parameters:
      adTag - adTag
      Returns:
      true if the ad has been shown
      See Also:
      • AdPreferences.setAdTag(String)
    • showAd

      public boolean showAd(@Nullable AdDisplayListener listener)
      Shows an ad, if it has been loaded.
      Specified by:
      showAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      Parameters:
      listener - callback to be invoked when an ad events occurred
      Returns:
      true if ad has shown
    • showAd

      @Deprecated public boolean showAd(@Deprecated String adTag, AdDisplayListener listener)
      Deprecated.
      This method will be removed in version 4.12.0

      The adTag value must be set into AdPreferences and passed into loadAd(AdMode, AdPreferences, AdEventListener)

      Specified by:
      showAd in interface com.startapp.sdk.adsbase.DeveloperInterface
      Parameters:
      adTag - adTag
      Returns:
      true if the ad has been shown
      See Also:
      • AdPreferences.setAdTag(String)
    • setVideoListener

      public void setVideoListener(@Nullable VideoListener listener)
      Sets a listener for video ad events.
      Specified by:
      setVideoListener in interface com.startapp.sdk.adsbase.DeveloperInterface
      Parameters:
      listener - listener
    • isReady

      @Deprecated public boolean isReady()
      Deprecated.
      This method is deprecated.

      Instead use AdEventListener in order to receive an event when the ad has been loaded.

      Overrides:
      isReady in class com.startapp.sdk.adsbase.Ad
      Returns:
      true if the ad has been loaded.
    • setReturnAdsPreferences

      public static void setReturnAdsPreferences(@Nullable com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
      This method does nothing and it will be removed completely from future release of SDK 6.0.0
    • showSplash

      @Deprecated public static void showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState)
      Deprecated.
      This method does nothing and it will be removed completely from future release of SDK 6.0.0
    • showSplash

      @Deprecated public static void showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.ads.splash.SplashConfig configuration)
      Deprecated.
      This method does nothing and it will be removed completely from future release of SDK 6.0.0
    • showSplash

      @Deprecated public static void showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
      Deprecated.
      This method does nothing and it will be removed completely from future release of SDK 6.0.0
    • showSplash

      @Deprecated public static void showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.ads.splash.SplashConfig configuration, com.startapp.sdk.adsbase.model.AdPreferences adPreferences)
      Deprecated.
      This method does nothing and it will be removed completely from future release of SDK 6.0.0
    • showSplash

      @Deprecated public static void showSplash(android.app.Activity activity, android.os.Bundle savedInstanceState, com.startapp.sdk.ads.splash.SplashConfig configuration, com.startapp.sdk.adsbase.model.AdPreferences adPreferences, com.startapp.sdk.ads.splash.SplashHideListener splashHideListener)
      Deprecated.
      This method does nothing and it will be removed completely from future release of SDK 6.0.0