本文整理汇总了Java中com.google.ads.Ad类的典型用法代码示例。如果您正苦于以下问题:Java Ad类的具体用法?Java Ad怎么用?Java Ad使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Ad类属于com.google.ads包,在下文中一共展示了Ad类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onReceiveAd(Ad arg0) {
if (interstitialAd.isReady()) {
interstitialAd.show();
Tools.updateInterstitialAdTime(this);
}
}
示例2: onReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onReceiveAd(Ad ad) {
if (ad == interstitial) {
Log.d("godot", "AdMob: onReceiveAd");
interstitial.show();
adReceived = true;
}
}
示例3: onReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onReceiveAd(Ad ad) {
if (ad == intertitial) {
intertitial.show();
}
webView.loadUrl("javascript:cordova.fireDocumentEvent('onReceiveAd');");
}
示例4: onFailedToReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onFailedToReceiveAd(Ad ad, AdRequest.ErrorCode errorCode) {
Log.v(TAG, "FAILED TO RECEIVE AD");
if(mViewToHide!=null) {
if(mContainer.getChildCount()>0) mContainer.removeAllViews();
this.mContainer.addView(mViewToHide);
}
}
示例5: onReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onReceiveAd(Ad ad) {
printToClog("onReceiveAd: " + ad);
if (mediatedAdViewController != null) {
mediatedAdViewController.onAdLoaded();
}
}
示例6: onFailedToReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onFailedToReceiveAd(Ad ad, AdRequest.ErrorCode errorCode) {
printToClog("onFailedToReceiveAd: " + ad + " error code: " + errorCode);
ResultCode code = ResultCode.INTERNAL_ERROR;
switch (errorCode) {
case INTERNAL_ERROR:
code = ResultCode.INTERNAL_ERROR;
break;
case INVALID_REQUEST:
code = ResultCode.INVALID_REQUEST;
break;
case NETWORK_ERROR:
code = ResultCode.NETWORK_ERROR;
break;
case NO_FILL:
code = ResultCode.UNABLE_TO_FILL;
break;
default:
break;
}
if (mediatedAdViewController != null) {
mediatedAdViewController.onAdFailed(code);
}
}
示例7: onPresentScreen
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onPresentScreen(Ad ad) {
printToClog("onPresentScreen: " + ad);
// interstitials get this callback when show is called, so ignore that
if ((mediatedAdViewController != null)
&& (mediatedAdViewController instanceof MediatedBannerAdViewController)) {
mediatedAdViewController.onAdExpanded();
}
}
示例8: onDismissScreen
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onDismissScreen(Ad ad) {
printToClog("onDismissScreen: " + ad);
// interstitials get this callback when the ad is closed, so ignore that
if ((mediatedAdViewController != null)
&& (mediatedAdViewController instanceof MediatedBannerAdViewController)) {
mediatedAdViewController.onAdCollapsed();
}
}
示例9: onLeaveApplication
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onLeaveApplication(Ad ad) {
printToClog("onLeaveApplication: " + ad);
if (mediatedAdViewController != null) {
mediatedAdViewController.onAdClicked();
}
}
示例10: onReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onReceiveAd(Ad ad) {
if (CallerFlashlight.LOG) Log.d("OK", "Received ad");
if (ad == interstitialAdMob) {
interstitialAdMob.show();
}
}
示例11: onFailedToReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
mCloseAdView.setVisibility(View.GONE);
mAdView.setVisibility(View.GONE);
}
示例12: onReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onReceiveAd(Ad arg0) {
mAdView.setVisibility(View.VISIBLE);
}
示例13: onFailedToReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
hideAdView();
}
示例14: onDismissScreen
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onDismissScreen(Ad arg0) {
Log.d("godot", "AdMob: onDismissScreen");
screenDismissed = true;
}
示例15: onFailedToReceiveAd
import com.google.ads.Ad; //导入依赖的package包/类
@Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
Log.w("godot", "AdMob: onFailedToReceiveAd-> " + arg1.toString());
failedToReceiveAd = true;
}