Fork us on GitHub

Adding Google Play Ad's

We are officially code frozen so only critical bug fixes shou...

Adding Google Play Ad's

We are officially code frozen so only critical bug fixes should be resolved until the actual release. The very last feature to make it in is support for Google Play Ads on iOS/Android. We currently only work with the Admob SDK as we move along we might add additional options.

To enable mobile ads just create an ad unit in Admob's website, you should end up with the key similar to this: ca-app-pub-8610616152754010/3413603324

To enable this for Android just define android.googleAdUnitId= ca-app-pub-8610616152754010/3413603324 in the build arguments and for iOS use the same as in ios.googleAdUnitId. The rest is seamless, the right ad will be created for you at the bottom of the screen and the form should automatically shrink to fit the ad. This shrinking is implemented differently between iOS and Android due to some constraints but the result should be similar and this should work reasonably well with device rotation as well.

Notice: This post was automatically converted using a script from an older blogging system. Some elements might not have come out as intended.... If that is the case please let us know via the comments section below.

Share this Post:

Posted by Shai Almog

Shai is the co-founder of Codename One. He's been a professional programmer for over 25 years. During that time he has worked with dozens of companies including Sun Microsystems.
For more follow Shai on Twitter & github.