> For the complete documentation index, see [llms.txt](https://docs.mychips.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mychips.io/android/sdk-native.md).

# SDK - Native

## Quick Start

> **Prerequisite:** Complete the [SDK Installation](/android/install-sdk.md) first. Minimum SDK version required: 1.2.1.

Native Campaigns lets you display a scrollable list of campaigns directly in your app's UI. The SDK provides a default layout — you just drop it in and call `load()`.

<figure><img src="/files/lZQWWLxArG2F8cHrVbXJ" alt=""><figcaption></figcaption></figure>

***

### **1. Set the Ad Unit ID**

After `Init`, set the ad unit ID for native campaigns:

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
MCOfferwallSDK.Init(this, "YOUR_API_KEY")
MCOfferwallSDK.SetUserId("YOUR_USER_ID")
MCOfferwallSDK.SetAdunitId("YOUR_AD_UNIT_ID")
```

{% endtab %}

{% tab title="Java" %}

```java
MCOfferwallSDK.Init(this, "YOUR_API_KEY");
MCOfferwallSDK.SetUserId("YOUR_USER_ID");
MCOfferwallSDK.SetAdunitId("YOUR_AD_UNIT_ID");
```

{% endtab %}
{% endtabs %}

> Get your Ad unit ID from the [Developer Portal](https://dashboard.maf.ad/).

### **2. Add the View to Your Layout**

In your layout XML, add the `MCNativeAdView`:

```xml
<io.mychips.nativesdk.view.MCNativeAdView
    android:id="@+id/mc_adView"
    android:layout_width="match_parent"
    android:layout_height="180dp" />
```

### **3. Load Campaigns**

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.mychips.nativesdk.view.MCNativeAdView

val adView = findViewById<MCNativeAdView>(R.id.mc_adView)
adView.load()
```

{% endtab %}

{% tab title="Java" %}

```
import io.mychips.nativesdk.view.MCNativeAdView;

MCNativeAdView adView = findViewById(R.id.mc_adView);
adView.load();
```

{% endtab %}
{% endtabs %}

**That's it.** The SDK handles everything:

* Fetches campaigns from the API
* Shows a loading skeleton while fetching
* Displays campaigns in a horizontal scrollable list
* Tracks impressions automatically
* Opens the campaign detail page on click

***

### 4. (Optional) Open Campaign Details In-App

By default, tapping a campaign opens the detail page in the device's external browser. To keep users inside your app using an in-app WebView:

```java
MCOfferwallSDK.SetOpenInApp(true);
```

If you enable this, you must also register the WebView activity in your AndroidManifest.xml:

```xml
<activity android:name="io.mychips.offerwall.controller.MCOfferwallActivity"
            android:theme="@style/Theme.AppCompat.NoActionBar"/>
```

Since this is the activity defined in the [SDK - Offerwall](/android/sdk-offerwall.md), you can refer to its documentation if you want to set a title for it:

```java
MCOfferwallSDK.SetToolbarTitle("My Rewards");
```

### 5. What Happens Behind the Scenes

When you call `adView.load()`, the SDK:

1. Shows a **pulsing skeleton placeholder** that matches the layout direction
2. Calls the API to fetch campaigns
3. Replaces the skeleton with the **campaign list**
4. **Fires impression pixels** automatically when each campaign becomes visible
5. **Opens the campaign detail page** in the browser when the user taps a campaign

No manual tracking or click handling is needed.

***

### **Next Steps**

* Want to customize the look and feel with small effort? See [Customizations →](https://sites.gitbook.com/preview/site_KwL4X/~/revisions/BN8QqwKMZ6zGLtzh4VqC/android/sdk-native/sdk-native-custom-layout)
* Need a completely different card design? See [Custom Layouts →](https://sites.gitbook.com/preview/site_KwL4X/~/revisions/BN8QqwKMZ6zGLtzh4VqC/android/sdk-native/sdk-native-custom-layout)
* Need the full data reference? See [Data Reference →](https://sites.gitbook.com/preview/site_KwL4X/~/revisions/BN8QqwKMZ6zGLtzh4VqC/android/sdk-native/sdk-native-data-reference)
