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.
From the documentation, you’ll need to include additional configChanges in your activity (assuming you’re using 4.3.1 or higher):
If you run into issues where screenSize and smallestScreenSize aren’t recognized, you’ll have to compile aganist Android 3.2 or higher. Check out this migration blog post for more information on getting off of 4.1.1 to a newer version (the same applies to moving to 6.0.0 as well).