public class

AdLoader

extends Object
java.lang.Object
   ↳ com.google.android.gms.ads.AdLoader

Class Overview

An object for requesting ads.

Summary

Nested Classes
class AdLoader.Builder Builder for a AdLoader
Public Methods
String getMediationAdapterClassName()
This method is deprecated. Use getMediationAdapterClassName() or getMediationAdapterClassName() instead.
boolean isLoading()
Returns true if the ad is loading.
void loadAd(PublisherAdRequest publisherAdRequest)
Send a request for an ad.
void loadAd(AdRequest adRequest)
Send a request for an ad.
void loadAds(AdRequest adRequest, int maxNumberOfAds)
Send a request for maxNumberOfAds ads.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public String getMediationAdapterClassName ()

This method is deprecated.
Use getMediationAdapterClassName() or getMediationAdapterClassName() instead.

Returns the mediation adapter class name. In the case of a mediated ad response, this is the name of the class that was responsible for performing the ad request and returning the ad. For non-mediated responses, this value is null.

Returns
String

public boolean isLoading ()

Returns true if the ad is loading. If multiple ads are requested, returns true until all ads finish loading.

Returns
boolean

public void loadAd (PublisherAdRequest publisherAdRequest)

Send a request for an ad.

Parameters
publisherAdRequest PublisherAdRequest: An object containing all of the request information.

public void loadAd (AdRequest adRequest)

Send a request for an ad.

Parameters
adRequest AdRequest: An object containing all of the request information.

public void loadAds (AdRequest adRequest, int maxNumberOfAds)

Send a request for maxNumberOfAds ads. The AdLoader will send up to maxNumberOfAds callbacks in response, which may include any combination of the following:

Publishers should call isLoading() inside their implementations of these methods to determine whether the AdLoader has completely finished loading ads.

Parameters
adRequest AdRequest: An object containing all of the request information.
maxNumberOfAds int: An integer denoting the maximum number of ads to load.