ad not showing even when using bringToFront

161 views
Skip to first unread message

Kak

unread,
Apr 3, 2014, 4:54:59 PM4/3/14
to google-adm...@googlegroups.com
Hi,

I have a game which uses a full screen View. Until now it's been using Admob "classic", but it's time to move to GPS. AdMob worked perfectly.

I insert that game view into a FrameLayout, and also an AdView. I call AdView's bringToFront in order to show it first, but it doesn't show.

However, when removing the activity from the XML manifest, the red message "you have no AdActivity" pops up and is visible.

If I remove the game view from the layout, the advert is shown. (it's like the Z order was wrong, but bringToFront should fix that, isn't it).

To add more insult to the injury, moving the game to the background and bringing it back shows the advert correctly.


Any ideas what could be causing this behaviour?

thanks!
Kak

Kak

unread,
Apr 3, 2014, 5:06:34 PM4/3/14
to google-adm...@googlegroups.com
note: it's a test ad, and the OnAdLoaded callback is called.

Amy Quispe (AdMob SDK Team)

unread,
Apr 3, 2014, 5:56:06 PM4/3/14
to google-adm...@googlegroups.com
Hi Kak,

I don't know what's wrong off the top of my head. Could you send me some code to produce this behavior?

Amy Quispe

Jordi Benaiges

unread,
Apr 3, 2014, 6:27:59 PM4/3/14
to google-adm...@googlegroups.com
Hi Amy,

thanks for the fast answer.

I'm using Xamarin, and MonoGame on top of it. A simple example shows the problem but I suppose you have no practical way to test it without investing a lot of time. Do you still want the code?  (it's not the most common development environment that's why I'm asking it beforehand)

I just found that it's only the first advert the one that is not displayed. After the first 60 seconds, once the ad is refreshed, then is shown.

It really is weird, tomorrow I'll try to move the initial ad request after MonoGame's initialization, maybe is doing something strange while creating the openGL contexts.

Thanks!
Kak

Amy Quispe (AdMob SDK Team)

unread,
Apr 3, 2014, 6:51:42 PM4/3/14
to google-adm...@googlegroups.com, jb...@tinet.cat
Hi Kak,

How about this - do you have any logs you could show me of what's going on? If I can't figure it out from that, it would be good to look at a simple example.

Amy Quispe

Jordi Benaiges

unread,
Apr 4, 2014, 5:15:30 AM4/4/14
to google-admob-ads-sdk
Hi Amy,

I moved initialization to a later stage but made no difference. I also found that reloading the ad a few seconds after the first has been loaded shows it (no need to wait 60 seconds, but that's obviously not a valid solution as I might get into problems for reloading ads too fast, isn't it?)

I'm attaching code (c#, not java, but mostly the same) and log. Please tell me if I can make the advert logs more verbose.

Thanks a lot!
Kak
ad_code.zip

Jordi

unread,
Apr 7, 2014, 7:08:02 PM4/7/14
to google-admob-ads-sdk
Hello,

Finally I'm using a trick. I'm starting the advert manager in "test mode" and once the first (test) advert is shown, I switch to normal mode. I know this is not as it should be, but this way I won't be showing a first invisible ads, which would go against TOS for sure.

If you find anything wrong please make me know.

Thanks a lot,
Kak

Eric Leichtenschlag

unread,
Apr 8, 2014, 8:00:06 PM4/8/14
to google-adm...@googlegroups.com
Can you try doing adView.setBackgroundColor(Color.TRANSPARENT); after you create the AdView object?

Thanks,
Eric

Jordi Benaiges

unread,
Apr 9, 2014, 4:29:12 AM4/9/14
to google-admob-ads-sdk
It works! :)

Thanks,
Kak


--

---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/EekBYnQjPDk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jordi

unread,
Apr 9, 2014, 5:56:15 AM4/9/14
to google-admob-ads-sdk
Hi!

I talked too fast. (well, actually the first problem was fixed, but...)


When rendering the advert, it interferes with the real game render. I have put a more detailed explanation at monogame's forum:

http://community.monogame.net/t/weird-android-graphic-bug/272


Any ideas of what could be causing the problem?

thanks a lot,
Kak

Eric Leichtenschlag

unread,
Apr 9, 2014, 6:11:28 PM4/9/14
to google-adm...@googlegroups.com
That might be a hardware acceleration problem - try turning off hardware acceleration on the AdView:

adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);


Thanks,
Eric

Jordi

unread,
Apr 10, 2014, 5:27:32 AM4/10/14
to google-admob-ads-sdk
Hi Eric, thanks for your answers.

For some reason it's not working. It's like the adview is "refusing" the hardware acceleration disable.

I call exactly what you did, and also disable acceleration at activity level, but the problem persists.

The view's "IsHardwareAccelerated" flag returns true despite setting it to false (I'm reading it ingame, not just after setting it and before attaching view to window).

The only way to get it as false is disabling the hardware acceleration in the whole application, but the problem still persists, and honestly I think it's not disabled no matter what the flags say  (the framerate is the same and the game is GPU intensive, using shaders and things like this).







--
Reply all
Reply to author
Forward
0 new messages