Search in sources :

Example 1 with PublisherAdRequest

use of com.google.android.gms.ads.doubleclick.PublisherAdRequest in project prebid-mobile-android by prebid.

the class DFPBannerFragment method setupBannerWithoutWait.

private void setupBannerWithoutWait() {
    FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame);
    adFrame.removeAllViews();
    adView1 = new PublisherAdView(getActivity());
    adView1.setAdUnitId(Constants.DFP_BANNER_ADUNIT_ID_320x50);
    adView1.setAdSizes(new AdSize(320, 50));
    adView1.setAdListener(adListener);
    adFrame.addView(adView1);
    // region PriceCheckForDFP API usage
    PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
    PublisherAdRequest request = builder.build();
    Prebid.attachBids(request, Constants.BANNER_320x50, this.getActivity());
    // endregion
    adView1.loadAd(request);
}
Also used : PublisherAdView(com.google.android.gms.ads.doubleclick.PublisherAdView) FrameLayout(android.widget.FrameLayout) AdSize(com.google.android.gms.ads.AdSize) PublisherAdRequest(com.google.android.gms.ads.doubleclick.PublisherAdRequest)

Example 2 with PublisherAdRequest

use of com.google.android.gms.ads.doubleclick.PublisherAdRequest in project prebid-mobile-android by prebid.

the class DFPBannerFragment method setupBannerWithWait.

private void setupBannerWithWait(final int waitTime) {
    FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame2);
    adFrame.removeAllViews();
    adView2 = new PublisherAdView(getActivity());
    adView2.setAdUnitId(Constants.DFP_BANNER_ADUNIT_ID_300x250);
    adView2.setAdSizes(new AdSize(300, 250));
    adView2.setAdListener(adListener);
    adFrame.addView(adView2);
    // region PriceCheckForDFP API usage
    PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
    PublisherAdRequest request = builder.build();
    Prebid.attachBidsWhenReady(request, Constants.BANNER_300x250, this, waitTime, this.getActivity());
// endregion
}
Also used : PublisherAdView(com.google.android.gms.ads.doubleclick.PublisherAdView) FrameLayout(android.widget.FrameLayout) AdSize(com.google.android.gms.ads.AdSize) PublisherAdRequest(com.google.android.gms.ads.doubleclick.PublisherAdRequest)

Aggregations

FrameLayout (android.widget.FrameLayout)2 AdSize (com.google.android.gms.ads.AdSize)2 PublisherAdRequest (com.google.android.gms.ads.doubleclick.PublisherAdRequest)2 PublisherAdView (com.google.android.gms.ads.doubleclick.PublisherAdView)2