How to integrate an Admob interstitial in a Processing.org sketch in Android

edited September 2014 in How To...

I've being struggling with Admob integration in a Processing.org sketch converted into an Android app for some time. First I've got a banner properly working (so I know Admob is correctly setup), but now I'd like to have an interstitial too.

I've followed this tutorial to complete the integration: [http://www.androidbegin.com/tutorial/integrating-new-google-admob-banner-interstitial-ads/]

However, I haven't been able to make layouts work with the app, since sketch apps do not have an explicit call to setContentView() (I think the problem is related to this point). When I try to launch the app, it does not responde but there is no visible error message.

Has anybody a hint about how to make a explicit layout work with a Processing.org sketch Android app, or even better, has anybody an example project that successfully integrates Admob interstitials? Thank you in advance

Answers

  • Hi,

    I'm getting close to making this work.

    I got admob to display using the old sdk, but been struggling with the migration with processing.

    I can now get the ad to load, but when I try and display the add using an 'if' statement in my draw function, I get the following error.

    Process: processing.test.jellycrush, PID: 24705 java.lang.IllegalStateException: isLoaded must be called on the main UI thread. at bvz.b(SourceFile:251) at zk.e(SourceFile:403) at aao.onTransact(SourceFile:66) at android.os.Binder.transact(Binder.java:361) at com.google.android.gms.internal.aq$a$a.isReady(Unknown Source) at com.google.android.gms.internal.av.isLoaded(Unknown Source) at com.google.android.gms.ads.InterstitialAd.isLoaded(Unknown Source) at processing.test.jellycrush.jellycrush.test1(jellycrush.java:738) at processing.test.jellycrush.jellycrush.draw(jellycrush.java:328) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source) at processing.core.PApplet.run(Unknown Source) at java.lang.Thread.run(Thread.java:841)

    As far as I am aware, "isLoaded" is being called from the main UI thread (I only have one Java file), so I'm now at a bit of a loss...

Sign In or Register to comment.