【发布时间】:2018-08-27 15:21:11
【问题描述】:
我正在编辑现有 android 应用程序(不是游戏)的代码。我想在经过一定数量的屏幕或操作后展示插页式广告(尊重 Google 指导)。
这是我通常加载插页式广告的方式:
// Prepare the Interstitial Ad
interstitial = new InterstitialAd(News_Detail.this);
// Insert the Ad Unit ID
interstitial.setAdUnitId(getString(R.string.admob_interstitial_id));
AdRequest adRequest = new AdRequest.Builder().build();
// Load ads into Interstitial Ads
interstitial.loadAd(adRequest);
// Prepare an Interstitial Ad Listener
interstitial.setAdListener(new AdListener() {
public void onAdLoaded() {
// Call displayInterstitial() function
displayInterstitial();
}
});
public void displayInterstitial() {
// If Ads are loaded, show Interstitial else show nothing.
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//Your code to show add
if (interstitial.isLoaded()) {
interstitial.show();
}
}
}, 20000);
}
【问题讨论】:
-
我有一个测验应用程序。如果我在每 X 个问题(例如 15 个问题)之后展示一个插页式广告,Google 可以接受吗?