{% include "/admob/android/reference/_dackka-meta-tags.html" %}

MediationUtils

{% setvar page_path %}com/google/android/gms/ads/MediationUtils.html{% endsetvar %} {% setvar doc_root_path %}/admob/android/reference{% endsetvar %} {% setvar can_switch %}1{% endsetvar %} {% include "android/_java_switcher2.md" %}

public class MediationUtils


Utility methods for mediation adapters.

Summary

Constants

static final double
static final double

Public constructors

Public methods

static @Nullable AdSize
findClosestSize(
    Context context,
    AdSize original,
    List<AdSize> potentials
)

Finds the closest supported AdSize from the list of potentials to the provided size.

Constants

MIN_HEIGHT_RATIO

protected static final double MIN_HEIGHT_RATIO = 0.7

MIN_WIDTH_RATIO

protected static final double MIN_WIDTH_RATIO = 0.5

Public constructors

MediationUtils

public MediationUtils()

Public methods

findClosestSize

public static @Nullable AdSize findClosestSize(
    Context context,
    AdSize original,
    List<AdSize> potentials
)

Finds the closest supported AdSize from the list of potentials to the provided size. Returns null if none are within given threshold size range.