本文整理汇总了Java中com.mopub.mobileads.MoPubErrorCode类的典型用法代码示例。如果您正苦于以下问题:Java MoPubErrorCode类的具体用法?Java MoPubErrorCode怎么用?Java MoPubErrorCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MoPubErrorCode类属于com.mopub.mobileads包,在下文中一共展示了MoPubErrorCode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onError
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onError(ErrorMessage errorMessage) {
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.NETWORK_NO_FILL);
switch (errorMessage) {
case GENERIC:
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.UNSPECIFIED);
break;
case NOADS:
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.VIDEO_NOT_AVAILABLE);
break;
case RESOURCES_DOWNLOAD_FAIL:
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.NETWORK_INVALID_STATE);
break;
case NOTVISIBLE:
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.NETWORK_NO_FILL);
break;
default:
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.NETWORK_INVALID_STATE);
}
}
开发者ID:VMFive,项目名称:android-sdk-3.0,代码行数:21,代码来源:VM5Reward.java
示例2: onError
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onError(ErrorMessage errorMessage) {
Log.w(TAG, "onError : " + errorMessage);
switch (errorMessage) {
case GENERIC:
mInterstitialListener.onInterstitialFailed(MoPubErrorCode.UNSPECIFIED);
break;
case NOADS:
mInterstitialListener.onInterstitialFailed(MoPubErrorCode.VIDEO_NOT_AVAILABLE);
break;
case RESOURCES_DOWNLOAD_FAIL:
mInterstitialListener.onInterstitialFailed(MoPubErrorCode.NETWORK_INVALID_STATE);
break;
case NOTVISIBLE:
mInterstitialListener.onInterstitialFailed(MoPubErrorCode.NETWORK_NO_FILL);
break;
default:
mInterstitialListener.onInterstitialFailed(MoPubErrorCode.NETWORK_INVALID_STATE);
}
}
开发者ID:VMFive,项目名称:android-sdk-3.0,代码行数:21,代码来源:VM5Interstitial.java
示例3: onError
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onError(ErrorMessage errorMessage) {
Log.w(TAG, "onError : " + errorMessage);
switch (errorMessage) {
case GENERIC:
mBannerListener.onBannerFailed(MoPubErrorCode.UNSPECIFIED);
break;
case NOADS:
mBannerListener.onBannerFailed(MoPubErrorCode.VIDEO_NOT_AVAILABLE);
break;
case RESOURCES_DOWNLOAD_FAIL:
mBannerListener.onBannerFailed(MoPubErrorCode.NETWORK_INVALID_STATE);
break;
case NOTVISIBLE:
mBannerListener.onBannerFailed(MoPubErrorCode.NETWORK_NO_FILL);
break;
default:
mBannerListener.onBannerFailed(MoPubErrorCode.NETWORK_INVALID_STATE);
}
}
开发者ID:VMFive,项目名称:android-sdk-3.0,代码行数:21,代码来源:VM5Banner.java
示例4: onBannerFailed
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView moPubView,
MoPubErrorCode moPubErrorCode) {
switch (moPubErrorCode) {
case NO_FILL:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_NO_FILL);
break;
case NETWORK_TIMEOUT:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_NETWORK_ERROR);
break;
case SERVER_ERROR:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_INVALID_REQUEST);
break;
default:
mMediationBannerListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_INTERNAL_ERROR);
break;
}
}
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:23,代码来源:MoPubAdapter.java
示例5: onInterstitialFailed
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onInterstitialFailed(MoPubInterstitial moPubInterstitial,
MoPubErrorCode moPubErrorCode) {
switch (moPubErrorCode) {
case NO_FILL:
mMediationInterstitialListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest.ERROR_CODE_NO_FILL);
break;
case NETWORK_TIMEOUT:
mMediationInterstitialListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest
.ERROR_CODE_NETWORK_ERROR);
break;
case SERVER_ERROR:
mMediationInterstitialListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest
.ERROR_CODE_INVALID_REQUEST);
break;
default:
mMediationInterstitialListener.onAdFailedToLoad(MoPubAdapter.this,
AdRequest
.ERROR_CODE_INTERNAL_ERROR);
break;
}
}
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:27,代码来源:MoPubAdapter.java
示例6: loadPositions_withNoConnection_shouldLogMoPubErrorCodeNoConnection_shouldCallFailureHandler
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Test
public void loadPositions_withNoConnection_shouldLogMoPubErrorCodeNoConnection_shouldCallFailureHandler() {
MoPubLog.setSdkHandlerLevel(Level.ALL);
when(mockContext.checkCallingOrSelfPermission(anyString()))
.thenReturn(PackageManager.PERMISSION_DENIED);
when(spyActivity.getApplicationContext()).thenReturn(mockContext);
// Reinit the subject so we get our mocked context.
subject = new ServerPositioningSource(spyActivity);
// Simulate failure after max time.
subject.setMaximumRetryTimeMilliseconds(999);
subject.loadPositions("test_ad_unit", mockPositioningListener);
verify(mockRequestQueue).add(positionRequestCaptor.capture());
positionRequestCaptor.getValue().deliverError(new NoConnectionError());
verify(mockPositioningListener).onFailed();
final List<ShadowLog.LogItem> allLogMessages = ShadowLog.getLogs();
final ShadowLog.LogItem latestLogMessage = allLogMessages.get(allLogMessages.size() - 2);
// All log messages end with a newline character.
assertThat(latestLogMessage.msg.trim()).isEqualTo(MoPubErrorCode.NO_CONNECTION.toString());
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:25,代码来源:ServerPositioningSourceTest.java
示例7: loadInterstitial
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
protected void loadInterstitial(Context context, CustomEventInterstitialListener customEventInterstitialListener, Map<String, Object> localExtras, Map<String, String> serverExtras) {
Clog.d(Clog.mediationLogTag, "Initializing ANInterstitial via MoPub SDK");
listener = customEventInterstitialListener;
String placementID;
if (extrasAreValid(serverExtras)) {
placementID = serverExtras.get(PLACEMENTID_KEY);
Clog.d(Clog.mediationLogTag, String.format("Server extras were valid: placementID: %s", placementID));
} else {
listener.onInterstitialFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
Clog.e(Clog.mediationLogTag, "Failed to parse server extras. Check setup of placement in MoPub.");
return;
}
iad = new InterstitialAdView(context);
iad.setPlacementID(placementID);
iad.setShouldServePSAs(false);
iad.setAdListener(this);
Clog.d(Clog.mediationLogTag, "Fetch ANInterstitial");
iad.loadAd();
}
开发者ID:appnexus,项目名称:mobile-sdk-android,代码行数:23,代码来源:MoPubMediationInterstitial.java
示例8: toMoPubErrorCode
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
private static MoPubErrorCode toMoPubErrorCode(final int applovinErrorCode)
{
if ( applovinErrorCode == AppLovinErrorCodes.NO_FILL )
{
return MoPubErrorCode.NETWORK_NO_FILL;
}
else if ( applovinErrorCode == AppLovinErrorCodes.UNSPECIFIED_ERROR )
{
return MoPubErrorCode.NETWORK_INVALID_STATE;
}
else if ( applovinErrorCode == AppLovinErrorCodes.NO_NETWORK )
{
return MoPubErrorCode.NO_CONNECTION;
}
else if ( applovinErrorCode == AppLovinErrorCodes.FETCH_AD_TIMEOUT )
{
return MoPubErrorCode.NETWORK_TIMEOUT;
}
else
{
return MoPubErrorCode.UNSPECIFIED;
}
}
开发者ID:AppLovin,项目名称:SDK-Network-Adaptors,代码行数:24,代码来源:AppLovinCustomEventBanner.java
示例9: showVideo
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
protected void showVideo()
{
if ( hasVideoAvailable() )
{
fullyWatched = false;
reward = null;
incentivizedInterstitial.show( parentActivity, null, this, this, this, this );
}
else
{
log( ERROR, "Failed to show an AppLovin rewarded video before one was loaded" );
MoPubRewardedVideoManager.onRewardedVideoPlaybackError( this.getClass(), "", MoPubErrorCode.VIDEO_PLAYBACK_ERROR );
}
}
开发者ID:AppLovin,项目名称:SDK-Network-Adaptors,代码行数:17,代码来源:AppLovinCustomEventRewardedVideo.java
示例10: showInterstitial
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void showInterstitial()
{
final AppLovinAd preloadedAd = dequeueAd( zoneId );
if ( preloadedAd != null )
{
final AppLovinSdk sdk = AppLovinSdk.getInstance( context );
final AppLovinInterstitialAdDialog interstitialAd = createInterstitial( context, sdk );
interstitialAd.setAdDisplayListener( this );
interstitialAd.setAdClickListener( this );
interstitialAd.setAdVideoPlaybackListener( this );
interstitialAd.showAndRender( preloadedAd );
}
else
{
log( ERROR, "Failed to show an AppLovin interstitial before one was loaded" );
listener.onInterstitialFailed( MoPubErrorCode.NETWORK_INVALID_STATE );
}
}
开发者ID:AppLovin,项目名称:SDK-Network-Adaptors,代码行数:21,代码来源:AppLovinCustomEventInterstitial.java
示例11: onBannerFailed
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView banner, MoPubErrorCode errorCode) {
WritableMap event = Arguments.createMap();
event.putString("message", errorCode.toString());
ReactContext reactContext = (ReactContext) getContext();
reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(this.getId(), EVENT_FAILED, event);
}
开发者ID:doomsower,项目名称:react-native-mopub,代码行数:8,代码来源:RNMoPubBanner.java
示例12: checkAndInitializeSdk
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
protected boolean checkAndInitializeSdk(@NonNull Activity launcherActivity, @NonNull Map<String, Object> localExtras, @NonNull Map<String, String> serverExtras) throws Exception {
String apiKey = "";
if (serverExtras.containsKey("apiKey")) {
apiKey = serverExtras.get("apiKey");
} else {
Log.e(TAG, "User should specify apiKey in serverExtras");
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
return false;
}
String placementName = "";
if (serverExtras.containsKey("placement")) {
placementName = serverExtras.get("placement");
} else {
Log.e(TAG, "User should specify placement in serverExtras");
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
return false;
}
boolean isTestMode = true;
if (serverExtras.containsKey("test")) {
isTestMode = serverExtras.get("test").equals("1");
} else {
Log.e(TAG, "User should specify test in serverExtras");
MoPubRewardedVideoManager.onRewardedVideoLoadFailure(VM5Reward.class, VM5_AD_NETWORK_CONSTANT, MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
return false;
}
return true;
}
开发者ID:VMFive,项目名称:android-sdk-3.0,代码行数:31,代码来源:VM5Reward.java
示例13: loadBanner
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
protected void loadBanner(Context context, CustomEventBannerListener customEventBannerListener, Map<String, Object> localExtras, Map<String, String> serverExtras) {
mBannerListener = customEventBannerListener;
Log.d(TAG, "Request Banner Ad");
String apiKey = "";
if (serverExtras.containsKey("apiKey")) {
apiKey = serverExtras.get("apiKey");
} else {
Log.e(TAG, "User should specify apiKey in serverExtras");
mBannerListener.onBannerFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
return;
}
String placementName = "";
if (serverExtras.containsKey("placement")) {
placementName = serverExtras.get("placement");
} else {
Log.e(TAG, "User should specify placement in serverExtras");
mBannerListener.onBannerFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
return;
}
boolean isTestMode = true;
if (serverExtras.containsKey("test")) {
isTestMode = serverExtras.get("test").equals("1");
} else {
Log.e(TAG, "User should specify test in serverExtras");
mBannerListener.onBannerFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
return;
}
mAdView = new AdView((Activity)context, apiKey, placementName, AdViewType.BANNER_VIDEO);
mAdView.setTestMode(isTestMode);
mAdView.setAdListener(this);
mAdView.loadAd();
}
开发者ID:VMFive,项目名称:android-sdk-3.0,代码行数:39,代码来源:VM5Banner.java
示例14: ServerPositioningSource
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
ServerPositioningSource(@NonNull final Context context) {
mContext = context.getApplicationContext();
mRetryHandler = new Handler();
mRetryRunnable = new Runnable() {
@Override
public void run() {
requestPositioningInternal();
}
};
mPositioningListener = new Response.Listener<MoPubClientPositioning>() {
@Override
public void onResponse(final MoPubClientPositioning clientPositioning) {
handleSuccess(clientPositioning);
}
};
mErrorListener = new Response.ErrorListener() {
@Override
public void onErrorResponse(final VolleyError error) {
// Don't log a stack trace when we're just warming up.
if (!(error instanceof MoPubNetworkError) ||
((MoPubNetworkError) error).getReason().equals(MoPubNetworkError.Reason.WARMING_UP)) {
MoPubLog.e("Failed to load positioning data", error);
if (error.networkResponse == null && !DeviceUtils.isNetworkAvailable(mContext)) {
MoPubLog.c(String.valueOf(MoPubErrorCode.NO_CONNECTION.toString()));
}
}
handleFailure();
}
};
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:35,代码来源:ServerPositioningSource.java
示例15: onAdError
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@VisibleForTesting
void onAdError(@NonNull final VolleyError volleyError) {
MoPubLog.d("Native ad request failed.", volleyError);
if (volleyError instanceof MoPubNetworkError) {
MoPubNetworkError error = (MoPubNetworkError) volleyError;
switch (error.getReason()) {
case BAD_BODY:
mMoPubNativeNetworkListener.onNativeFail(INVALID_JSON);
return;
case BAD_HEADER_DATA:
mMoPubNativeNetworkListener.onNativeFail(INVALID_JSON);
return;
case WARMING_UP:
// Used for the sample app to signal a toast.
// This is not customer-facing except in the sample app.
MoPubLog.c(MoPubErrorCode.WARMUP.toString());
mMoPubNativeNetworkListener.onNativeFail(EMPTY_AD_RESPONSE);
return;
case NO_FILL:
mMoPubNativeNetworkListener.onNativeFail(EMPTY_AD_RESPONSE);
return;
case UNSPECIFIED:
default:
mMoPubNativeNetworkListener.onNativeFail(UNSPECIFIED);
return;
}
} else {
// Process our other status code errors.
NetworkResponse response = volleyError.networkResponse;
if (response != null && response.statusCode >= 500 && response.statusCode < 600) {
mMoPubNativeNetworkListener.onNativeFail(SERVER_ERROR_RESPONSE_CODE);
} else if (response == null && !DeviceUtils.isNetworkAvailable(mContext.get())) {
MoPubLog.c(String.valueOf(MoPubErrorCode.NO_CONNECTION.toString()));
mMoPubNativeNetworkListener.onNativeFail(CONNECTION_ERROR);
} else {
mMoPubNativeNetworkListener.onNativeFail(UNSPECIFIED);
}
}
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:40,代码来源:MoPubNative.java
示例16: onAdError_withVolleyErrorWarmingUp_shouldLogMoPubErrorCodeWarmup_shouldNotifyListener
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Test
public void onAdError_withVolleyErrorWarmingUp_shouldLogMoPubErrorCodeWarmup_shouldNotifyListener() {
MoPubLog.setSdkHandlerLevel(Level.ALL);
subject.onAdError(new MoPubNetworkError(MoPubNetworkError.Reason.WARMING_UP));
final List<ShadowLog.LogItem> allLogMessages = ShadowLog.getLogs();
final ShadowLog.LogItem latestLogMessage = allLogMessages.get(allLogMessages.size() - 1);
// All log messages end with a newline character.
assertThat(latestLogMessage.msg.trim()).isEqualTo(MoPubErrorCode.WARMUP.toString());
verify(mockNetworkListener).onNativeFail(eq(NativeErrorCode.EMPTY_AD_RESPONSE));
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:14,代码来源:MoPubNativeTest.java
示例17: onAdError_withNoConnection_shouldLogMoPubErrorCodeNoConnection_shouldNotifyListener
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Test
public void onAdError_withNoConnection_shouldLogMoPubErrorCodeNoConnection_shouldNotifyListener() {
MoPubLog.setSdkHandlerLevel(Level.ALL);
shadowOf(context).denyPermissions(INTERNET);
subject.onAdError(new NoConnectionError());
final List<ShadowLog.LogItem> allLogMessages = ShadowLog.getLogs();
final ShadowLog.LogItem latestLogMessage = allLogMessages.get(allLogMessages.size() - 1);
// All log messages end with a newline character.
assertThat(latestLogMessage.msg.trim()).isEqualTo(MoPubErrorCode.NO_CONNECTION.toString());
verify(mockNetworkListener).onNativeFail(eq(NativeErrorCode.CONNECTION_ERROR));
}
开发者ID:JSafaiyeh,项目名称:Fabric-Example-App-Android,代码行数:15,代码来源:MoPubNativeTest.java
示例18: onBannerFailed
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView arg0, MoPubErrorCode arg1) {
homeBrewAd = new ImageView(context);
homeBrewAd.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.nlv_adbanner));
homeBrewAd.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.allgoodpeopleus.NormalLabValues"));
v.getContext().startActivity(intent);
}
});
addView(homeBrewAd);
}
开发者ID:bbhsu2,项目名称:evolution,代码行数:15,代码来源:AdView.java
示例19: loadBanner
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
protected void loadBanner(Context context, CustomEventBannerListener customEventBannerListener, Map<String, Object> localExtras, Map<String, String> serverExtras) {
Clog.d(Clog.mediationLogTag, "Initializing ANBanner via MoPub SDK");
this.listener = customEventBannerListener;
String placementID;
int width;
int height;
if (extrasAreValid(serverExtras)) {
placementID = serverExtras.get(PLACEMENTID_KEY);
width = Integer.parseInt(serverExtras.get(AD_WIDTH_KEY));
height = Integer.parseInt(serverExtras.get(AD_HEIGHT_KEY));
Clog.d(Clog.mediationLogTag, String.format("Server extras were valid: placementID: %s, width: %s, height: %s", placementID, width, height));
} else {
listener.onBannerFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
Clog.e(Clog.mediationLogTag, "Failed to parse server extras. Check setup of placement in MoPub.");
return;
}
bav = new BannerAdView(context);
bav.setPlacementID(placementID);
bav.setAdSize(width, height);
bav.setShouldServePSAs(false);
bav.setAdListener(this);
Clog.d(Clog.mediationLogTag, "Load ANBanner");
bav.loadAdOffscreen();
}
开发者ID:appnexus,项目名称:mobile-sdk-android,代码行数:30,代码来源:MoPubMediationBanner.java
示例20: onBannerFailed
import com.mopub.mobileads.MoPubErrorCode; //导入依赖的package包/类
@Override
public void onBannerFailed(MoPubView banner, MoPubErrorCode errorCode) {
}
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:4,代码来源:MoPubBannerFragment.java
注:本文中的com.mopub.mobileads.MoPubErrorCode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论