> 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/install-sdk.md).

# Install SDK

## **1. Introduction** <a href="#h-1-introduction" id="h-1-introduction"></a>

This guide provides a comprehensive walkthrough for integrating the MyChips SDK into your Android application, enabling the display of an engaging offerwall.\
\
Once installed, you can choose between two integration options:

* **Offerwall** — A full-screen WebView experience managed by the SDK. See [Offerwall Integration →](/android/sdk-offerwall.md)
* **Native Campaigns** — A customizable campaign list that you embed directly in your app's UI. See [Native Integration →](/android/sdk-native.md)

Both options use the same SDK. Install it once, then pick the integration that fits your app.

## **2. Prerequisites** <a href="#h-2-prerequisites" id="h-2-prerequisites"></a>

* Android Studio
* Minimum version requirement **27**.

## **3. SDK Integration** <a href="#h-3-sdk-integration" id="h-3-sdk-integration"></a>

**3.1 Adding the SDK**

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

```kts
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        maven {
            url = uri("https://europe-west1-maven.pkg.dev/mychips-b31fe/mychips-android-sdk")
        }
    }
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven("https://europe-west1-maven.pkg.dev/mychips-b31fe/mychips-android-sdk")
    }
}
```

{% endtab %}
{% endtabs %}

> **For Kotlin DSL Projects:** In your project-level `setting.gradle.kts`

> **For Groovy-Based Projects:** In your project-level `build.gradle`

**3.2 Adding the SDK Dependency to App-Level Build File**

In your app-level `build.gradle(Module :app)` file, add the following dependency

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

```
dependencies { 
  implementation("io.mychips:offerwall:+") 
  // Other dependencies...
}
```

{% endtab %}

{% tab title="Groovy" %}

```groovy
dependencies {
  implementation 'io.mychips:offerwall:+' 
  // Other dependencies... 
}
```

{% endtab %}
{% endtabs %}

**3.3 Configuring the Android Manifest**

In your `AndroidManifest.xml`, add the following:

**Permission for Internet Access:**

```xml
<uses-permission android:name="android.permission.INTERNET" />
```

> If you plan to use the **Offerwall** integration, you must also register the offerwall activity. See [Offerwall Integration](https://docs.mychips.io/android/pages/tJ06YL0OX03BBfpq2br1#id-1.-manifest-configuration).

## **4. Initializing the SDK**&#x20;

In your main activity’s `onCreate` method, import and initialize the SDK:

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

```kotlin
import io.mychips.offerwall.MCOfferwallSDK
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // Replace 'YOUR_API_KEY'
        MCOfferwallSDK.Init(this, "YOUR_API_KEY") 
        
    }
}
```

{% endtab %}

{% tab title="Java" %}

```java
import io.mychips.offerwall.sdk.MCOfferwallSDK;
// ...public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Replace 'YOUR_API_KEY' 
        MCOfferwallSDK.Init(this,"YOUR_API_KEY");
        
    }
}
```

{% endtab %}
{% endtabs %}

> Obtain your API key and User ID from[ **Universal Developer Portal**](https://dashboard.maf.ad/)

#### 4.1 (Mandatory) Set Google AdvertisingId

Improve reward tracking and eCPM performance by passing the advertising id. [Official documentation](https://developer.android.com/training/articles/ad-id)

```java
MCOfferwallSDK.SetAdvertisingId("HERE YOUR Google Advertising ID");
```

#### 4.2(Optional) Set UserId if you have your own unique id

```java
  MCOfferwallSDK.SetUserId("HERE YOUR USER ID");
```

Replace "HERE YOUR USER ID" with your actual user ID variable or value.

If you do not provide a specific user ID, one will be automatically generated.

#### 4.3(Optional) Set User Age

You can set the user’s age to help improve ad targeting and analytics.

```java
  MCOfferwallSDK.SetAge(30);
```

Replace 30 with your actual user age variable or value (integer).

💡 **Note:**

* The value should be an integer (e.g., 18, 25, 30).
* Expected range is 0–100 (inclusive).

#### 4.4(Optional) Set User Gender

You can set the user’s gender to help improve ad targeting and analytics.

```java
  MCOfferwallSDK.SetGender(MCGenderEnum.FEMALE);
```

Available enum values:

```java
  MCGenderEnum.MALE
  MCGenderEnum.FEMALE
  MCGenderEnum.OTHER
```

#### 4.5 (Optional) Set Custom Parameters (`aff_sub1`–`aff_sub5` )

We provide 5 `aff_sub` parameters (`aff_sub1`, `aff_sub2`, `aff_sub3`, `aff_sub4`, `aff_sub5`), which you can use to pass custom values.

```kotlin
MCOfferwallSDK.setAffSub1("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub2("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub3("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub4("HERE YOUR CUSTOM VALUE");
MCOfferwallSDK.setAffSub5("HERE YOUR CUSTOM VALUE");
```

Replace "HERE YOUR CUSTOM VALUE" with your actual custom value.

## **5. Next Steps**

Choose your integration:

<table><thead><tr><th width="178">Integration</th><th width="308">Description</th><th>Guide</th></tr></thead><tbody><tr><td><strong>Offerwall</strong></td><td>Full-screen WebView experience</td><td><a href="/pages/tJ06YL0OX03BBfpq2br1">Offerwall Integration →</a></td></tr><tr><td><strong>Native Campaigns</strong></td><td>Customizable campaign list in your UI</td><td><a href="/pages/Thv8MCuBvnLgyuyt7sbe">Native Quick Start →</a></td></tr></tbody></table>
