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.
12 Comments
There is a way to check the functionablity in the debug process ? cause I’d follow the steps and it doesn’t show anything… thanks for sharing
Its supposed to be seamless. On which device are you running into a problem?
Notice this will only work on devices and not the simulator.
monetize option is not available! can u please tell me why? n how can i get it?!
We removed it as it was hard to maintain across IDE’s. We provided several newer monetization options including several ad based cn1libs [https://www.codenameone.com…](https://www.codenameone.com/cn1libs.html)
And this option which doesn’t require the monetization section, just a build hint.
admob ads are not coming…I set the admob adunit ID in build arguments in netbeans ide…if i run a app, app ll work bt ads ll nt come…I followed the codename procedure… help me..
Is this on the device? Which device type?
I am working on an app and I can add the hint for Android but I would like to know which I should use for windows phone. Thanks,
We don’t currently support Windows Phone with ads. AFAIK Googles AdMob isn’t available on Windows Phone.
Right now there is a version for windows phone for AdMob. If we build a windows phone app we can add the AdMob AdUnit for those builds.
OK. Either way Windows Phone is on the way out at Microsoft and I doubt Google would support that version. We are switching to the UWP port for universal Windows 10 support.
yes sir..I ve tested this app with lenevo smartphone….app works well but ads ll not come
That’s probably related to these changes [https://github.com/codename…](https://github.com/codenameone/CodenameOne/issues/1803)