I have used admob sdk and added as external jar.In xml i have specified
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/headerfield"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<com.google.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="Publisher Id"
ads:loadAdOnCreate="true" />
</LinearLayout>
Manifest
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
But in graphical mode its giving me a error log:
com.google.ads.AdView - the following class could not be instantiated.
Inside the program its showing
You must have AdActivity declared in AndroidManifest.xml with configChanges.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…