【发布时间】:2012-01-31 15:45:21
【问题描述】:
我很绝望!! 我正在尝试在我的应用程序中实施 Admob 广告……但这是一个巨大的失败……我在实施 Admob 上浪费的时间比编写我的应用程序还要多……我真的需要你的帮助。
我给你所有的信息:
我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="package.test.sound"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:icon="@drawable/gg"
android:label="@string/app_name" >
<activity
android:name=".startActivity"
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=".test1"
android:label="@string/app_name" >
</activity>
<activity
android:name=".test2"
android:label="@string/app_name" >
</activity>
<activity
android:name=".test3"
android:label="@string/app_name">
</activity>
<meta-data android:value="xxxx MY ID xxxx" android:name="ADMOB_PUBLISHER_ID" />
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"></activity>
<uses-sdk android:minSdkVersion="10"/>
</application>
</manifest>
现在是我的 Main.XML
<?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:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/sc2"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="test1"
android:textColor="#005113" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="test2"
android:textColor="#970000" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="test3"
android:textColor="#001760" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="bottom" >
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
ads:adSize="BANNER"
ads:adUnitId="xxxx MY ID xxxx"
ads:loadAdOnCreate="true" >
</com.google.ads.AdView>
</LinearLayout>
</LinearLayout>
我不知道该怎么办......
我正在使用 Admob SDK 4.3.1,我的项目属性在 Android 4.0.3 上!! 我的项目目标设置为:target=android-15。
还有一件事......当我在我的 HTC EVO 3D 上安装我的 APK 时,应用程序不是全屏,它在我的屏幕上很小,我也不知道为什么......
但我的第一个大问题是广告没有出现......
当我在 Eclipse 上使用 AVD 模拟器模拟我的应用程序时,我在 LogCats 调试中看到了这个屏幕:http://s4.noelshack.com/old/up/help-c2e97f1a28.jpg
感谢您的帮助!!!
【问题讨论】:
-
答案对我不起作用。请帮助我:)