Games Getting an error trying to display admob full screen interstitial

andymc

Well-Known Member
Licensed User
Longtime User
Until now I've been triggering interstitials from the activity_keypress event, how ever I now want to trigger it from the touchdown event, or any other part of my game, but I get an error saying it must be called from the mainUI thread.
How do I solve this, I see answers on Google suggesting overiding the mainui function but how do I fix this in b4a?
 

ilan

Expert
Licensed User
Longtime User
B4X:
Sub showadnow(obj As Object)
    If iad.Ready Then iad.Show Else iad.LoadAd
End Sub

to call it use:

B4X:
lGdx.CallSubUI("showadnow",Null)

EDIT: i assume that you are talking about LibGDX ;)
 

andymc

Well-Known Member
Licensed User
Longtime User
thanks ilan, you are very correct this is LibGDX. I'm trying to change my ads to show inbetween levels or when the player starts the game, it keep crashing though as I'm calling from the libgdx IPtouchdown sub. I guess you have hit this problem yourself.
 

ilan

Expert
Licensed User
Longtime User
thanks ilan, you are very correct this is LibGDX. I'm trying to change my ads to show inbetween levels or when the player starts the game, it keep crashing though as I'm calling from the libgdx IPtouchdown sub. I guess you have hit this problem yourself.

does it crashes also with the solution i posted above?
 

ilan

Expert
Licensed User
Longtime User
i am not sure i understand what you mean.

do you show the ad when the user click on START to start the game?

if so you should not do that. its better to show the ad when the game ends and not before its starts.

i am not talking about showing the ad after game loads. if you are talking about showing the ad when the user open our application then the ad should appear after a logo screen was shown or the menu of the game and not right on game start.
 

wonder

Expert
Licensed User
Longtime User
Displaying an ad at the beginning (of the game / level / challenge) will only irritate the player*.
The player wants to play your game, not click some stupid ad.

I would always place the ad at the end of a challenge. Let's think about it in terms of psychology.

The player clears the level:
WHOOHOOO!!! YOU'RE THE BEST!!! AMAZING!!
You are sooo AWESOME you even got a sponsorship!!
** Your victory is sponsored by: $advertisement$ **
The player fails to clear the level:
BAH!!! YOU SUCK!!!
** As a punishment, you'll have to watch this ad: $advertisement$ **
So in my view, the ad should function as either a punishment or a reward. :)



*For me, as a user, that would be an "uninstall flag"!
 

ilan

Expert
Licensed User
Longtime User
Displaying an ad at the beginning (of the game / level / challenge) will only irritate the player*.
The player wants to play your game, not click some stupid ad.

I would always place the ad at the end of a challenge. Let's think about it in terms of psychology.

The player clears the level:
WHOOHOOO!!! YOU'RE THE BEST!!! AMAZING!!
You are sooo AWESOME you even got a sponsorship!!
** Your victory is sponsored by: $advertisement$ **
The player fails to clear the level:
BAH!!! YOU SUCK!!!
** As a punishment, you'll have to watch this ad: $advertisement$ **
So in my view, the ad should function as either a punishment or a reward. :)



*For me, as a user, that would be an "uninstall flag"!

Correct!
 

andymc

Well-Known Member
Licensed User
Longtime User
Good idea, that makes sense. I think it's just finding the right balance to not encourage users to uninstall but to gain the greatest number of clicks on ads.
I will monitor reviews to see how changes I make to adverts affect user experience.
Maybe I could try different approaches and roll out version to different groups of users to test?

I don't want to ruin the user experience of playing the game, but I do want advertising to be worth while.

I do find interstitials ads give the best return on number of ads shown compared to banners, but they're also the hardest to implement ion the right way.
 

sorex

Expert
Licensed User
Longtime User
if you use admob then there are guidelines how you should implement your interstitials and how not.

it's all explained here with animated and overview images.

https://support.google.com/admob/answer/6201362?hl=en&ref_topic=2745287

and yes, they pick out apps to validate this. I had to change 2 of my first apps because they showed an ad when the app menu was loaded.
there should be a splash/loading screen inbetween or they'll nag about it because people might click a menu item just when the ad appears.
 
Top