leefisher
Lurker
I'm having problems displaying ads in an Android application. I'm not seeing ads even in test mode.
The layout is taken from admob's instructions, as below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/lgf.fourinarow"
android
rientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:backgroundColor="#000000"
app
rimaryTextColor="#FFFFFF"
app:secondaryTextColor="#CCCCCC"
app:keywords="Android Game"
/>
</LinearLayout>
The mainfest is below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lgf.fourinarow"
android:versionCode="1"
android:versionName="1.0">
<!-- Requires Android 2.1 or above -->
<uses-sdk android:minSdkVersion="7" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="LGFFourInARow">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Track Market installs -->
<receiver android:name="com.admob.android.ads.analytics.InstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- The application's publisher ID assigned by AdMob -->
<meta-data android:value="xxxxxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID"/>
</application>
<!-- AdMob SDK permissions -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
(I have my real publisher id in my code)
I my Java code, I have included AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR } ); in the onCreate section, to enable tes mode. I've also added log messages in the onFailedToReceiveAd, onFailedToReceiveRefreshedAd, onReceiveAd and onReceiveRefreshedAd functions.
However I have still ever seen and ad, and can't see any output in the log cat.
Can anyone suggest what else I should be doing?
The layout is taken from admob's instructions, as below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/lgf.fourinarow"
android

android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:backgroundColor="#000000"
app

app:secondaryTextColor="#CCCCCC"
app:keywords="Android Game"
/>
</LinearLayout>
The mainfest is below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lgf.fourinarow"
android:versionCode="1"
android:versionName="1.0">
<!-- Requires Android 2.1 or above -->
<uses-sdk android:minSdkVersion="7" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="LGFFourInARow">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Track Market installs -->
<receiver android:name="com.admob.android.ads.analytics.InstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- The application's publisher ID assigned by AdMob -->
<meta-data android:value="xxxxxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID"/>
</application>
<!-- AdMob SDK permissions -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
(I have my real publisher id in my code)
I my Java code, I have included AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR } ); in the onCreate section, to enable tes mode. I've also added log messages in the onFailedToReceiveAd, onFailedToReceiveRefreshedAd, onReceiveAd and onReceiveRefreshedAd functions.
However I have still ever seen and ad, and can't see any output in the log cat.
Can anyone suggest what else I should be doing?