Skip to end of metadata
Go to start of metadata

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

Class AdView

  • java.lang.Object
    • android.view.View
      • android.view.ViewGroup
        • android.widget.FrameLayout
          • com.appnexus.opensdk.AdView
  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent
    Direct Known Subclasses:
    BannerAdView, InterstitialAdView


    public abstract class AdView
    extends android.widget.FrameLayout
    The parent class of InterstitialAdView and BannerAdView. This may not be instantiated directly. Its public methods are accessed through one of its sub classes.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  AdView.GENDER
      The user's gender.
      • Nested classes/interfaces inherited from class android.widget.FrameLayout

        android.widget.FrameLayout.LayoutParams
      • Nested classes/interfaces inherited from class android.view.ViewGroup

        android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
      • Nested classes/interfaces inherited from class android.view.View

        android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
    • Field Summary

      • Fields inherited from class android.view.ViewGroup

        FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
      • Fields inherited from class android.view.View

        ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VISIBLE, X, Y, Z
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      abstract void activityOnDestroy()
      To be called by the developer when the fragment/activity's onDestroy() function is called.
      abstract void activityOnPause()
      To be called by the developer when the fragment/activity's onPause() function is called.
      abstract void activityOnResume()
      To be called by the developer when the fragment/activity's onResume() function is called.
      void addCustomKeywords(java.lang.String key, java.lang.String value)
      Add a custom keyword to the request URL for the ad.
      void clearCustomKeywords()
      Clear all custom keywords from the request URL.
      void destroy()
      This must be called from the UI thread, when permanently remove the AdView from the view hierarchy.
      com.appnexus.opensdk.AdDispatcher getAdDispatcher()
      Provide the ad dispatcher of this ad
      AdListener getAdListener()
      Gets the currently installed listener that the SDK will send events to.
      AdType getAdType()
      Retrieve the AdType being served on the AdView AdType can be Banner/Video
      java.lang.String getAge()
      Retrieve the current user's age.
      AppEventListener getAppEventListener()
      Gets the currently installed app event listener that the SDK will send custom events to.
      ANClickThroughAction getClickThroughAction()
      Returns the ANClickThroughAction that is used for this AdView.
      int getCreativeHeight()
      Retrieve the 'unexpanded' size of the creative .
      java.lang.String getCreativeId()
      Retrieve the Creative Id of the creative .
      int getCreativeWidth()
      Retrieve the 'unexpanded' size of the creative .
      java.util.ArrayList<android.util.Pair<java.lang.String,java.lang.String>> getCustomKeywords()
      Retrieve the array of custom keywords associated with the current AdView.
      java.lang.String getExternalUid()
      Retrieve the externalUID that was previously set.
      AdView.GENDER getGender()
      Get the current user's gender, if it's available.
      java.lang.String getInventoryCode()
      Retrieve the inventory code.
      boolean getLoadsInBackground()
      Gets whether or not this AdView will load landing pages in the background before displaying them.
      com.appnexus.opensdk.MediaType getMediaType()
      Media type can be Banner, Interstitial or Native
      int getMemberID()
      Retrieve the member ID.
      boolean getOpensNativeBrowser()
      Deprecated. 
      Use getClickThroughAction instead Refer ANClickThroughAction
      java.lang.String getPlacementID()
      Retrieve the current placement ID.
      com.appnexus.opensdk.ut.UTRequestParameters getRequestParameters()
      Provide the request parameters of this ad
      float getReserve()
      Retrieve the reserve price.
      boolean getShouldServePSAs()
      Retrieve the current PSA setting.
      boolean getShowLoadingIndicator()
      Get whether or not the banner or interstitial should show the loading indicator after being pressed, but before able to launch the browser.
      boolean isReadyToStart()
      Checks whether an ad is ready to load a new one
      boolean loadAd()
      Loads a new ad, if the ad space is visible.
      boolean loadAd(java.lang.String placementID)
      Loads a new ad, if the ad space is visible, and sets the AdView's placement ID.
      void loadAdOffscreen()
      Deprecated. 
      use loadAd() instead.
      void removeCustomKeyword(java.lang.String key)
      Remove a custom keyword from the request URL for the ad.
      void setAdListener(AdListener listener)
      Sets the currently installed listener that the SDK will send events to.
      void setAge(java.lang.String age)
      Set the current user's age.
      void setAppEventListener(AppEventListener appEventListener)
      Sets the currently installed app event listener that the SDK will send custom events to.
      void setClickThroughAction(ANClickThroughAction clickThroughAction)
      Determines what action to take when the user clicks on an ad.
      void setExternalUid(java.lang.String externalUid)
      Set the current user's externalUID
      void setGender(AdView.GENDER gender)
      Set the user's gender.
      void setInventoryCodeAndMemberID(int memberID, java.lang.String inventoryCode)
      Sets the inventory code and member id of the AdView.
      void setLoadsInBackground(boolean doesLoadingInBackground)
      Sets whether or not to load landing pages in the background before displaying them.
      void setOpensNativeBrowser(boolean opensNativeBrowser)
      Deprecated. 
      Use setClickThroughAction instead Refer ANClickThroughAction
      void setPlacementID(java.lang.String placementID)
      Sets the placement id of the AdView.
      void setReserve(float reserve)
      Set a reserve price.
      void setShouldServePSAs(boolean shouldServePSAs)
      Allows overriding the platform behavior in the case there is no ad currently available.
      void setShowLoadingIndicator(boolean show)
      Set whether or not the banner or interstitial should show the loading indicator after being pressed, but before able to launch the browser.
      • Methods inherited from class android.widget.FrameLayout

        generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
      • Methods inherited from class android.view.ViewGroup

        addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchSetActivated, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onDescendantInvalidated, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
      • Methods inherited from class android.view.View

        addExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, autofill, autofill, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, dispatchStartTemporaryDetach, draw, drawableHotspotChanged, findViewById, findViewWithTag, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, keyboardNavigationClusterSearch, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCreateInputConnection, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRtlPropertiesChanged, onScreenStateChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForeground, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface android.view.ViewParent

        canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayout
    • Method Detail

      • isReadyToStart

        public boolean isReadyToStart()
        Checks whether an ad is ready to load a new one
        Returns:
        true if settings are ready to load a new ad
      • getRequestParameters

        public com.appnexus.opensdk.ut.UTRequestParameters getRequestParameters()
        Provide the request parameters of this ad
        Returns:
        UTRequestParameters
      • loadAd

        public boolean loadAd()
        Loads a new ad, if the ad space is visible. You should have called setPlacementID before invoking this method.
        Returns:
        true means the ad will begin loading; false otherwise.
      • loadAdOffscreen

        @Deprecated
        public void loadAdOffscreen()
        Deprecated. use loadAd() instead.
      • loadAd

        public boolean loadAd(java.lang.String placementID)
        Loads a new ad, if the ad space is visible, and sets the AdView's placement ID.
        Parameters:
        placementID - The new placement ID to use.
        Returns:
        true means the ad will begin loading; false otherwise.
      • getPlacementID

        public java.lang.String getPlacementID()
        Retrieve the current placement ID.
        Returns:
        The current placement id.
      • setPlacementID

        public void setPlacementID(java.lang.String placementID)
        Sets the placement id of the AdView. The placement ID identifies the location in your application where ads will be shown. You must have a valid, active placement ID to monetize your application.
        Parameters:
        placementID - The placement ID to use.
      • setInventoryCodeAndMemberID

        public void setInventoryCodeAndMemberID(int memberID,
                                                java.lang.String inventoryCode)
        Sets the inventory code and member id of the AdView. The inventory code provides a more human readable way to identify the location in your application where ads will be shown. Member id is required to for using this feature. If both inventory code and placement id are presented, inventory code will be used instead of placement id on the ad request.
        Parameters:
        memberID - The member id that this AdView belongs to.
        inventoryCode - The inventory code of this AdView.
      • getMemberID

        public int getMemberID()
        Retrieve the member ID.
        Returns:
        the member id that this AdView belongs to.
      • getInventoryCode

        public java.lang.String getInventoryCode()
        Retrieve the inventory code.
        Returns:
        the current inventory code.
      • destroy

        public void destroy()
        This must be called from the UI thread, when permanently remove the AdView from the view hierarchy.
      • setAdListener

        public void setAdListener(AdListener listener)
        Sets the currently installed listener that the SDK will send events to.
        Parameters:
        listener - The AdListener object to use.
      • getAdListener

        public AdListener getAdListener()
        Gets the currently installed listener that the SDK will send events to.
        Returns:
        The AdListener object in use.
      • getAppEventListener

        public AppEventListener getAppEventListener()
        Gets the currently installed app event listener that the SDK will send custom events to.
        Returns:
        the AppEventListener object in use.
      • setAppEventListener

        public void setAppEventListener(AppEventListener appEventListener)
        Sets the currently installed app event listener that the SDK will send custom events to.
        Parameters:
        appEventListener - The AppEventListener object to use.
      • getOpensNativeBrowser

        public boolean getOpensNativeBrowser()
        Deprecated. Use getClickThroughAction instead Refer ANClickThroughAction
        Retrieve the setting that determines whether or not the device's native browser is used instead of the in-app browser when the user clicks an ad.
        Returns:
        true if the device's native browser will be used; false otherwise.
      • setOpensNativeBrowser

        public void setOpensNativeBrowser(boolean opensNativeBrowser)
        Deprecated. Use setClickThroughAction instead Refer ANClickThroughAction
        Set this to true to disable the in-app browser. This will cause URLs to open in a native browser such as Chrome so that when the user clicks on an ad, your app will be paused and the native browser will open. Set this to false to enable the in-app browser instead (a lightweight browser that runs within your app). The default value is false.
        Parameters:
        opensNativeBrowser - Whether or not the device's native browser should be used for landing pages.
      • setClickThroughAction

        public void setClickThroughAction(ANClickThroughAction clickThroughAction)
        Determines what action to take when the user clicks on an ad. If set to ANClickThroughAction.OPEN_DEVICE_BROWSER/ANClickThroughAction.OPEN_SDK_BROWSER then, AdListener.onAdClicked(AdView adView) will be triggered and corresponding browser will load the click url. If set to ANClickThroughAction.RETURN_URL then, AdListener.onAdClicked(AdView adView, String clickUrl) will be triggered with clickUrl as its argument. It is ASSUMED that the App will handle it appropriately.
        Parameters:
        clickThroughAction - ANClickThroughAction.OPEN_SDK_BROWSER which is default or ANClickThroughAction.OPEN_DEVICE_BROWSER or ANClickThroughAction.RETURN_URL
      • getShouldServePSAs

        public boolean getShouldServePSAs()
        Retrieve the current PSA setting. PSAs (Public Service Announcements) are ads for various causes or nonprofit organizations that can be served if there are no ads available. You can turn this on and off with setShouldServePSAs.
        Returns:
        Whether this placement accepts PSAs if no ad is served.
      • setShouldServePSAs

        public void setShouldServePSAs(boolean shouldServePSAs)
        Allows overriding the platform behavior in the case there is no ad currently available. If set to true the platform will retrieve and display a PSA (Public Service Announcement) . Set the value to false it will return no ad.
        Parameters:
        shouldServePSAs - Whether this placement is willing to accept a PSA if no other ad is available.
      • getReserve

        public float getReserve()
        Retrieve the reserve price. The reserve price is the minimum price you will accept in order to show an ad. A value of 0 indicates that there is no minimum.
        Returns:
        The reserve price. A value of 0 indicates that no reserve is set.
      • setReserve

        public void setReserve(float reserve)
        Set a reserve price. The reserve price is the minimum price you will accept in order to show an ad. Note that setting a reserve price may negatively affect monetization, since there may not be any buyers willing to pay more than your reserve. Setting this value to zero disables the reserve price. The default value is zero.
        Parameters:
        reserve - The reserve price expressed in CPM, e.g., 0.50f.
      • getAge

        public java.lang.String getAge()
        Retrieve the current user's age. Note that this is a string as it may come in one of several formats: age, birth year, or age range. The default value is an empty string.
        Returns:
        The current user's age.
      • setAge

        public void setAge(java.lang.String age)
        Set the current user's age. This should be set if the user's age or age range is known, as it can help make buying the ad space more attractive to advertisers.
        Parameters:
        age - A string containing a numeric age, birth year, or hyphenated age range. For example: "56", "1974", or "25-35".
      • setExternalUid

        public void setExternalUid(java.lang.String externalUid)
        Set the current user's externalUID
        Parameters:
        externalUid - .
      • getExternalUid

        public java.lang.String getExternalUid()
        Retrieve the externalUID that was previously set.
        Returns:
        externalUID.
      • getShowLoadingIndicator

        public boolean getShowLoadingIndicator()
        Get whether or not the banner or interstitial should show the loading indicator after being pressed, but before able to launch the browser.

        Default is false

        Returns:
        true if the loading indicator will be displayed, else false
      • setShowLoadingIndicator

        public void setShowLoadingIndicator(boolean show)
        Set whether or not the banner or interstitial should show the loading indicator after being pressed, but before able to launch the browser.

        Default is false

        Parameters:
        show - True if you desire the loading indicator to be displayed, else set to false
      • getGender

        public AdView.GENDER getGender()
        Get the current user's gender, if it's available. The default value is UNKNOWN.
        Returns:
        The user's gender.
      • setGender

        public void setGender(AdView.GENDER gender)
        Set the user's gender. This should be set if the user's gender is known, as it can help make buying the ad space more attractive to advertisers. The default value is UNKNOWN.
        Parameters:
        gender - The user's gender.
      • addCustomKeywords

        public void addCustomKeywords(java.lang.String key,
                                      java.lang.String value)
        Add a custom keyword to the request URL for the ad. This is used to set custom targeting parameters within the AppNexus platform. You will be given the keys and values to use by your AppNexus account representative or your ad network.
        Parameters:
        key - The key to add; this cannot be null or empty.
        value - The value to add; this cannot be null or empty.
      • removeCustomKeyword

        public void removeCustomKeyword(java.lang.String key)
        Remove a custom keyword from the request URL for the ad. Use this to remove a keyword previously set using addCustomKeywords.
        Parameters:
        key - The key to remove; this cannot be null or empty.
      • clearCustomKeywords

        public void clearCustomKeywords()
        Clear all custom keywords from the request URL.
      • getCustomKeywords

        public java.util.ArrayList<android.util.Pair<java.lang.String,java.lang.String>> getCustomKeywords()
        Retrieve the array of custom keywords associated with the current AdView.
        Returns:
        The current list of key-value pairs of custom keywords.
      • getCreativeWidth

        public int getCreativeWidth()
        Retrieve the 'unexpanded' size of the creative . It does not change if the creative used the MRAID expand or resize calls.
        Returns:
        the width
      • getCreativeId

        public java.lang.String getCreativeId()
        Retrieve the Creative Id of the creative .
        Returns:
        the creativeId
      • getCreativeHeight

        public int getCreativeHeight()
        Retrieve the 'unexpanded' size of the creative . It does not change if the creative used the MRAID expand or resize calls.
        Returns:
        the height
      • getAdType

        public AdType getAdType()
        Retrieve the AdType being served on the AdView AdType can be Banner/Video
        Returns:
        AdType of the Creative
      • setLoadsInBackground

        public void setLoadsInBackground(boolean doesLoadingInBackground)
        Sets whether or not to load landing pages in the background before displaying them. This feature is on by default, but only works with the in-app browser (which is also enabled by default). Disabling this feature may cause redirects, such as to the app store, to first open a blank web page.
        Parameters:
        doesLoadingInBackground - Whether or not to load landing pages in background.
      • getLoadsInBackground

        public boolean getLoadsInBackground()
        Gets whether or not this AdView will load landing pages in the background before displaying them. This feature is on by default, but only works with the in-app browser (which is also enabled by default). Disabling this feature may cause redirects, such as to the app store, to first open a blank web page.
        Returns:
        Whether or not redirects and landing pages are loaded/processed in the background before being displayed.
      • getAdDispatcher

        public com.appnexus.opensdk.AdDispatcher getAdDispatcher()
        Provide the ad dispatcher of this ad
        Returns:
        ad dispatcher
      • activityOnDestroy

        public abstract void activityOnDestroy()
        To be called by the developer when the fragment/activity's onDestroy() function is called.
      • activityOnPause

        public abstract void activityOnPause()
        To be called by the developer when the fragment/activity's onPause() function is called.
      • activityOnResume

        public abstract void activityOnResume()
        To be called by the developer when the fragment/activity's onResume() function is called.
      • getMediaType

        public com.appnexus.opensdk.MediaType getMediaType()
        Media type can be Banner, Interstitial or Native
        Returns:
        the media type of this ad

  • No labels