Admob plugin causes frame rate drop when the ad cycles

OK, seems they are called “Standard banner” (http://v-play.net/doc/plugins1-admob/#standard-banner).

To clarify, we are talking about banners which are always the size of 320x50 and do not re-size depending on the device.

Anyway, I am using them in my game (as described above) in my game “Ultimate Blackjack 3D” written in Java where I could use AdMob SDK and never had ANY FPS issues.

As for the comment that ads should be shown when they don’t take away from the presentation, that could be said for interstitials.

The standard way apps show banners is during the whole game-play, otherwise they do not have any sense.

Regards,
Damir.

Hi Rob,

It seems to me the banners that corona has implemented in their admob plugin are smart banners. If they were actually normal banners, the ads would not stretch across the width of the devices to fill the space but instead would have a fixed dimension (for ex. 320x20). I have many corona apps now and I have seen that the ads do stretch all the way across the screen.

I understand your advice that we should not have an ad running during game play. However, it does seem to be a very standard practice regardless.

Can’t we take a step back here and look at what people are reporting:

* There is a substantial frame rate drop when using the admob plugin to show ads. It is so prominent that it renders apps unusable if there is any kind of movement going on in the scene.
* This is a widespread issue and not isolated to a specific incident

* There have been reports from users who have made NON-corona apps that they do not see this issue when using admob ads.

Clearly this illustrates the point that something wrong is going on with the corona admob plugin. 

I think it would be beneficial for the corona staff to stop denying that there is an issue with their plugin and start investigating/fixing it.

I have the same issue, and it is terrible that not exists a fix. :o 

Everytime the admob banner show any animation or transition, my game just slow down a lot, and become unplayable.  :frowning:

I can’t put the banner on another place because it is a part of the game in my screen, and the gameplay was created with that on mind.

Anyone knows something more about it?  :wacko:

Anyone having problems on Android with the ads not popping up until the second banner?

I’m having problems with admob on android with the first banner not showing (even though it’s reporting as shown), but not on iOS where I switch between iAds and AdMob

Noticed a large thread on the subject with Android developers in regard to the first banner not showing up

https://groups.google.com/forum/#!topic/google-admob-ads-sdk/avwVXvBt_sM

Guess I’m switching to v1 admob on Android and v2 on iOS

@Ernest, this is is a Google issue.  One of our community members found that if you’re using Google Play game services and you’ve logged in (effectively logging in to their G+ social network) that you get the first ad.

Google is turning off V1 on August 1st.  I’ve also heard that once you upgrade your AdMob dashboard, you also then have to use V2 as well.  I’ve not verified that.

Rob

Well I’m not adding Google play services, but this problem does sound like a common issue in the Android community and there seems to be a work around that your developers should look into (it may also resolve your admob performance issue)

From the same link I provided above https://groups.google.com/forum/#!topic/google-admob-ads-sdk/avwVXvBt_sM

can you please get this to whomever implemented the admob v2 plugin

David Lott 
Feb 3

I was having this trouble as well and found a work-around.

First thing is don’t add the ad to your layout initially!  I created an AdListener() and set it to my ad view.  Then in onAdLoaded, I put the ad view into my layout at that point.  You have to take care to only add the ad view once, and not every time an ad is loaded of course!  But this seems to make sure the ad is displayed the first time it is loaded, and not skipped.

Here is an example:

adView.setAdListener(new AdListener()
     {
      @Override
      public void onAdLoaded()
      {
       if(firstTime)
       {
        firstTime = false;
        layout.addView(adView);
       }
      }
     });

@Ernest

This is, IMHO, quite a serious problem (always is if you’re on the end of it!).

This bug was reported here:

http://forums.coronalabs.com/topic/47222-admob-v2-plugin-test-results/page-2?hl=+ingemar%20+bug%20+admob

I’ve reported bug (3) First banner not shown.

Case 32594

 

Note: This only happens on Android. 

iOS is OK.

It’s been just over a month now since this bug was reported.

It’s quite serious because if you call ads.hide() followed by ads.show() you are then waiting another 30 seconds (or whatever is set in the AdMob portal) before a new banner appears. That’s bad.

I’ve had to resort to showing banners on the start screen in order to keep calls to ads.show() to a minimum. Don’t like to show banners on the start screen but needs must…

I’ve just recently renewed my Pro subscription at the grandfathered in rate. At the top subscription rate I’m not so sure I would have renewed. All SDKs have their bugs but I can’t help but think that Corona are prioritizing new features to the detriment of existing developers’ outstanding bugs. I appreciate that all SDKs have bugs, but … too many here for my liking.

Just mmy 2c/1p worth.

is any work occurring on this?

i’m aware of two issues w admob, each of which individually make it nearly useless, and together make it completely useless: the first ad doesn’t appear, and frame rate drops.

suggest engineering fully read: (as previously posted by Ernest above)

https://groups.google.com/forum/#!topic/google-admob-ads-sdk/avwVXvBt_sM

to see if it offers any hints

that thread, and others elsewhere, strongly suggest that it is a “layout issue”, where/when the admob view is overlaid on top of an opengl surface view (instead of nestled beside it, as would be possible with a native android java app - where the problem doesn’t seem to occur)

is it not also possible that some interplay between the adview overlaying the opengl surface is also responsible for the performance problems?  (perhaps somehow interfering with opengl redraws or something?)  i obviously have no clue, but just as food for thought

suggested workarounds for the first-ad-not-visible include making the ad view background transparent and/or altering how/when visible/invisible vs remove/re-add the view.  Q:  if upon fixing THAT problem, has the frame-rate issue been affected as well?

in any case, the implications of that thread, along with reports elsewhere of ppl with native java who DON’T see either problem with “proper” layouts, are that the problem mignt not be on google’s/admob’s end, but rather resulting from older layout strategies that are no longer appropriate.

worth an engineering look?

The admob-v2 plugin has been updated so that the first ad is shown correctly.  Please report if you see otherwise.

@Ernest That was a very helpful thread, thank you.

This is really great news!

Now make us ueber happy by solving the FPS drop problem, please…

New bug which causes app crash!

The first ad is now shown but when I try to show an interstitial after the banner, the app crashes.

Here is the code at which it crashes:

ads.hide()

ads.show( INTERSTITIAL, { x=0, y=0, appId = ADMOB_FULL, testMode=false } )    
 

06-13 23:41:22.159: E/AndroidRuntime(11757): FATAL EXCEPTION: main
06-13 23:41:22.159: E/AndroidRuntime(11757): java.lang.NullPointerException
06-13 23:41:22.159: E/AndroidRuntime(11757):     at CoronaProvider.ads.admob.AdMobAd$2.run(AdMobAd.java:155)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at android.os.Handler.handleCallback(Handler.java:615)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at android.os.Handler.dispatchMessage(Handler.java:92)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at android.os.Looper.loop(Looper.java:137)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at android.app.ActivityThread.main(ActivityThread.java:4895)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at java.lang.reflect.Method.invokeNative(Native Method)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at java.lang.reflect.Method.invoke(Method.java:511)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
06-13 23:41:22.159: E/AndroidRuntime(11757):     at dalvik.system.NativeStart.main(Native Method)
06-13 23:41:22.214: E/android.os.Debug(329): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error

You can get around that by calling http://docs.coronalabs.com/daily/plugin/ads-admob-v2/load.html for now.  This crash will be fixed shortly.

It is OK now, thank you very much.

So back to the thread topic: Admob plugin causes frame rate drop

This is really a business killer.

E.g. In our games we have a dynamic interface (nothing to fancy, the buttons zoom in-out) and when the banners are on you can see stuttering. Of course it is even worse when the objects and animations inside the gameplay start to stutter.

Now, once again I have adMob plugin integrated in my Java written game “Ultimate BlackJack 3D”, please download it and you will see there is no stuttering at all.

Also, I can’t find nowhere on the net people with other tools (e.g. Unity) reporting such behavior.

Corona Labs, please take another look into this big issue.

Regards,

Damir.

P.S. Gremlin Interactive if you are reading this, please consider making your version of the adMob plugin, I am sure if implemented right, you would have many customers.

It’s been 3 and 1/2 months so far since I first reported this issue to Corona and have yet to see a serious response from them… 

http://googleadsdeveloper.blogspot.com/2013/07/admob-plugin-for-unity3d.html

“In particular, we advise that you put ads on screens only where they won’t cause a dip in your app’s frame rate.”

http://forum.unity3d.com/threads/admob-unity-package-low-device-fps.205306/

http://answers.unity3d.com/questions/678007/admob-banner-causes-frame-rate-lag-android.html?sort=oldest

http://stackoverflow.com/questions/23129062/unity-game-is-having-lags-after-integrating-admob-ads

http://stackoverflow.com/questions/9366365/android-admob-admob-ad-refresh-destroys-frame-rate

http://discuss.cocos2d-x.org/t/admob-slows-rendering-speed-to-half/8639/5

http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=12558

I worked around the problem:

  1. Prefer interstitials over banner ads. (they perform better for me anyways)
  2. Only show banners when the game is paused

Seems the animated AdSense ads are causing the FPS drop.

Is there a way to turn them off in AdMob dashboard ? (can’t find it)

This is such a google thing to do. Just like their failure to allow permanent settings on maps to avoid toll ways. 

Instead of allowing us to disable animated ads, they are basically just saying, ‘You’re using it wrong’.