com.applovin.sdk.AppLovinErrorCodes Java Examples

The following examples show how to use com.applovin.sdk.AppLovinErrorCodes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AppLovinCustomEventBanner.java    From SDK-Network-Adapters with MIT License 6 votes vote down vote up
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;
    }
}
 
Example #2
Source File: AppLovinCustomEventRewardedVideo.java    From SDK-Network-Adapters with MIT License 6 votes vote down vote up
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;
    }
}
 
Example #3
Source File: AppLovinCustomEventInterstitial.java    From SDK-Network-Adapters with MIT License 6 votes vote down vote up
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;
    }
}
 
Example #4
Source File: AppLovinCustomEventNative.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
private static NativeErrorCode toMoPubErrorCode(final int applovinErrorCode) {
  if (applovinErrorCode == AppLovinErrorCodes.NO_FILL) {
    return NativeErrorCode.NETWORK_NO_FILL;
  } else if (applovinErrorCode == AppLovinErrorCodes.UNSPECIFIED_ERROR) {
    return NativeErrorCode.NETWORK_INVALID_STATE;
  } else if (applovinErrorCode == AppLovinErrorCodes.NO_NETWORK) {
    return NativeErrorCode.CONNECTION_ERROR;
  } else if (applovinErrorCode == AppLovinErrorCodes.FETCH_AD_TIMEOUT) {
    return NativeErrorCode.NETWORK_TIMEOUT;
  } else if (applovinErrorCode == AppLovinErrorCodes.UNABLE_TO_PREPARE_NATIVE_AD) {
    return NativeErrorCode.INVALID_RESPONSE;
  } else {
    return NativeErrorCode.UNSPECIFIED;
  }
}
 
Example #5
Source File: NativeAdCarouselUIActivity.java    From Android-SDK-Demo with MIT License 5 votes vote down vote up
public void loadNativeAds(final int numAdsToLoad)
{
    final AppLovinSdk sdk = AppLovinSdk.getInstance( getApplicationContext() );
    sdk.getNativeAdService().loadNativeAds( numAdsToLoad, new AppLovinNativeAdLoadListener()
    {
        @Override
        public void onNativeAdsLoaded(final List list)
        {
            // Native ads loaded; do something with this, e.g. render into your custom view.

            runOnUiThread( new Runnable()
            {
                @Override
                public void run()
                {
                    log( "Native ad loaded, assets not retrieved yet." );

                    nativeAd = (AppLovinNativeAd) list.get( 0 );
                    precacheButton.setEnabled( true );
                }
            } );
        }

        @Override
        public void onNativeAdsFailedToLoad(final int errorCode)
        {
            // Native ads failed to load for some reason, likely a network error.
            // Compare errorCode to the available constants in AppLovinErrorCodes.

            log( "Native ad failed to load with error code " + errorCode );

            if ( errorCode == AppLovinErrorCodes.NO_FILL )
            {
                // No ad was available for this placement
            }
            // else if (errorCode == .... ) { ... }
        }
    } );
}
 
Example #6
Source File: AppLovinUtils.java    From googleads-mobile-android-mediation with Apache License 2.0 5 votes vote down vote up
/** Convert the given AppLovin SDK error code into the appropriate AdMob error code. */
public static int toAdMobErrorCode(int applovinErrorCode) {
  //
  // TODO: Be more exhaustive
  //
  if (applovinErrorCode == AppLovinErrorCodes.NO_FILL) {
    return AdRequest.ERROR_CODE_NO_FILL;
  } else if (applovinErrorCode == AppLovinErrorCodes.FETCH_AD_TIMEOUT) {
    return AdRequest.ERROR_CODE_NETWORK_ERROR;
  } else {
    return AdRequest.ERROR_CODE_INTERNAL_ERROR;
  }
}
 
Example #7
Source File: AppLovinCustomEventNative.java    From SDK-Network-Adapters with MIT License 5 votes vote down vote up
private static NativeErrorCode toMoPubErrorCode(final int applovinErrorCode)
{
    if ( applovinErrorCode == AppLovinErrorCodes.NO_FILL )
    {
        return NativeErrorCode.NETWORK_NO_FILL;
    }
    else if ( applovinErrorCode == AppLovinErrorCodes.UNSPECIFIED_ERROR )
    {
        return NativeErrorCode.NETWORK_INVALID_STATE;
    }
    else if ( applovinErrorCode == AppLovinErrorCodes.NO_NETWORK )
    {
        return NativeErrorCode.CONNECTION_ERROR;
    }
    else if ( applovinErrorCode == AppLovinErrorCodes.FETCH_AD_TIMEOUT )
    {
        return NativeErrorCode.NETWORK_TIMEOUT;
    }
    else if ( applovinErrorCode == AppLovinErrorCodes.UNABLE_TO_PREPARE_NATIVE_AD )
    {
        return NativeErrorCode.INVALID_RESPONSE;
    }
    else
    {
        return NativeErrorCode.UNSPECIFIED;
    }
}
 
Example #8
Source File: AppLovinCustomEventBanner.java    From SDK-Network-Adapters with MIT License 5 votes vote down vote up
private static int toAdMobErrorCode(final int applovinErrorCode)
{
    if ( applovinErrorCode == AppLovinErrorCodes.NO_FILL )
    {
        return AdRequest.ERROR_CODE_NO_FILL;
    }
    else if ( applovinErrorCode == AppLovinErrorCodes.NO_NETWORK || applovinErrorCode == AppLovinErrorCodes.FETCH_AD_TIMEOUT )
    {
        return AdRequest.ERROR_CODE_NETWORK_ERROR;
    }
    else
    {
        return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    }
}
 
Example #9
Source File: ApplovinAdapter.java    From SDK-Network-Adapters with MIT License 5 votes vote down vote up
private static int toAdMobErrorCode(final int applovinErrorCode)
{
    if ( applovinErrorCode == AppLovinErrorCodes.NO_FILL )
    {
        return AdRequest.ERROR_CODE_NO_FILL;
    }
    else if ( applovinErrorCode == AppLovinErrorCodes.NO_NETWORK || applovinErrorCode == AppLovinErrorCodes.FETCH_AD_TIMEOUT )
    {
        return AdRequest.ERROR_CODE_NETWORK_ERROR;
    }
    else
    {
        return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    }
}
 
Example #10
Source File: AppLovinCustomEventInterstitial.java    From SDK-Network-Adapters with MIT License 5 votes vote down vote up
private static int toAdMobErrorCode(final int applovinErrorCode)
{
    if ( applovinErrorCode == AppLovinErrorCodes.NO_FILL )
    {
        return AdRequest.ERROR_CODE_NO_FILL;
    }
    else if ( applovinErrorCode == AppLovinErrorCodes.NO_NETWORK || applovinErrorCode == AppLovinErrorCodes.FETCH_AD_TIMEOUT )
    {
        return AdRequest.ERROR_CODE_NETWORK_ERROR;
    }
    else
    {
        return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    }
}