Loading MREC consists of several stages:

  1. Loading BidMachine BannerRequest
  2. Setting up AdMob AdRequest by loaded BidMachine BannerRequest
  3. Loading AdMob AdView with configured AdMob AdRequest



Auto-refresh is not supported. For this type of integration, all of the above steps must be repeated.

Loading BidMachine BannerRequest

Create a new BannerRequest instance with BannerSize.Size_300x250 and AdRequestListener.
Execute request on the BannerRequest instance to start loading.
When the onRequestSuccess callback is triggered, it means that the request has been successfully loaded and you can proceed to AdMob AdRequest settings.

// Create new BidMachine BannerRequest instance
BannerRequest bannerRequest = new BannerRequest.Builder()
        .setListener(new BannerRequest.AdRequestListener() {
            public void onRequestSuccess(@NonNull BannerRequest bannerRequest,
                                         @NonNull AuctionResult auctionResult) {
                runOnUiThread(() -> loadAdMobMrec(bannerRequest));

// Request an ad from BidMachine without loading it

Setting up AdMob AdRequest

Ways to set up AdMob AdRequest by BidMachine BannerRequest:

  1. Create a new AdMob AdRequest instance
AdRequest adRequest = BidMachineUtils.createAdRequest(bannerRequest);
  1. Create a new AdMob AdRequest.Builder instance
AdRequest.Builder adRequestBuilder =
AdRequest adRequest = adRequestBuilder.build();
  1. Fill an existing AdMob AdRequest.Builder instance
AdRequest.Builder adRequestBuilder = new AdRequest.Builder();
BidMachineUtils.appendRequest(adRequestBuilder, bannerRequest);
AdRequest adRequest = adRequestBuilder.build();

Loading AdMob AdView

Use the AdMob AdRequest that was created during the previous step to load the AdMob AdView

// Create new AdView instance
AdView adView = new AdView(...);

// Load AdView with AdMob AdRequest


Sample App

You can find Sample App with BidMachineSDK and AdMob here: Github MREC