In the past days, I have been trying to get a MOE project with LibGDX working that uses the Google Admob SDK with bindings.
Since there was no straightup tutorial and helpful documentation (I suspect that this gets fixed with the MOE 2.0 release), I got my information from various GitHub pages and forum entrys.
Some links that helped me:
In the end, I got a working demo project (you have to tap on the screen to show/hide the ad).
MOE Version 1.3.6, LibGDX Version 1.9.6
I’ve tried to adopt your above admobtest code on my environment and finally get it running on my device without any error but no banner ads was shown. I can only see the badlogic logo displayed with the red background.
My environment:
Mac OS 10.11.6
Android Studio 3.0
Xcode 7.3.1
com.android.tools.build:gradle:3.0.0
org.multi-os-engine:moe-gradle:1.3.6
gdxVersion = ‘1.9.7’
I would like to share my code but I’m new to GitHub and still struggling how to upload folders of codes or create folder on GitHub manually. At the moment, I’ve uploaded a few files at the root level at the URL:
I solved it! I connected the device for testing and thus forget to turn on network (i.e. wifi connection). I turned on wifi and started the app and saw the test banner now! Problem solved!
Any sample code for Interstitial ads. I tried but can only display once and the interstitialDidDismissScreen is not called. In there I tried to re-alloc the GADInterstitial and make the ads load.
I based on your thoughts and made a twist and solved the problem:
I have similar initialization method but without the setDelegate call.
In actual show method, I made use of the ‘not ready’ else clause to call the initialization method. Next time the show method is called will display the interstitial ads.
Thanks for taking your time of creating and sharing this example. I have cloned it but got into trouble when trying to build it. The problem is that in the IOSLauncher class there is this call within the createApplication method:
return new IOSApplication(new MyGdxGame(), config);
But MyGdxGame constructor is actually declared as follows:
public MyGdxGame(adDelegate ads)
There’s no constructor without arguments in that class, thus I’m getting this compiler error:
error: constructor MyGdxGame in class MyGdxGame cannot be applied to given types;
required: adDelegate
found: no arguments
reason: actual and formal argument lists differ in length