我曾经在我未来的应用上展示AdMob横幅广告,并且我想尝试一下插页式广告.
我检查了AdMob SDK的实现,我复制了他们的示例源,因为它正是我想要的(即活动启动时显示的插页式广告).
我在模拟器和我的Galaxy上尝试过,没有显示任何广告.
这是源代码:
public class Asscreed extends Activity {
private InterstitialAd interstitial;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_asscreed);
// Create the interstitial.
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId("ca-app-pub-6046034785851961/xxxxxx");
// Create ad request.
AdRequest adRequest = new AdRequest.Builder().build();
// Begin loading your interstitial.
interstitial.loadAd(adRequest);
}
// Invoke displayInterstitial() when you are ready to display an interstitial.
public void displayInterstitial() {
if (interstitial.isLoaded()) {
interstitial.show();
}
}
}
Run Code Online (Sandbox Code Playgroud)
导入正常,Google Play服务库当然是导入的.
我使用此示例: AdMob Android指南 - 非页内广告.
有人能告诉我我的代码有什么问题吗?
我和我的开发人员曾尝试在iPhone和iPad上加载插页式广告,但只是设法在iPad上运行.
在我们的测试中,我们发现iPhone上不支持插页式广告,但自iOS7发布以来,有些人现在说这是可能的.
但是,我找不到任何体面的文件.这个Stack问题让我再次想知道iPhone上的iAd和Admob插页式整合
那么,使用iAds的iPhone上是否可以使用全屏插页式广告?
我正在尝试为我的应用加载插页式广告。每当我尝试加载这些广告时,都会收到来自域“com.google.android.gms.ads”的“无广告配置”错误消息。
这是代码:
我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ayush.torch">
<application
android:allowBackup="true"
android:icon="@drawable/ic_ico"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".main">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="i_have_put_my_app_id_here"/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
</manifest>
Run Code Online (Sandbox Code Playgroud)
main.java 中的onCreate()
// Creating the InterstitialAd and setting the adUnitId.
interstitialAd = new InterstitialAd(this);
interstitialAd.setAdUnitId("i have also put my interstitial ad id here");
interstitialAd.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
Toast.makeText(main.this, "Ad Loaded", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdFailedToLoad(LoadAdError …
Run Code Online (Sandbox Code Playgroud) 我在日志中收到上述消息,因此,我认为我没有尽可能多的插页式广告.我已经使用以下行更新了我的清单
<activity android:name="com.millennialmedia.android.MMActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="keyboardHidden|orientation|keyboard" />
Run Code Online (Sandbox Code Playgroud)
但我仍然得到这个错误.显然,我需要做一些其他工作来实现这个目标.
有任何想法吗?
从我的Admob,我已经设置了Flurry和Vungle的调解.当我请求广告时,我总是收到Logcat中提供的错误.
Could not instantiate mediation adapter: com.google.ads.mediation.flurry.FlurryAdapter.
MediationAdapter is not a MediationRewardedVideoAdAdapter: com.vungle.mediation.VungleInterstitialAdapter
Run Code Online (Sandbox Code Playgroud)
dependencies {
compile files('libs/FlurryAnalytics-6.2.0.jar')
compile files('libs/FlurryAds-6.2.0.jar')
compile files('libs/flurryAndroidDFPandAdMobMediationAdapter-5.0.0.r1.jar')
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/vungle-publisher-adaptive-id-3.3.4.jar')
compile files('libs/VungleAdapter.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services-ads:8.3.+'
compile 'com.google.android.gms:play-services-analytics:8.3.+'
compile 'com.google.android.gms:play-services-appindexing:8.3.+'
compile 'com.google.android.gms:play-services-appinvite:8.3.+'
compile 'com.google.android.gms:play-services-games:8.3.+'
compile 'com.google.android.gms:play-services-identity:8.3.+'
compile 'com.google.android.gms:play-services-plus:8.3.+'
compile project(':BaseGameUtils')
compile project(':facebook-android-sdk-4.8.1')
compile files('libs/AudienceNetwork.jar')
compile files('libs/FacebookAdapter.jar')
}
Run Code Online (Sandbox Code Playgroud)
我已在Admob中设置adunit,Adtype为非页内广告,如下所示
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
@Override
protected void onPause() {
super.onPause();
if(rewardedVideoAd!= null)
rewardedVideoAd.pause();
socialShareType=null; …
Run Code Online (Sandbox Code Playgroud) 我想确保Android上使用Android AdMob SDK的插页式广告可以关闭.经过一些研究,在我看来,由于广告是一项单独的活动,这是不可能的.我想要做的是在5秒后关闭广告.有人可以向我保证,关闭插页式广告是不可能的,或者是否存在黑客攻击?
我正在使用AdMob将插页式广告添加到我的Android应用中.我想知道是否有办法阻止用户通过按"后退"按钮关闭它们(所以他们必须按下广告上的"x"按钮).
我知道AdMob正在加载其他活动中的广告,因此我无法使用我的活动的onKeyDown()来执行此操作.
此外,我不确定它是否被认为是一种好的做法,如果它值得做的话.
更新:
似乎没有简单的方法来覆盖广告活动中的后退按钮(因为我无法访问该活动).因此,我会放弃它.
但是,我仍然没有发现任何证据表明它违反了admob或android政策.在大多数Android游戏中,后退按钮被覆盖以打开和关闭暂停模式(而不是进一步返回并最终退出)并且每个人似乎都可以使用它.因此,我仍然愿意听到实际知道答案的人们对这方面的看法.
PS:对于那些说阻止后退按钮是如此可怕的人:我同意这会让用户感到烦恼,但插页式广告的想法一开始就非常烦人.尽管如此,它是目前最常用的广告类型(猜测为什么 - 它只是更有利可图).
现在,大多数情况下,如果您使用后退按钮,您甚至可以在广告加载到屏幕之前关闭广告(我说的是加载布局,而不是从广告提供商处加载数据).但是,广告的整个想法是向人们展示.因此,我认为允许用户仅在广告完全加载到屏幕之后才关闭广告是合理的,而不是在此之前.那些说不然的人(但同时没有任何反对插页式广告概念的东西)是虚伪的.
当我显示Interstital Ad状态栏消失并且导航栏向上移动时.导航栏下的所有内容都会向上移动.当我关闭广告时,一切都向下移动.它看起来很奇怪和毛病.
我在故事板中使用带有Show Navigation Bar
属性的导航控制器.
用于在AppDelegate.m
文件中显示Interstital Ad的代码:
[self.interstitialAd presentFromRootViewController:self.window.rootViewController];
Run Code Online (Sandbox Code Playgroud)
基本上,当我提出Interstital Ad时,我需要一切都能保持原状而不会移动.
我的应用程序中有3种广告类型。展示次数最高的奖励广告,但不知何故,横幅广告的收入也要比奖励广告高。奖励广告的展示次数是非页内广告但收入不变的三倍。
在最初的几周内,没有这样的事情,然后收入突然下降。
如果某人以前有问题并且知道为什么,可以帮助我吗?我怀疑自己制作的奖励广告过多,但找不到任何文档
感谢您的任何建议或帮助
android interstitial admob adbannerview admob-rewardedvideoad
在 google play 控制台中 - 我不断收到由谷歌插页式广告引起的 ANR。应用程序可能会冻结 0.5 秒或更长时间。
意图广播 { act=android.intent.action.SCREEN_ON flg=0x50200010 }, InvisibleToUser
我应该在某处使用线程吗?这是我用来初始化广告的代码:
'''
mAdView = findViewById(R.id.ad_view);
MobileAds.initialize(this, "ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxx");
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub-123123123123461/1231236530");
mInterstitialAd.setAdListener(new AdListener()
{
@Override
public void onAdLoaded()
{
//log interstitial loaded
}
@Override
public void onAdFailedToLoad(int errorCode)
{
}
@Override
public void onAdClosed()
{
//reload interstitial
AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
// Ad interstitialAd reLoaded
}
});
mInterstitialAd.loadAd(new AdRequest.Builder().build());
}
'''
Run Code Online (Sandbox Code Playgroud)
这是在google play控制台提交的堆栈
"main" tid=1 Runnable …
Run Code Online (Sandbox Code Playgroud) interstitial ×10
admob ×8
android ×7
ads ×3
adbannerview ×1
flurry ×1
iad ×1
ios ×1
ipad ×1
iphone ×1
manifest ×1
mopub ×1
uiview ×1
vungle-ads ×1