Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AdMob - better performance in android activity

Tags:

android

admob

I have android application where I implemented AdMob ads.

My layout code is very simple - added AdView into LinearLayout:

<com.google.ads.AdView
    android:id="@+id/adMob1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adSize="BANNER"
    ads:adUnitId="{AdID}" />

In MyActivity in onCreate() method I am calling:

    boolean showAdds = true;
    if(this.showAdds) {
        AdView adView = (AdView) findViewById(R.id.adMob1);
        adView.loadAd(new AdRequest());
    }

On some older android devices (tested for example on Samsung Galaxy S1) after AdMob implementation the app is very very slow. But when I set "showAdds" variable to "false" -> the loading of MyActivity is much better.

Is there any possibility to make the application with admob faster?

Thank you for all comments.

like image 306
Pa To Avatar asked May 10 '13 20:05

Pa To


People also ask

How do I increase AdMob fill rate?

You cannot force Admob to give you better fill-rate. The best way to go if you're using Admob is to create multiple applications, and connect them through House Ads. That ways, even if your app is not getting ads, it is at least promoting your other apps, which leads to overall increase in your application downloads.

Is AdMob CPM or CPC?

The amount an advertiser pays for each click on their ads. Advertisers set CPC bids to tell AdMob how much they're willing to pay for each click.

What is the advantage of AdMob?

The AdMob advantage AdMob helps maximize revenue with more advertiser demand that helps drive high CPMs and fill rates globally. As a proven platform, our goal is not only to empower you to build sustainable revenue streams, but also to make your job easier with simple, yet powerful tools.


2 Answers

I too have been struggling with AdView increasing app load time. My solution was to move the ad code into a delay handler (within onCreate)…

final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
  @Override
  public void run() {
     AdRequest adRequest = new AdRequest.Builder().build();
     adView.loadAd(adRequest);
     adView.bringToFront();
  }
}, 5000);

So now the app starts quickly and then after 5s the adview is loaded. (p.s. .bringToFront is used because my app layout uses a mixture of XML and code, so this stops adView from being hidden)

like image 115
Mateus Avatar answered Nov 06 '22 01:11

Mateus


The adView loads a webview internally on first startup. It needs to create cookie stores etc. This will cost up to 2 seconds. If you load a webview before the adView it will benefit from it (maybe on your start up screen).

I found this hint here: https://groups.google.com/forum/#!topic/google-admob-ads-sdk/LdUVIZ2AW6M

like image 33
Tino Avatar answered Nov 06 '22 02:11

Tino