Making AdMob work on Android 2.3 device?(让 AdMob 在 Android 2.3 设备上运行?)
问题描述
好吧,我已经阅读了很多文章、问题和答案,但仍然找不到适合我的...
Ok so I've read a lot of articles, questions and answers but still can't find one that works for me...
我正在尝试在 Android 应用中显示 AdMob 横幅.我正在使用 Eclipse 和最新的 AdMob SDK (4.3.1),它需要 Android 3.2 (13) 才能工作.问题是,我的测试设备只有 2.3.3 (10).
I'm trying to show an AdMob banner in an Android app. I'm using Eclipse and the latest AdMob SDK (4.3.1), which requires Android 3.2 (13) to work. Thing is, my test device is only 2.3.3 (10).
--
到目前为止,我得到的最好的应用是针对 Android 2.3.3 编译的应用程序,在设备上运行,并显示横幅但带有以下消息:您必须在 AndroidManifest.xml 中使用 configChanges 声明 AdActivity
...
The best I've got so far is the app compiling against Android 2.3.3, running on the device, and a banner showing up but with this message: You must have AdActivity declared in AndroidManifest.xml with configChanges
...
在这种情况下,configChanges 属性设置为 "keyboard|keyboardHidden|orientation"
如果我将其更改为完整"版本(添加了 "|screenLayout|uiMode|screenSize|smallestScreenSize"
),它将不再编译,因为这些参数需要 Android 3.2.
In this case, the configChanges attributes is set to "keyboard|keyboardHidden|orientation"
If I change it for the "full" version (with the addition of "|screenLayout|uiMode|screenSize|smallestScreenSize"
), it doesn't compile anymore, as these params require Android 3.2.
--
我了解到,可以针对 Android SDK 13 进行编译,同时将 10 作为 minSdkVersion
.我已经尝试过了,configChanges 属性现在已满并且不会产生错误,但是 Eclipse 现在显示我的设备与 3.2 不兼容,如果我仍然运行它,应用程序就会崩溃.
I've read that it is possible to compile against Android SDK 13 while keeping 10 as the minSdkVersion
. I've tried that, the configChanges attribute is now full and does not generate an error, but Eclipse now shows my device as not compatible with 3.2, and the app crashes if I run it anyway.
--
但显然人们似乎让 AdMob 在旧设备上运行,不是吗?那么,如何?
But obviously people seem to get AdMob working on older devices, no? So, how?
如果 AdMob 4.3.1 至少需要 Android 3.2 无论如何,是否有与 2.3 兼容的旧版本?
If AdMob 4.3.1 requires at least Android 3.2 no matter what, is there an older version that's compatible with 2.3?
我真的很困惑......感谢任何能够对此有所了解的人.
I'm really confused here... Thanks to anyone who will be able to shed some light on this.
推荐答案
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation">
</activity>
适用于我的 admob 4.1.1,尚未尝试 4.3.1.
works for me with admob 4.1.1, haven't tried 4.3.1 yet.
这篇关于让 AdMob 在 Android 2.3 设备上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:让 AdMob 在 Android 2.3 设备上运行?
基础教程推荐
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01