Admob ads are not appearing in my android app.. I have implemented admob code using XML method. Though adds are not appearing but it is sending requests to admob.. ( 8 requests with 100% fill rate). What am I missing? and how to enable test mode in XML implementation of admob ads?
Here is my main xml file :
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@layout/back2"
android:orientation="vertical"
android:padding="30dip" >
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/adView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="AdMob ID"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:text="@string/hello"
android:textSize="15sp" />
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_marginTop="50dp"
android:background="@color/buttonc1"
android:text="@string/tutorials"
android:textSize="21sp" />
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_marginTop="30dp"
android:background="@color/buttonc3"
android:text="@string/themes"
android:textSize="21sp" />
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_marginTop="30dp"
android:background="@color/buttonc2"
android:text="@string/gadgets"
android:textSize="21sp" />
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_marginTop="30dp"
android:background="@color/buttonc4"
android:text="@string/networking"
android:textSize="21sp" />
<Button
android:id="@+id/button5"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_marginTop="30dp"
android:background="@layout/button5"
android:text="@string/win8index"
android:textColor="#D5D5D5"
android:textSize="21sp" />
</LinearLayout>
</ScrollView>
Here is the manifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.core.mywindows8"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="org.core.mywindows8.Corefile"
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=".Contenturl"
android:label="My Windows 8" >
</activity>
<activity
android:name=".Tutorial"
android:label="Tutorial Categories" >
</activity>
<activity
android:name=".MainActivity"
android:label="General Troubleshoot" >
</activity>
<activity
android:name=".Myfeed"
android:label="Tutorial Categories" >
</activity>
<activity
android:name=".MyWindows"
android:label="My Windows 8" >
</activity>
<activity
android:name=".Topic"
android:label="Tutorial Categories" >
</activity>
<activity
android:name=".ActivityNet"
android:label="Networking and Internet" >
</activity>
<activity
android:name=".Appear"
android:label="Windows 8 Customization Guide" >
</activity>
<activity
android:name=".HD"
android:label="Hardware and Drivers" >
</activity>
<activity
android:name=".Index"
android:label="Windows 8 Master Index" >
</activity>
<activity
android:name=".Inter"
android:label="Networking Articles" >
</activity>
<activity
android:name=".Short"
android:label="Shortcut and Context Menu" >
</activity>
<activity
android:name=".StartSc"
android:label="Taskbar and Start Screen" >
</activity>
<activity
android:name=".Tab"
android:label="Windows 8 Tablet" >
</activity>
<activity
android:name=".UA"
android:label="Windows 8 User Account" >
</activity>
<activity
android:name=".Update"
android:label="Windows 8 Updates and Gadgets" >
</activity>
<activity
android:name=".WinTheme"
android:label="Windows 8 Themes" >
</activity>
<activity
android:name=".MainActivity1"
android:label="System and Security" >
</activity>
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
</manifest>
Put the
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"with yourAdViewand remove from yourListView. (See below) Don’t forget to clean your project.Also, remove
xmlns:android="http://schemas.android.com/apk/res/android"from yourLinearLayout.You are not seeing the ad because you haven’t given enough space to your Ad which is preventing display and you should see this message.
To see the ad, give more space. Try something like this
You can see this above, but to put in test mode in your emulator, use the
testDevicesXML field.Do add real devices, plug your phone into your computer and run your app on your phone. You’ll see your phone ID in LogCat. Is will say something in green.
You can ad your other real devices by adding them like this