Skip to end of metadata
Go to start of metadata

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

Interface NativeAdResponse



  • public interface NativeAdResponse
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void destroy()
      Destroy the response
      NativeAdResponse.Rating getAdStarRating()
      Retrieve rating from the native ad response.
      java.lang.String getCallToAction()
      The text for the call to action
      java.lang.String getCreativeId()
      Retrieve the creative Id
      java.lang.String getDescription()
      The text description of the ad , the text body
      java.lang.String getFullText()
      Retrieve full text from native ad response
      android.graphics.Bitmap getIcon()
      Retrieve the icon image resource, null if there was no image available or if shouldLoadIcon returned false for the ad call
      java.lang.String getIconUrl()
      The URL of the Icon image resource can be used to manage image resources manually
      android.graphics.Bitmap getImage()
      Retrieve the main image resource, null if there was no image available or if shouldLoadImage() was set to false.
      java.lang.String getImageUrl()
      The URL of the main image can be used to manage image resources manually
      java.util.HashMap<java.lang.String,java.lang.Object> getNativeElements()
      Retrieve a map of all elements within the native ad response.
      NativeAdResponse.Network getNetworkIdentifier() 
      java.lang.String getSocialContext()
      Retrieve the social context of the native ad response.
      java.lang.String getSponsoredBy()
      Retrieve sponspored by text from native ad response
      java.lang.String getTitle()
      The Title for this native ad
      boolean hasExpired()
      Determine if this Response has expired
      boolean registerView(android.view.View view, NativeAdEventListener listener)
      Register view for tracking
      boolean registerViewList(android.view.View view, java.util.List<android.view.View> clickables, NativeAdEventListener listener)
      Register a list of clickable views for tracking
      void setCreativeId(java.lang.String creativeId)
      Set the creative Id
      void setIcon(android.graphics.Bitmap bitmap)
      Set the icon image resource
      void setImage(android.graphics.Bitmap bitmap)
      Set the main image resource
      void unregisterViews()
      Unregister views for this response This will be destroyed once views are unregistered
    • Method Detail

      • getTitle

        java.lang.String getTitle()
        The Title for this native ad
        Returns:
        empty string "" if not present
      • getDescription

        java.lang.String getDescription()
        The text description of the ad , the text body
        Returns:
        empty string "" if not present
      • getImageUrl

        java.lang.String getImageUrl()
        The URL of the main image can be used to manage image resources manually
        Returns:
        The URL of the main image or empty string "" if not present
      • getImage

        android.graphics.Bitmap getImage()
        Retrieve the main image resource, null if there was no image available or if shouldLoadImage() was set to false.
        Returns:
        The Bitmap of the main image
      • setImage

        void setImage(android.graphics.Bitmap bitmap)
        Set the main image resource
        Parameters:
        bitmap - The Bitmap of the main image
      • getCreativeId

        java.lang.String getCreativeId()
        Retrieve the creative Id
        Returns:
        empty string "" if not present
      • setCreativeId

        void setCreativeId(java.lang.String creativeId)
        Set the creative Id
        Parameters:
        creativeId - set "" if not present
      • getIconUrl

        java.lang.String getIconUrl()
        The URL of the Icon image resource can be used to manage image resources manually
        Returns:
        The URL of the Icon or empty string "" if not present
      • getIcon

        android.graphics.Bitmap getIcon()
        Retrieve the icon image resource, null if there was no image available or if shouldLoadIcon returned false for the ad call
        Returns:
        The Bitmap of the Icon
      • setIcon

        void setIcon(android.graphics.Bitmap bitmap)
        Set the icon image resource
        Parameters:
        bitmap - The Bitmap of the main icon
      • getCallToAction

        java.lang.String getCallToAction()
        The text for the call to action
        Returns:
        empty string "" if not present
      • getNativeElements

        java.util.HashMap<java.lang.String,java.lang.Object> getNativeElements()
        Retrieve a map of all elements within the native ad response.
        Returns:
        A map of the native ad elements
      • getSocialContext

        java.lang.String getSocialContext()
        Retrieve the social context of the native ad response.
        Returns:
        empty string "" if not present
      • getFullText

        java.lang.String getFullText()
        Retrieve full text from native ad response
      • getSponsoredBy

        java.lang.String getSponsoredBy()
        Retrieve sponspored by text from native ad response
      • hasExpired

        boolean hasExpired()
        Determine if this Response has expired
        Returns:
        true if it has expired
      • registerView

        boolean registerView(android.view.View view,
                             NativeAdEventListener listener)
        Register view for tracking
        Parameters:
        view - the container of native ad
        listener - the listener of the ad events, can be null
        Returns:
        True if successful
      • registerViewList

        boolean registerViewList(android.view.View view,
                                 java.util.List<android.view.View> clickables,
                                 NativeAdEventListener listener)
        Register a list of clickable views for tracking
        Parameters:
        view - the the container of native ad
        clickables - the list of clickables
        listener - the listener of the ad events, can be null
        Returns:
        True if successful
      • unregisterViews

        void unregisterViews()
        Unregister views for this response This will be destroyed once views are unregistered
      • destroy

        void destroy()
        Destroy the response

  • No labels