我讀了很多以前的AdMob的職位,但沒有充分回答有關AdLoader超時問題的問題。這是錯誤:http://i42.tinypic.com/9s5ag4.jpg的AdMob:AdLoader 60000毫秒之後超時而獲取URL
注:我使用舊的jar文件(GoogleAdMobAdsSdk-4.1.1.jar),因爲我指定一個較舊的Android版本。
AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.something.www"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".AdActivityActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" >
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
AdActivity.java
package com.something.www;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import com.google.ads.*;
public class AdActivity extends Activity {
private AdView adView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
adView = new AdView(this, AdSize.BANNER, "xxxxxxxxxxxxxxx");
LinearLayout layout = (LinearLayout) findViewById(R.id.main);
layout.addView(adView);
AdRequest ar = new AdRequest();
ar.addTestDevice(AdRequest.TEST_EMULATOR);
ar.addTestDevice("425EF274CEBECB11F9EFEBF5B51458B1");
adView.loadAd(ar);
return;
}
}