With a few changes to your code, you can combine native and banner ads in your
ad requests.

## Prerequisites

<br />

- Complete the [Get started guide](https://developers.google.com/ad-manager/mobile-ads-sdk/android/next-gen/quick-start.md.txt).

## Load an ad

To make a combined native and banner request, do the following:

1. Pass both `NativeAdType.NATIVE` type and `NativeAdType.BANNER` type as a
   list in the `NativeAdRequest`.

2. Set at least one banner ad size.

The following examples loads a combined native and banner ad:

### Kotlin

```kotlin
val adRequest =
  NativeAdRequest.Builder(AD_UNIT_ID, listOf(NativeAdType.NATIVE, NativeAdType.BANNER))
    // Use setAdSize() or setAdSizes() depending on if you want multiple ad sizes or not.
    .setAdSizes(listOf(AdSize.BANNER, AdSize.LARGE_BANNER))
    .build()

// Load the native and banner ad with the ad request and callback.
NativeAdLoader.load(adRequest, getNativeAdLoaderCallback())
```

### Java

```java
NativeAdRequest adRequest =
    new NativeAdRequest.Builder(AD_UNIT_ID, List.of(NativeAdType.NATIVE, NativeAdType.BANNER))
        // Use setAdSize() or setAdSizes() depending on if you want multiple ad sizes or not.
        .setAdSizes(Arrays.asList(AdSize.BANNER, AdSize.LARGE_BANNER))
        .build();

// Load the native and banner ad with the ad request and callback.
NativeAdLoader.load(adRequest, getNativeAdLoaderCallback());

```

Set an ad size smaller than or equal to the device screen size.
To determine the maximum screen size, use the
[`Resources.getDisplayMetrics`](https://developer.android.com/reference/android/content/res/Resources#getDisplayMetrics())
method. The `AdSize` object dimensions use density-independent pixels (dp). When comparing, convert the
screen size from pixels to dp.
For details about size constraints, see
[Troubleshoot unfilled impressions in Ad Manager](https://support.google.com/admanager/answer/1739296).

> [!IMPORTANT]
> **Key Point:** You can only request banner ads through `NativeAdRequest` when you also request native ads. To make an ad request for banners alone, see [Banner](https://developers.google.com/ad-manager/mobile-ads-sdk/android/next-gen/banner.md.txt). In addition, banners loaded through `NativeAdLoader` objects don't refresh.

## Get the ad from the `NativeAdLoaderCallback` object

Depending on which type of ad has successfully loaded, the
`NativeAdLoaderCallback` object calls the `onNativeAdLoaded()` method for native
ads and the `onBannerAdLoaded()` method for banner ads.

The following example gets banner or native ads:

### Kotlin

```kotlin
private fun getNativeAdLoaderCallback(): NativeAdLoaderCallback {
  return object : NativeAdLoaderCallback {
    override fun onNativeAdLoaded(nativeAd: NativeAd) {
      // Called when a native ad has loaded.
    }

    override fun onBannerAdLoaded(bannerAd: BannerAd) {
      // Called when a banner ad has loaded.
    }
  }
}

```

### Java

```java
private NativeAdLoaderCallback getNativeAdLoaderCallback() {
  return new NativeAdLoaderCallback() {
    @Override
    public void onNativeAdLoaded(@NonNull NativeAd nativeAd) {
      // Called when a native ad has loaded.
    }

    @Override
    public void onBannerAdLoaded(@NonNull BannerAd bannerAd) {
      // Called when a banner ad has loaded.
    }
  };
}
```