O'Reilly logo

Building Android Games with Cocos2d-x by Raydelto Hernandez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding ads to the game by inserting Java code

In the previous section, we have created an interaction between our C++ game logic code and the Java layer of our Android app by using JNI. In this section, we are going to modify our Android-specific code in order to show the Google AdMob banners in our Android game.

Note

AdMob is a Google platform that allows you to monetize your app by displaying ads, it also has analytics tools, and tools for in-app purchases.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required