AdMob的API和关键字 [英] AdMob API and keywords

查看:183
本文介绍了AdMob的API和关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人管理,以获得相关的广告AdMob提供的服务器设置的关键字或搜索查询时?我的应用程序在Android上运行,我设法从AdMob的服务器中检索广告。

Does anyone manage to get relevant advertisement from AdMob server when setting keywords or search query ? My application runs on Android and I manage to retrieve ads from the AdMob server.

我尝试了几种解决方案,但他们似乎并没有工作。

I try several solutions but they do not seem to work.

解决方案1:使用方法 setKeywords(字符串关键字) setSearchQuery(字符串searchQuery)从AD浏览报类,然后,电话 requestFreshAd()。当一个请求正在进行中,调用 requestFreshAd()生成日志以下消息:

Solution 1: use the methods setKeywords( String keywords ) or setSearchQuery( String searchQuery ) from the AdView class and then, call requestFreshAd(). When a request is currently in progress, a call to requestFreshAd() generate the following message in log :

WARN / AdMobSDK(2541):忽略requestFreshAd(),因为我们是   要求广告现在了。

"WARN/AdMobSDK(2541): Ignoring requestFreshAd() because we are requesting an ad right now already."

于是,我尝试调用 requestFreshAd()时,没有要求都在进步,但它不工作了。

Thus, I try to call requestFreshAd() when no request are in progress but it doesn't work anymore.

解决方案2:在XML布局,使用的属性的myapp:AD浏览报元素的关键字=myKeywords。此属性是$ P $在attrs.xml文件pviously声明。

Solution 2: In the XML layout, use the attributes myapp:keywords="myKeywords" on the AdView element. This attributes is previously declared in the attrs.xml file.

推荐答案

AdMob的SDK将自动根据设定的刷新率要求新加。我认为,默认为60秒。所以,你不有叫 requestFreshAd()可言。从Eclipse中运行你的应用程序,去活动,其中ADDS是,看logcat的窗口。定期,你会看到,增加了自动获取,基于该刷新率设置。 您可以更改 http://www.admob.com/my_sites ,比点击了刷新频率管理一个应用程序,以及设置应用程序设置。此外,你可以简单地设置AD浏览报元素的的refreshInterval 属性的刷新间隔在布局XML文件中。

ADMob SDK will automatically request new add based on the set refresh rate. I think that the default is 60s. So, you don`t have to call requestFreshAd() at all. Run your app from from Eclipse, go to activity where the adds are, and watch logcat window. Periodically you will see that adds are fetched automatically, based on that refresh rate setting. You can change that refresh rate on http://www.admob.com/my_sites and than clicking 'Manage settings' on an app, and 'App settings'. Also, you can simply set a refresh interval with the refreshInterval attribute on the AdView element in your layout XML file.

这篇关于AdMob的API和关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆