java.lang.NoSuchMethodException#com.google.android.gms.ads.AdRequest源码实例Demo

下面列出了java.lang.NoSuchMethodException#com.google.android.gms.ads.AdRequest 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
public void onAdFetchFailed(SampleErrorCode errorCode) {
  switch (errorCode) {
    case UNKNOWN:
      interstitialListener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR);
      break;
    case BAD_REQUEST:
      interstitialListener.onAdFailedToLoad(AdRequest.ERROR_CODE_INVALID_REQUEST);
      break;
    case NETWORK_ERROR:
      interstitialListener.onAdFailedToLoad(AdRequest.ERROR_CODE_NETWORK_ERROR);
      break;
    case NO_INVENTORY:
      interstitialListener.onAdFailedToLoad(AdRequest.ERROR_CODE_NO_FILL);
      break;
  }
}
 
@NonNull
public static String getErrorReason(@IntRange(from = AdRequest.ERROR_CODE_INTERNAL_ERROR,
        to = AdRequest.ERROR_CODE_NO_FILL) int errorCode) {
    switch (errorCode) {
        default:
        case AdRequest.ERROR_CODE_INTERNAL_ERROR:
            return "Internal Error";

        case AdRequest.ERROR_CODE_INVALID_REQUEST:
            return "Invalid Request";

        case AdRequest.ERROR_CODE_NETWORK_ERROR:
            return "Network Error";

        case AdRequest.ERROR_CODE_NO_FILL:
            return "No Fill";
    }
}
 
@Override
public void requestAd(MediatedInterstitialAdViewController mIC, Activity activity,
                      String parameter, String adUnitId, TargetingParameters targetingParameters) {
    adListener = new GooglePlayAdListener(mIC, super.getClass().getSimpleName());
    adListener.printToClog(String.format(" - requesting an ad: [%s, %s]", parameter, adUnitId));

    interstitialAd = new InterstitialAd(activity);
    interstitialAd.setAdUnitId(adUnitId);
    interstitialAd.setAdListener(adListener);

    try {
        interstitialAd.loadAd(buildRequest(targetingParameters));
    } catch (NoClassDefFoundError e) {
        // This can be thrown by Play Services on Honeycomb.
        adListener.onAdFailedToLoad(AdRequest.ERROR_CODE_NO_FILL);
    }
}
 
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_interstitial_ad);

    mInterstitialAd = new InterstitialAd(this);

    // set the ad unit ID
    mInterstitialAd.setAdUnitId("ca-app-pub-7814549536543810/9305872827");

    AdRequest adRequest = new AdRequest.Builder()
            .build();

    // Load ads into Interstitial Ads
    mInterstitialAd.loadAd(adRequest);

    mInterstitialAd.setAdListener(new AdListener() {
        public void onAdLoaded() {
            showInterstitial();
        }
    });
}
 
/**
 * Converts a {@link com.inmobi.ads.InMobiAdRequestStatus.StatusCode} to Google Mobile Ads SDK
 * readable error code.
 *
 * @param statusCode the {@link com.inmobi.ads.InMobiAdRequestStatus.StatusCode} to be converted.
 * @return an {@link AdRequest} error code.
 */
private static int getAdRequestErrorCode(InMobiAdRequestStatus.StatusCode statusCode) {
  switch (statusCode) {
    case INTERNAL_ERROR:
      return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    case AD_ACTIVE:
    case REQUEST_INVALID:
    case REQUEST_PENDING:
    case EARLY_REFRESH_REQUEST:
    case MISSING_REQUIRED_DEPENDENCIES:
      return AdRequest.ERROR_CODE_INVALID_REQUEST;
    case REQUEST_TIMED_OUT:
    case NETWORK_UNREACHABLE:
      return AdRequest.ERROR_CODE_NETWORK_ERROR;
    case NO_FILL:
    case SERVER_ERROR:
    case AD_NO_LONGER_AVAILABLE:
    case NO_ERROR:
    default:
      return AdRequest.ERROR_CODE_NO_FILL;
  }
}
 
/**
 * Convert i-mobile fail reason to AdMob error code.
 *
 * @param reason i-mobile fail reason
 * @return AdMob error code
 */
public static int convertToAdMobErrorCode(FailNotificationReason reason) {
  // Convert i-mobile fail reason to AdMob error code.
  switch (reason) {
    case RESPONSE:
    case UNKNOWN:
      return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    case PARAM:
    case AUTHORITY:
    case PERMISSION:
      return AdRequest.ERROR_CODE_INVALID_REQUEST;
    case NETWORK_NOT_READY:
    case NETWORK:
      return AdRequest.ERROR_CODE_NETWORK_ERROR;
    case AD_NOT_READY:
    case NOT_DELIVERY_AD:
    case SHOW_TIMEOUT:
      return AdRequest.ERROR_CODE_NO_FILL;
    default:
      return AdRequest.ERROR_CODE_INTERNAL_ERROR;
  }
}
 
源代码7 项目: ud867   文件: MainActivityFragment.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_main, container, false);

    AdView mAdView = (AdView) root.findViewById(R.id.adView);
    // Create an ad request. Check logcat output for the hashed device ID to
    // get test ads on a physical device. e.g.
    // "Use AdRequest.Builder.addTestDevice("ABCDEF012345") to get test ads on this device."
    AdRequest adRequest = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
            .build();
    mAdView.loadAd(adRequest);
    return root;

}
 
/**
 * Gets a string error reason from an error code.
 */
public static String getErrorReason(int errorCode) {
    String errorReason = "";
    switch (errorCode) {
        case AdRequest.ERROR_CODE_INTERNAL_ERROR:
            errorReason = "Internal error";
            break;
        case AdRequest.ERROR_CODE_INVALID_REQUEST:
            errorReason = "Invalid request";
            break;
        case AdRequest.ERROR_CODE_NETWORK_ERROR:
            errorReason = "Network Error";
            break;
        case AdRequest.ERROR_CODE_NO_FILL:
            errorReason = "No fill";
            break;
    }
    return errorReason;
}
 
@Override
public void onAdFetchFailed(SampleErrorCode errorCode) {
  switch (errorCode) {
    case UNKNOWN:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_INTERNAL_ERROR);
      break;
    case BAD_REQUEST:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_INVALID_REQUEST);
      break;
    case NETWORK_ERROR:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_NETWORK_ERROR);
      break;
    case NO_INVENTORY:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_NO_FILL);
      break;
  }
}
 
源代码10 项目: aMuleRemote   文件: SearchActivity.java
@Override
public void onCreate(Bundle savedInstanceState) {
    mApp = (AmuleRemoteApplication) getApplication();

    if (DEBUG) Log.d(TAG, "SearchActivity.onCreate: Calling super");
    super.onCreate(savedInstanceState);
    if (DEBUG) Log.d(TAG, "SearchActivity.onCreate: Back from super");
    
    if (DEBUG) Log.d(TAG, "SearchActivity.onCreate: Calling setContentView");
    setContentView(R.layout.act_search);
    if (DEBUG) Log.d(TAG, "SearchActivity.onCreate: Back from setContentView");

    getSupportActionBar().setTitle(R.string.search_title);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mFragManager = getSupportFragmentManager();

    AdView adView = (AdView)this.findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
            .addTestDevice("TEST_DEVICE_ID")
            .build();
    adView.loadAd(adRequest);

}
 
源代码11 项目: cordova-admob-pro   文件: AdMobPlugin.java
@Override
protected Object __prepareRewardVideoAd(String adId) {
  // safety check to avoid exceptoin in case adId is null or empty
  if(adId==null || adId.length()==0) adId = TEST_REWARDVIDEO_ID;

  RewardedVideoAd ad = MobileAds.getRewardedVideoAdInstance(getActivity());
  ad.setRewardedVideoAdListener(new RewardVideoListener());

  synchronized (mLock) {
    if (!mIsRewardedVideoLoading) {
      mIsRewardedVideoLoading = true;
      Bundle extras = new Bundle();
      extras.putBoolean("_noRefresh", true);
      AdRequest adRequest = new AdRequest.Builder()
              .addNetworkExtrasBundle(AdMobAdapter.class, extras)
              .build();
      ad.loadAd(adId, adRequest);
    }
  }

  return ad;
}
 
NativeVideoAdLoader(
    NendNativeAdForwarder forwarder,
    AdUnitMapper mapper,
    NativeMediationAdRequest nativeMediationAdRequest,
    Bundle mediationExtras) {
  Context context = forwarder.getContextFromWeakReference();
  if (context == null) {
    Log.e(TAG, "Your context may be released...");
    forwarder.failedToLoad(AdRequest.ERROR_CODE_INVALID_REQUEST);
    return;
  }
  this.forwarder = forwarder;

  NendAdNativeVideo.VideoClickOption clickOption = NendAdNativeVideo.VideoClickOption.LP;
  VideoOptions nativeVideoOptions =
      nativeMediationAdRequest.getNativeAdOptions().getVideoOptions();
  if (nativeVideoOptions != null && nativeVideoOptions.getClickToExpandRequested()) {
    clickOption = NendAdNativeVideo.VideoClickOption.FullScreen;
  }
  videoAdLoader = new NendAdNativeVideoLoader(context, mapper.spotId, mapper.apiKey, clickOption);
  videoAdLoader.setMediationName(MEDIATION_NAME_ADMOB);
  if (mediationExtras != null) {
    videoAdLoader.setUserId(mediationExtras.getString(NendMediationAdapter.KEY_USER_ID, ""));
  }
}
 
源代码13 项目: Android   文件: HomeFragment.java
private void Ads(View v) {
    //adView = view.findViewById(R.id.adView);
    View adContainer = v.findViewById(R.id.adMobView);
   // Log.e("TAG :BANNERhomefragment",ADMOB_PLEX_BANNER_1);

    AdView mAdView = new AdView(mContext);
    mAdView.setAdSize(AdSize.SMART_BANNER);
    mAdView.setAdUnitId(ADMOB_PLEX_BANNER_1);
    ((RelativeLayout)adContainer).addView(mAdView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);
    mInterstitialAd = new InterstitialAd(getActivity());
    mInterstitialAd.setAdUnitId(ADMOB_PLEX_INTERSTITIAL_1);
    mInterstitialAd.loadAd(new AdRequest.Builder().build());
    mInterstitialAd.setAdListener(new AdListener() {
        @Override
        public void onAdClosed() {

        }
    });

}
 
源代码14 项目: cordova-admob-pro   文件: AdMobPlugin.java
/** Gets a string error reason from an error code. */
public String getErrorReason(int errorCode) {
  String errorReason = "";
  switch(errorCode) {
    case AdRequest.ERROR_CODE_INTERNAL_ERROR:
      errorReason = "Internal error";
      break;
    case AdRequest.ERROR_CODE_INVALID_REQUEST:
      errorReason = "Invalid request";
      break;
    case AdRequest.ERROR_CODE_NETWORK_ERROR:
      errorReason = "Network Error";
      break;
    case AdRequest.ERROR_CODE_NO_FILL:
      errorReason = "No fill";
      break;
  }
  return errorReason;
}
 
源代码15 项目: admob-plus   文件: Action.java
public AdRequest buildAdRequest() {
    Bundle extras = new Bundle();
    AdRequest.Builder builder = new AdRequest.Builder();
    JSONArray testDevices = this.opts.optJSONArray("testDevices");
    if (testDevices != null) {
        for (int i = 0; i < testDevices.length(); i++) {
            String testDevice = testDevices.optString(i);
            if (testDevice != null) {
                builder.addTestDevice(testDevice);
            }
        }
    }
    if (this.opts.has("childDirected")) {
        builder.tagForChildDirectedTreatment(opts.optBoolean("childDirected"));
    }
    if (this.opts.has("npa")) {
        extras.putString("npa", opts.optString("npa"));
    }
    if (this.opts.has("underAgeOfConsent")) {
        extras.putBoolean("tag_for_under_age_of_consent", opts.optBoolean("underAgeOfConsent"));
    }
    return builder.addNetworkExtrasBundle(AdMobAdapter.class, extras).build();
}
 
private void requestCustomEventRewardedAd() {
  RewardedAdLoadCallback adLoadCallback = new RewardedAdLoadCallback() {
    @Override
    public void onRewardedAdLoaded() {
      customEventRewardedButton.setEnabled(true);
    }

    @Override
    public void onRewardedAdFailedToLoad(int errorCode) {
      Toast.makeText(MainActivity.this,
          String.format("Rewarded ad failed to load with code %d", errorCode),
          Toast.LENGTH_LONG).show();
      customEventRewardedButton.setEnabled(true);
    }
  };
  customEventRewardedAd = new RewardedAd(this,
      getString(R.string.customevent_rewarded_ad_unit_id));
  customEventRewardedAd.loadAd(new AdRequest.Builder().build(), adLoadCallback);
}
 
@Override
public void onError(final InlineAdFactory inlineAdFactory, final ErrorInfo errorInfo) {
  Log.i(TAG, "Verizon Ads SDK Inline Ad request failed (" + errorInfo.getErrorCode() + "): " +
      errorInfo.getDescription());

  final int errorCode;
  switch (errorInfo.getErrorCode()) {
    case VASAds.ERROR_AD_REQUEST_FAILED:
      errorCode = AdRequest.ERROR_CODE_INTERNAL_ERROR;
      break;
    case VASAds.ERROR_AD_REQUEST_TIMED_OUT:
      errorCode = AdRequest.ERROR_CODE_NETWORK_ERROR;
      break;
    default:
      errorCode = AdRequest.ERROR_CODE_NO_FILL;
  }
  ThreadUtils.postOnUiThread(new Runnable() {
    @Override
    public void run() {
      MediationBannerAdapter adapter = bannerAdapterWeakRef.get();
      if (bannerListener != null && adapter != null) {
        bannerListener.onAdFailedToLoad(adapter, errorCode);
      }
    }
  });
}
 
void requestBannerAd(@NonNull Context context, @NonNull String appId) {
  Log.d(TAG, "requestBannerAd: " + this);
  mPendingRequestBanner = true;
  VungleInitializer.getInstance()
      .initialize(
          appId,
          context.getApplicationContext(),
          new VungleInitializer.VungleInitializationListener() {
            @Override
            public void onInitializeSuccess() {
              loadBanner();
            }

            @Override
            public void onInitializeError(String errorMessage) {
              Log.d(TAG, "SDK init failed: " + VungleBannerAdapter.this);
              mVungleManager.removeActiveBannerAd(mPlacementId);
              if (mPendingRequestBanner && mVungleListener != null) {
                mVungleListener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR);
              }
            }
          });
}
 
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

    AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().addTestDevice("22FFB74E3E00DEC909938864EE0B401E").build();
    mAdView.loadAd(adRequest);

    System.out.println("Outer class "+this.getClass().getSimpleName());

    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, this.getClass().getSimpleName());
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "activity");
    mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);

    initInterstitial();

}
 
源代码20 项目: SmallBang   文件: ListActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list);
    AdView mAdView = findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);

    for (int i = 0; i < 100; i++) {
        Item item = new Item();
        item.content = "this is content : " + i;
        data.add(item);
    }


    RecyclerView recyclerView = findViewById(R.id.recyclerView);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(new MyAdapter());
}
 
@Override
public void onAdFetchFailed(SampleErrorCode errorCode) {
  switch (errorCode) {
    case UNKNOWN:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_INTERNAL_ERROR);
      break;
    case BAD_REQUEST:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_INVALID_REQUEST);
      break;
    case NETWORK_ERROR:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_NETWORK_ERROR);
      break;
    case NO_INVENTORY:
      mediationListener.onAdFailedToLoad(adapter, AdRequest.ERROR_CODE_NO_FILL);
      break;
  }
}
 
源代码22 项目: AndroidKeyboard   文件: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    LinearLayout enableSetting = findViewById(R.id.layout_EnableSetting);
    LinearLayout addKeyboards = findViewById(R.id.layout_AddLanguages);
    LinearLayout chooseInputMethod = findViewById(R.id.layout_ChooseInput);
    LinearLayout chooseTheme = findViewById(R.id.layout_ChooseTheme);
    LinearLayout manageDictionaries = findViewById(R.id.layout_ManageDictionary);
    LinearLayout about = findViewById(R.id.layout_about);

    enableSetting.setOnClickListener(this);
    addKeyboards.setOnClickListener(this);
    chooseInputMethod.setOnClickListener(this);
    chooseTheme.setOnClickListener(this);
    manageDictionaries.setOnClickListener(this);
    about.setOnClickListener(this);

    AdView adView = this.findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
            .addTestDevice("D17FE6D8441E3F2375E3709A2EED851B")
            .build();
    adView.loadAd(adRequest);
}
 
源代码23 项目: funcodetuts   文件: MainActivity.java
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MobileAds.initialize(getApplicationContext(), "YOUR UNIT ID");

        AdView adView = (AdView) this.findViewById(R.id.adMob);
        //request TEST ads to avoid being disabled for clicking your own ads
        AdRequest adRequest = new AdRequest.Builder()
                .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)// This is for emulators
                //test mode on DEVICE (this example code must be replaced with your device uniquq ID)
//                .addTestDevice("2EAB96D84FE62876379A9C030AA6A0AC") // Nexus 5
                .build();
        adView.loadAd(adRequest);
    }
 
源代码24 项目: snippets-android   文件: MainActivity.java
public void executeAdsPolicy() {
    // [START pred_ads_policy]
    FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
    String adPolicy = config.getString("ads_policy");
    boolean will_not_spend = config.getBoolean("will_not_spend");
    AdView mAdView = findViewById(R.id.adView);

    if (adPolicy.equals("ads_always") ||
            (adPolicy.equals("ads_nonspenders") && will_not_spend)) {
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);
        mAdView.setVisibility(View.VISIBLE);
    } else {
        mAdView.setVisibility(View.GONE);
    }

    FirebaseAnalytics.getInstance(this).logEvent("ads_policy_set", new Bundle());
    // [END pred_ads_policy]
}
 
源代码25 项目: FwdPortForwardingApp   文件: RuleListAdapter.java
public AdViewHolder(View v) {
    super(v);

    AdRequest request = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
            .build();
    AdView adView = new AdView(v.getContext());
    adView.setAdSize(AdSize.SMART_BANNER);

    // Load ad type based on theme - dark or light
    if (PreferenceManager.getDefaultSharedPreferences(v.getContext())
            .getBoolean(PREF_DARK_THEME, false)) {
        adView.setAdUnitId(DARK_AD_ID);
    } else {
        adView.setAdUnitId(LIGHT_AD_ID);
    }
    ((LinearLayout) v).addView(adView, 1);
    adView.loadAd(request);
}
 
@Override
        protected void onPostExecute(String s) {
            super.onPostExecute(s);

            if (userObjectList.size() == 0) {
                text1.setText(R.string.no_fave_stories);
                text2.setText(R.string.refresh);
                noStories.setVisibility(View.VISIBLE);
            } else {
//                adapter.setUserObjects(userObjectListCopy,userObjectList);
//                addNativeExpressAds();
                adapter.setUserObjects(userObjectListCopy,userObjectList);

                adLoader.loadAds(new AdRequest.Builder().build(), userObjectListCopy.size()/7);
            }


            wave.setVisibility(View.GONE);
            if (refreshLayout.isRefreshing()) {
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        refreshLayout.setRefreshing(false);
                    }
                }, 1500);
            }

            if (noStories.isShown())
                noStories.setVisibility(View.GONE);

            if (!recyclerView.isShown())
                recyclerView.setVisibility(View.VISIBLE);


        }
 
static void setGlobalTargeting(MediationAdRequest mediationAdRequest, Bundle extras) {
  configureGlobalTargeting(extras);

  if (mediationAdRequest.getLocation() != null) {
    InMobiSdk.setLocation(mediationAdRequest.getLocation());
  }

  // Date Of Birth
  if (mediationAdRequest.getBirthday() != null) {
    Calendar dob = Calendar.getInstance();
    dob.setTime(mediationAdRequest.getBirthday());
    InMobiSdk.setYearOfBirth(dob.get(Calendar.YEAR));
  }

  // Gender
  if (mediationAdRequest.getGender() != -1) {
    switch (mediationAdRequest.getGender()) {
      case AdRequest.GENDER_MALE:
        InMobiSdk.setGender(Gender.MALE);
        break;
      case AdRequest.GENDER_FEMALE:
        InMobiSdk.setGender(Gender.FEMALE);
        break;
      default:
        break;
    }
  }
}
 
源代码28 项目: funcodetuts   文件: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    AdView adView = (AdView) this.findViewById(R.id.adMob);
    //request TEST ads to avoid being disabled for clicking your own ads
    AdRequest adRequest = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)// This is for emulators
            //test mode on DEVICE (this example code must be replaced with your device uniquq ID)
            .addTestDevice("2EAB96D84FE62876379A9C030AA6A0AC") // Nexus 5
            .build();
    adView.loadAd(adRequest);
}
 
源代码29 项目: Birdays   文件: Ad.java
/**
 * Loads AdMob banner into MainActivity
 */
public static void showBannerAd(final ViewGroup viewGroup, final AdView banner, final View view) {
    banner.loadAd(new AdRequest.Builder().build());

    banner.setAdListener(new AdListener() {
        @Override
        public void onAdLoaded() {
            super.onAdLoaded();
            setupContentViewPadding(viewGroup, banner.getHeight());
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
                setBottomMargin(view, -(banner.getHeight() / 4));
            }
        }
    });
}
 
源代码30 项目: commcare-android   文件: AdMobManager.java
private static AdRequest buildAdRequest() {
    if (BuildConfig.DEBUG) {
        return buildTestAdRequest();
    } else {
        return new AdRequest.Builder().build();
    }
}