Skip to end of metadata
Go to start of metadata

JavaScript is disabled on your browser.
com.appnexus.opensdk

Class SDKSettings

  • java.lang.Object
    • com.appnexus.opensdk.SDKSettings


  • public class SDKSettings
    extends java.lang.Object
    Global static functions that apply to all SDK views and calls.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String getAAID()
      Retrieve the current Android Advertising ID to be reported to the ad server.
      static android.location.Location getLocation()
      Retrieve the current location reported to the ad server.
      static int getLocationDecimalDigits()
      Returns the number of digits after decimal of latitude and longitude.
      static boolean getLocationEnabled()
      Returns true if the ad server calls will include location information or false otherwise.
      static boolean isHttpsEnabled()
      Returns true if the Https is enabled for the ad calls or false otherwise.
      static boolean isLocationEnabledForCreative()
      Returns false if the locationEnabledForCreative is set to false or true otherwise
      static void setAAID(java.lang.String aaid, boolean limitTrackingEnabled)
      Sets the Android Advertising ID to be passed in the ad request.
      static void setLocation(android.location.Location location)
      Overrides the SDKs automatic location retrieval.
      static void setLocationDecimalDigits(int digitsAfterDecimal)
      Sets the number of digits after the decimal of the latitude and longitude.
      static void setLocationEnabled(boolean enabled)
      Sets whether or not location (latitude, longitude) is retrieved and passed in the ad request.
      static void setLocationEnabledForCreative(boolean enable)
      Sets whether or not location (latitude, longitude) permission alert will be shown to the user when called by the Creative.
      static void useHttps(boolean useHttps)
      Enable HTTPS in the SDK if set to true.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setAAID

        public static void setAAID(java.lang.String aaid,
                                   boolean limitTrackingEnabled)
        Sets the Android Advertising ID to be passed in the ad request.
        Parameters:
        aaid - the android advertising id value.
        limitTrackingEnabled - whether limitTracking is enabled or not.
      • getAAID

        public static java.lang.String getAAID()
        Retrieve the current Android Advertising ID to be reported to the ad server. If the value is null, then either a non-null value has not been passed to setAAID(java.lang.String, boolean)
        Returns:
        The AAID to be passed in the ad request
      • setLocationEnabled

        public static void setLocationEnabled(boolean enabled)
        Sets whether or not location (latitude, longitude) is retrieved and passed in the ad request. This includes whether location is sent to any 3rd party networks.
        Parameters:
        enabled - whether to enable location or not. default is true
      • getLocationEnabled

        public static boolean getLocationEnabled()
        Returns true if the ad server calls will include location information or false otherwise.
      • getLocation

        public static android.location.Location getLocation()
        Retrieve the current location reported to the ad server. If the value is null either location has not yet been retrieved or location reporting has been disabled via setLocationEnabled(boolean)
        Returns:
        The location used in the last ad call.
      • setLocation

        public static void setLocation(android.location.Location location)
        Overrides the SDKs automatic location retrieval. If the passed in location value is not null and location is enabled, then the passed in location value will be sent to the ad server. If the location parameter is null then the automatic location retrieval will be used if and only if getLocationEnabled().
        Parameters:
        location - The location value to use in the ad call (may be null)
      • setLocationDecimalDigits

        public static void setLocationDecimalDigits(int digitsAfterDecimal)
        Sets the number of digits after the decimal of the latitude and longitude. It will only be applied if getLocationEnabled(). Maximum of precision is 6, which means less than a foot.
        Parameters:
        digitsAfterDecimal - The digits
      • getLocationDecimalDigits

        public static int getLocationDecimalDigits()
        Returns the number of digits after decimal of latitude and longitude. If returns -1, it indicates that full resolution is used.
        Returns:
        The digits after decimal of latitude and longitude
      • useHttps

        public static void useHttps(boolean useHttps)
        Enable HTTPS in the SDK if set to true.
        Parameters:
        useHttps - whether to enable Https or not. default is false
      • isHttpsEnabled

        public static boolean isHttpsEnabled()
        Returns true if the Https is enabled for the ad calls or false otherwise.
      • setLocationEnabledForCreative

        public static void setLocationEnabledForCreative(boolean enable)
        Sets whether or not location (latitude, longitude) permission alert will be shown to the user when called by the Creative.
        Parameters:
        enable - whether to enable location permission alert or not. default is true
      • isLocationEnabledForCreative

        public static boolean isLocationEnabledForCreative()
        Returns false if the locationEnabledForCreative is set to false or true otherwise

  • No labels