Issue with PublisherAdView for Android Download

I had some performance issues with the application (the user interface visualization froze for a few moments), did some digging and found that the PublisherAdView.loadAd () method took about 500-700 ms to execute on Nexus 5 when starting a cold application and 100- 200 ms in subsequent runs. I expected in the very near future 10-15 m.

To verify this, I downloaded the Banner Example here: https://developers.google.com/mobile-ads-sdk/docs/dfp/android/banner and modified MainActivity to execute the loadAd () method in a separate method:

private PublisherAdView mAdView;
private PublisherAdRequest adRequest;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my);

    mAdView = (PublisherAdView) findViewById(R.id.ad_view);

    adRequest = new PublisherAdRequest.Builder().build();

    loadAd();
}

 private void loadAd(){

    long start = System.currentTimeMillis();

    // Start loading the ad in the background.
    mAdView.loadAd(adRequest);

    long end = System.currentTimeMillis();

    Log.d("MyActivity", "loadAd took "+(end - start)+" ms");
}

, ( , ...), , .

, RecyclerView UI .

- , PublisherAdView?

+4
1

, adMob webviews, , Android . - Android, Chromium -. . /.

, , , ​​. . (, n- ), , , view.setTag, , .

. bindViewHolder recyclerview getItem listView, , . , /, , ( - , 30 ), , loadAd), .

, , , , . , Fragments , PublisherAdView.pause() , espcially, viewpager onDestroyView.

+1

All Articles