Class Util


  • public class Util
    extends java.lang.Object
    • Field Detail

      • HTTP_CONNECTION_TIMEOUT

        public static final int HTTP_CONNECTION_TIMEOUT
        See Also:
        Constant Field Values
      • NATIVE_AD_VISIBLE_PERIOD_MILLIS

        public static final int NATIVE_AD_VISIBLE_PERIOD_MILLIS
        See Also:
        Constant Field Values
    • Method Detail

      • resizeInBannerNative

        public static void resizeInBannerNative​(@NonNull
                                                android.view.ViewGroup adView,
                                                android.view.ViewGroup.LayoutParams params,
                                                @Nullable
                                                Util.ResizeInBannerNativeListener listener)
        This method resizes a view that contains prebid in banner native ad to the size you desired
        Parameters:
        adView - the adView to be resized
        params - the size to be resized to, note the view group has to be the adView's parent view group type
        listener - the listener to be called when resize is done
      • convertMapToMoPubKeywords

        @NonNull
        public static java.lang.String convertMapToMoPubKeywords​(java.util.Map<java.lang.String,​java.lang.String> keywordMap)
      • generateInstreamUriForGam

        public static java.lang.String generateInstreamUriForGam​(java.lang.String adUnit,
                                                                 java.util.HashSet<AdSize> sizes,
                                                                 java.util.Map<java.lang.String,​java.lang.String> prebidKeywords)
        Generate ad tag url for Google's IMA SDK to fetch ads
        Parameters:
        adUnit - GAM ad unit id
        sizes - a set of ad sizes, only 640x480 and 400x300 are valid
        prebidKeywords - prebid keywords
        Returns:
        ad tag url
      • loadImage

        public static void loadImage​(android.widget.ImageView image,
                                     java.lang.String url)