I am trying to implement support for Interstitial Ads in my android app, which I'm hoping to publish soon. I am encountering two problems for which I'm hoping someone might have some insight. I have followed the most current instructions I could find from Google.
Firstly, I was wondering if there's an ad_unit_id I should use for testing Interstitial ads. Right now I have ca-app-pub-3940256099942544/6300978111
but I think that's only for testing banner ads?
Secondly, when I invoke m_interstitial.loadAd(new AdRequest.Builder().build());
I get the following errors:
03-04 14:40:42.181: W/dalvikvm(30338): VFY: unable to resolve static method 3097: Landroid/webkit/WebSettings;.getDefaultUserAgent (Landroid/content/Context;)Ljava/lang/String;
03-04 14:40:42.922: W/dalvikvm(30338): VFY: unable to resolve virtual method 159: Landroid/app/Notification$Builder;.setPriority (I)Landroid/app/Notification$Builder;
03-04 14:40:42.932: W/dalvikvm(30338): VFY: unable to resolve virtual method 441: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
03-04 14:40:43.132: I/webclipboard(30338): clipservice: android.sec.clipboard.ClipboardExManager@4162a320
It looks like I'm missing something, but I've followed all the instructions I could find and can't figure out what's missing?
I'm using Eclipse for development. According to SDK Manager, I'm using Google Play Services version 22, and Google Repository version 15. Any insights would be greatly appreciated. Thank you!
Okay, so I found the answers myself:
For testing interstitial ads (and for banner ads), it's recommended that you use addTestDevice, as described here. The device ID is emitted in your debug output when you run the app.
The crash was caused by the ads being invoked from the OpenGL render thread. They needed to either be called from the UI thread or in a thread-safe manner (using messages) from the other thread.