Cocos2dx2.2.3 add admod according to official documents. Start the application and display "ad finished loading" in the eclipse log, but no advertisement is displayed on the interface,
It can only be displayed when the screen is re-lit after the screen is locked.
The Google solution is as follows:
1 adView.loadAd(adRequest);2 adView.setBackgroundColor(Color.BLACK);3 addContentView(adView,adParams);4 adView.setBackgroundColor(0);
In addition, VPN is required to test AdMob in mainland China. Otherwise, advertisements may not be displayed.
Reference URL:
Http://discuss.cocos2d-x.org/t/cocos2dxglsurfaceview-hide-my-addview-withusing-admob-for-android-device/11458/6
Http://stackoverflow.com/questions/22277904/adview-not-appear-in-android-cocos2dx
Excerpt:
Ymkimwizard18 Feb
Hello everyone.
I'll try to display AdMob on Android device.
Curiously, when I run my game. First time, I can't see addview screen.
But lock and unlock, if I come back my game. Then I can see addview without any problem.
I'm searching your code snip.
But I don't find correct answoer.
This just my own isseu? Kindly can you check my source code.
Why, first time, I can't see AdMob screen.
Ymkimwizard23 Feb
Hello.
I found solution. This is not JNI issue.
Simpley, this is come from AdMob with using Google Play service.
For solving this issue, I just add below line
Adview. loadad (adrequest );
Adview. setbackgroundcolor (color. Black );
Addcontentview (adview, adparams );
Then without any problem, from application starting, I can see AdMob view.
Thanks.
If you need further infomation can you refer below
Http://stackoverflow.com/questions/17975659/how-to-duplicate-sprite-of-sprites-in-cocos2d-x-2-1-44