Class AdId

java.lang.Object
com.appbrain.AdId
All Implemented Interfaces:
Serializable

public class AdId extends Object implements Serializable

Class for identifying ad units. Setting an AdId will allow you to track individual ads. For example, you can distinguish between an interstitial you show on app exit (using EXIT), and an interstitial you show in app (using, for example in a game, LEVEL_COMPLETE).

See: Blog post about Ad IDs, InterstitialBuilder.setAdId(AdId) and AppBrainBanner.setAdId(AdId).

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final AdId
    For ad units shown around a game's achievements
    static final AdId
    For ad units that don't fit any of the other categories
    static final AdId
    For ad units shown before the user exits your app
    static final AdId
    For ad units shown in the home screen of your app
    static final AdId
    For ad units shown around a game's leaderboards
    static final AdId
    For ad units shown right after the user has completed a level in your app
    static final AdId
    For ad units shown at startup of your app
    static final AdId
    For ad units shown at natural pauses in your app
    static final AdId
    For ad units shown at startup of your app
    static final AdId
    For ads shown around a store or other place where the user can buy in-app products
  • Method Summary

    Modifier and Type
    Method
    Description
    static AdId
    custom(String idString)
    If you don't want to use one of the built-in AdId constants, you can generate custom ad ids on the AppBrain developer dashboard (click on one of your apps, then Ad Settings).
    boolean
     
    int
     
    int
     
    boolean
     
    boolean
     
    static AdId
    parse(String idString)
     
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final AdId DEFAULT
      For ad units that don't fit any of the other categories
    • HOME_SCREEN

      public static final AdId HOME_SCREEN
      For ad units shown in the home screen of your app
    • STARTUP

      public static final AdId STARTUP
      For ad units shown at startup of your app
    • PAUSE

      public static final AdId PAUSE
      For ad units shown at natural pauses in your app
    • EXIT

      public static final AdId EXIT
      For ad units shown before the user exits your app
    • LEVEL_START

      public static final AdId LEVEL_START
      For ad units shown at startup of your app
    • LEVEL_COMPLETE

      public static final AdId LEVEL_COMPLETE
      For ad units shown right after the user has completed a level in your app
    • ACHIEVEMENTS

      public static final AdId ACHIEVEMENTS
      For ad units shown around a game's achievements
    • LEADERBOARDS

      public static final AdId LEADERBOARDS
      For ad units shown around a game's leaderboards
    • STORE

      public static final AdId STORE
      For ads shown around a store or other place where the user can buy in-app products
  • Method Details

    • custom

      public static AdId custom(String idString)
      If you don't want to use one of the built-in AdId constants, you can generate custom ad ids on the AppBrain developer dashboard (click on one of your apps, then Ad Settings). Pass the ad id string from the developer dashboard to this method to create your AdId instance. For example when showing an interstitial:
      InterstitialBuilder.create().setAdId(AdId.custom(<"your-id">)).show()
    • parse

      public static AdId parse(String idString)
    • getIndex

      public int getIndex()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isInterstitialId

      public boolean isInterstitialId()
      Returns:
      true if this AdId is suitable to track an interstitial.
    • isBannerId

      public boolean isBannerId()
      Returns:
      true if this AdId is suitable to track a banner.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object