interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(myker);
adView = new AdView(this);
adView.setAdSize(AdSize.SMART_BANNER);
adView.setAdUnitId(mykey);
// Add the AdView to the view hierarchy. The view will have no size
// until the ad is loaded.
LinearLayout layout = (LinearLayout) findViewById(R.id.adview);
layout.addView(adView);
// Create an ad request. Check logcat output for the hashed device ID to
// get test ads on a physical device.
AdRequest adRequest = new AdRequest.Builder().build();
AdRequest adRequest2 = new AdRequest.Builder().build();
// Start loading the ad in the background.
adView.loadAd(adRequest);
interstitial.loadAd(adRequest2);
interstitial.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
interstitial.show();
}
@Override
public void onAdFailedToLoad(int error) {
Log.i("ERROR", "ERROR:"+error);
}
});
Enter code here...
04-14 16:46:49.776: I/Ads(22817): Use AdRequest.Builder.addTestDevice("removed") to get test ads on this device.
04-14 16:46:49.784: I/dalvikvm(22817): Could not find method android.webkit.WebSettings.getDefaultUserAgent, referenced from method acd.a
04-14 16:46:49.784: W/dalvikvm(22817): VFY: unable to resolve static method 3899: Landroid/webkit/WebSettings;.getDefaultUserAgent (Landroid/content/Context;)Ljava/lang/String;
04-14 16:46:49.784: D/dalvikvm(22817): VFY: replacing opcode 0x71 at 0x0011
04-14 16:46:49.791: I/Ads(22817): Starting ad request.
04-14 16:46:49.846: I/dalvikvm(22817): Could not find method android.webkit.WebSettings.setMediaPlaybackRequiresUserGesture, referenced from method acl.<init>
04-14 16:46:49.846: W/dalvikvm(22817): VFY: unable to resolve virtual method 3914: Landroid/webkit/WebSettings;.setMediaPlaybackRequiresUserGesture (Z)V
04-14 16:46:49.846: D/dalvikvm(22817): VFY: replacing opcode 0x6e at 0x003d
04-14 16:46:51.065: I/Ads(22817): Use AdRequest.Builder.addTestDevice("removed") to get test ads on this device.
04-14 16:46:51.065: I/Ads(22817): Starting ad request.
04-14 16:46:52.268: D/libEGL(22817): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
04-14 16:46:52.307: D/libEGL(22817): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
04-14 16:46:52.315: D/libEGL(22817): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
04-14 16:46:52.424: D/OpenGLRenderer(22817): Enabling debug mode 0
04-14 16:46:52.432: I/Choreographer(22817): Skipped 54 frames! The application may be doing too much work on its main thread.
04-14 16:46:52.807: W/ResourceType(22817): Requesting resource 0x7f0b000e failed because it is complex
04-14 16:46:52.838: E/GooglePlayServicesUtil(22817): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-14 16:46:53.041: E/GooglePlayServicesUtil(22817): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-14 16:46:53.088: E/GooglePlayServicesUtil(22817): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-14 16:46:53.120: E/GooglePlayServicesUtil(22817): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
04-14 16:46:59.229: W/Ads(22817): There was a problem getting an ad response. ErrorCode: 2
04-14 16:46:59.284: W/Ads(22817): Failed to load ad: 2
04-14 16:46:59.284: I/ERROR(22817): ERROR:2
04-14 16:47:02.151: D/dalvikvm(22817): GC_FOR_ALLOC freed 934K, 11% free 8937K/9955K, paused 46ms, total 56ms
04-14 16:47:02.151: D/webviewglue(22817): nativeDestroy view: 0x4d2cb2d8
04-14 16:47:02.166: D/webviewglue(22817): nativeDestroy view: 0x4d2cb420
04-14 16:47:05.229: D/libc(22817): Forward DNS query to netd(h=lh6.ggpht.com s=^)
04-14 16:47:05.229: D/libc(22817): Forward DNS query to netd(h=googleads.g.doubleclick.net s=^)
04-14 16:47:06.377: D/libc(22817): Forward DNS query to netd(h=csi.gstatic.com s=^)
04-14 16:47:07.502: I/Ads(22817): Scheduling ad refresh 60000 milliseconds from now.
04-14 16:47:07.510: I/Ads(22817): Ad finished loading.
Can you try logging this? This if statement is what the SDK uses to determine whether it can call the getDefaultUserAgent method.
Log.i("MyApp", String.valueOf(Build.VERSION.SDK_INT));
Log.i("MyApp", String.valueOf(Build.VERSION_CODES.JELLY_BEAN_MR1));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
Log.e("MyApp", "My Android OS version is at least Jelly Bean MR1. I shouldn't have gotten here on my Droid Bionic");
} else {
Log.i("MyApp", "My Android OS version is less than Jelly Bean MR1");
}
04-16 09:57:22.289: I/MyApp(17457): 16
04-16 09:57:22.289: I/MyApp(17457): 17
04-16 09:57:22.289: I/MyApp(17457): My Android OS version is less than Jelly Bean MR1