- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
你好我尝试制作一些在 Android 手机上展示广告的示例程序,并尝试在 v2.2 的 Emulator 上对其进行测试代码中的一切似乎都很好,但调试器中的 AdListener 说:
Response message is zero or null;
onFailedToReceiveAd( No ad to show).
有什么办法可以让我错吗?有没有人遇到同样的问题?这是代码 list :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.AdTest"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".AdTest"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- AdMobActivity definition -->
<activity android:name="com.google.ads.AdActivity"
android:configChanges="orientation|keyboard|keyboardHidden" />
</application>
<uses-sdk android:minSdkVersion="7"></uses-sdk>
<!-- AdMob SDK requires Internet permission -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
布局xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
和 Activity 代码
package com.AdTest;
import com.google.ads.*;
import com.google.ads.AdRequest.ErrorCode;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.LinearLayout;
public class AdTest extends Activity implements AdListener{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout layout = (LinearLayout)findViewById(R.id.main);
AdView adView = new AdView(this, AdSize.BANNER, "anonymouse");
// Unit ID is correct, I changed it on purpose while pasting here
adView.setAdListener(this);
layout.addView(adView);
AdRequest request= new AdRequest();
adView.loadAd(request);
}
public void onFailedToReceiveAd(AdView adView)
{
Log.d("AdListener", "onFailedToReceiveAd");
}
public void onFailedToReceiveRefreshedAd(AdView adView)
{
Log.d("AdListener", "onFailedToReceiveRefreshedAd");
}
public void onReceiveAd(AdView adView)
{
Log.d("AdListener", "onReceiveAd");
}
public void onReceiveRefreshedAd(AdView adView)
{
Log.d("AdListener", "onReceiveRefreshedAd");
}
@Override
public void onDismissScreen(Ad arg0) {
// TODO Auto-generated method stub
}
@Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
Log.d("AdListener", "onFailedToReceiveAD");
}
@Override
public void onLeaveApplication(Ad arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPresentScreen(Ad arg0) {
// TODO Auto-generated method stub
}
@Override
public void onReceiveAd(Ad arg0) {
Log.d("AdListener", "Received succesfully");
}
}
最佳答案
我遇到了同样的问题
onFailedToReceiveAd( No ad to show).
由于某些原因,AdMob 似乎没有为我们的应用发送广告内容。即使我处于测试模式,仍然没有广告。
我在 AdMob 上制作了自家广告来验证我的申请。这是一种比测试模式更容易的开发方式。
关于java - Admob - 没有广告可显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5350933/
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 1年前关闭。 Improve thi
当我在 Admob 页面中创建插页式广告单元时,它要求输入 Interstitial timeout : Determine how long to display the interstitial
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 2年前关闭。 Improve thi
我的应用使用奖励视频广告,但在我看来,有时广告太长了。如何设置广告的时长限制? 最佳答案 这不是 AdMob 提供的功能。不过,感觉太长的广告通常会获得较少的点击次数,因此随着系统的调整,展示次数会越
我正在使用 admob 插页式广告,它通过 onCreate 加载 所以我可以使用它一次,但不能使用两次。我必须重新加载它然后使用它... 我想在显示后立即重新加载它,但似乎没有这样的回调监听器...
我有 admob 帐户,并且广告单元已成功放入我的应用程序中。 现在我想在我的应用程序中打印 admob 报告,就像用户 ABC 在这个应用程序中点击了“_”次赚取和应用程序的 RPM 我该怎么做,有
这可能是题外话,但请这对我们所有人都非常有帮助,他们从未知来源获得虚假点击,只是为了暂停我们的 admob 帐户。 最佳答案 对于 iOS 您应该使用 here 所述的委托(delegate)方法计算
Admob 几天前迁移到了较新的版本。他们成功转移了我的应用程序,但似乎我必须从 0,00 美元重新开始。我的旧 Admob 大约有 15 美元。我怎样才能把它转移到新的,否则它会丢失吗?支付限额为
我认为有人试图让我在 AdMob 中被禁止 - 在来自“未知”国家/地区的地理统计点击中,点击率达到 80%-90%(其他国家/地区 < 3%)。 如果用户来自“未知”国家/地区,是否有办法阻止展示广
我在展示来自 admob 的广告时在布局上遇到了一些问题。 应用刚启动时没有广告,一切正常。布局占据整个屏幕。然后当应用程序可以加载广告时(在顶部),整个布局将向下移动以显示广告。 如果有广告时整个布
是否可以在 Android 上以多种语言显示 GDPR 同意对话框? 我只能用一种语言发布一条消息。 在ump sdk中没有看到拟合方法。 我的意思是必须有办法做到这一点,如果没有,那么这个 sdk
我在 iOS 游戏中使用 AdMob,我最近更新了它以在我的 Info.plist 文件中包含 AdMob SKAdNetworkIdentifier(因为我的 AdMob 帐户中有警告要求这样做)。
这是我的代码: gAdView=[[GADBannerView alloc] initWithFrame:CGRectMake(0,self.view.bounds.size.height-GAD_S
Google 对使用 是否有限制或警告?奖励广告 限时? 因此,在我的应用程序中,如果我让我的用户按他/她想要的次数观看激励广告,将 谷歌 将其视为 无效流量这会导致帐户停用? 最佳答案 不,激励广告
我在 Google Play 上发布了一个游戏,我在上面放了 admob 广告。 由于无效的点击事件,我的 admob 帐户被禁用。 现在我创建了另一个帐户,将我的游戏链接到它。 我显示广告的代码是正
关于 AdSense 报告 API - GET/accounts/accountId/reports 它是仅检索 AdMob 数据(作为广告网络)还是也可以包括来自其他中介广告网络的数据? 最佳答案
我已经知道这个问题的答案,但我之所以这么问,是因为我花了几个小时才找到它,并且想让其他人轻松获得它。 自 2020 年 12 月 8 日起,Apple 已强制要求开发人员发布正在收集的数据以及这些数据
使用 AdWhirl 我得到了这些异常(exception)... 我无法从我这边发现错误...... 任何人都可以对此提出建议.. FATAL EXCEPTION: main E/AndroidRu
这就是我的 Admob 横幅的实现方式。 在 Layout.xml 中 在 AdActivity.java 中 private void initBannerViewGroup()
我想在同一事件中同时展示横幅广告和插页式广告。但我不确定这是否会违反 Google admob 政策,因为当显示插页式广告时,它会覆盖横幅广告。 谢谢。 最佳答案 这是允许的。事实上,建议您这样做以增
我是一名优秀的程序员,十分优秀!