The admob ads not dispaly, but no error in my logcat
Posted
by
???
on Stack Overflow
See other posts from Stack Overflow
or by ???
Published on 2012-06-09T16:37:18Z
Indexed on
2012/06/09
16:40 UTC
Read the original article
Hit count: 250
android
package com.admob.test;
import android.app.Activity;
import android.os.Bundle;
public class AdmobTestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.admob.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="4" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".AdmobTestActivity"
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|screenLayout|uiMode|screenSize|s mallestScreenSize" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="xxxxxxxxxxxxxxx"
ads:adSize="BANNER"
ads:testDevices="C904358AFB272CDFA888A5C1CB914DA4"
ads:loadAdOnCreate="true"/>
</LinearLayout>
I'd like to test my admob ads in my Android application, but the ads can't display. And no error can be found in the logcat. I also can find the success request for ads from Admob. I use "X" to indicate my publish id, could any expert kindly help me? thanks in advanse.
© Stack Overflow or respective owner