# Integrating SDK

1.) Add the following dependency in your app-level **build.gradle** file :

```markup
dependencies {
    ...
    implementation "com.winzo.winzo-sdk:winzo-sdk:1.0.3"
}
```

2.) Add the following dependency in your project-level **build.gradle** file :

```markup
dependencies {
    ...
    classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.3'
}

allprojects {
    repositories {
        ...
        maven {
            url "https://artifactory-prd.winzo.io/artifactory/winzo-sdk/"
            credentials {
                username = "********"
                password = "********"
            }
        }
    }
}
```

{% hint style="info" %}
you will receive the username and password separately
{% endhint %}

3.) Add **MainActivity** to manifest file and the intent filters for launching **MainActivity**, Remove remaining intent filters for remaining launcher an activity.

```markup
<activity
    android:name="com.base.aidllib.MainActivity"
    android:exported="true"
    android:theme="@style/SplashTheme">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="com.base.aidllib.MainActivity" />
    </intent-filter>
</activity>
```

4.) Extend AppApplication with **WinzoApplication**, register your activity with WinZO activity. \
&#x20;     Set the game icon by using `WinzoSdk.setGameIcon` method.\
&#x20;     Set product flavor by using `WinzoSdk.setProductFlavor` method.

```kotlin
class ClientApplication : WinzoApplication() {
    override fun onCreate() {
        super.onCreate()
        WinzoSdk.registerActivity(ClientActivity::class.java)
        WinzoSdk.setGameIcon(this.getDrawable(R.drawable.your_game_icon))
        if (BuildConfig.is_live) {
            WinzoSdk.setProductFlavor(ProductFlavor.LIVE)
        } else {
            WinzoSdk.setProductFlavor(ProductFlavor.STAG)
        }
    }
}
```

5.) You will receive the listed values in intent in registered activity (the activity you have registered with `WinzoSdk.registerActivity(ClientActivity::class.java)`)

```kotlin
override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val winzoAccessToken = intent.getStringExtra(Constants.WINZO_ACCESS_TOKEN)
        val joinCode = intent.getStringExtra(Constants.JOIN_CODE)
        val bootAmount = intent.getFloatExtra(Constants.BOOT_AMOUNT, 0f)
        val bootId = intent.getStringExtra(Constants.BOOT_ID)
        ...
}
```

{% hint style="info" %}

* `joinCode`, `bootAmount`, `bootId can be null`
* `winzoAccessToken` will be used in API calls.
* if `bootAmount` and `bootId`is null then show the main landing screen otherwise start the game with these values
  {% endhint %}

6.) Finally, add the application class to the manifest file

```markup
<application
    android:name=".ClientApplication"
    ...
    />
```

**Adaptive App Icon**

{% hint style="warning" %}

* Create Adaptive App Launcher Icon in **mipmap** directory with the name of **ic\_launcher** (which is the default).
* The foreground Layer name should be **ic\_launcher\_foreground**
* The Background Layer name should be **ic\_launcher\_background**
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.winzogames.com/old-sdk/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
