# AppNexus (Xandr)

You can set AppNexus interstitial to automatically close after given time, and enable banners to render native or video ads by:

* Create an instance of [AATKitAdNetworkOptions](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-a-a-t-kit-ad-network-options/index.html) passing [AppNexusOptions](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-app-nexus-options/index.html).
* Provide this instance to the [AATKitConfiguration](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-a-a-t-kit-configuration/index.html) while initialising AATKit.
* AATKit will automatically forward the specified options the AppNexus (Xandr) SDK while displaying the interstitial ad.

{% tabs %}
{% tab title="Java" %}
```java
AATKitConfiguration conf = new AATKitConfiguration(this);
AATKitAdNetworkOptions networkOptions = new AATKitAdNetworkOptions();
// [...]
AppNexusOptions appNexusOptions = new AppNexusOptions();
appNexusOptions.setAutoCloseTime(5);
appNexusOptions.setSupportNativeBanner(true);
appNexusOptions.setSupportVideoBanner(true);

networkOptions.setAppNexusOptions(appNexusOptions);
conf.setAdNetworkOptions(networkOptions);
// [...]
AATKit.init(conf);
```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
val conf = AATKitConfiguration(this)
val networkOptions = AATKitAdNetworkOptions()
// [...]
val appNexusOptions = AppNexusOptions()
appNexusOptions.autoCloseTime = 5
appNexusOptions.supportNativeBanner = true
appNexusOptions.supportVideoBanner = true

networkOptions.appNexusOptions = appNexusOptions
conf.adNetworkOptions = networkOptions
// [...]
AATKit.init(conf)
```
{% endtab %}
{% endtabs %}
