> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Android Integration

> This document will cover integration steps for Android side of your ReactNative application.

## Installation

<Steps>
  <Step title="Install Package">
    <CodeGroup>
      ```javascript npm theme={"system"}
      npm install @suprsend/react-native-sdk@latest
      ```

      ```javascript yarn theme={"system"}
      yarn add @suprsend/react-native-sdk@latest
      ```
    </CodeGroup>
  </Step>

  <Step title="Add the below dependency">
    Add the this dependency in project level **build.gradle**, inside **allprojects > repositories**.

    <CodeGroup>
      ```java build.gradle theme={"system"}
      allprojects {
        repositories {
          ...
          mavenCentral()  // add this
        }
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Add Android SDK dependency inside in app level build.gradle.">
    <CodeGroup>
      ```java build.gradle theme={"system"}
      dependencies {
        ...
        implementation 'com.suprsend:rn:0.1.10' // add this
      }
      ```
    </CodeGroup>

    <Warning>
      **Note:**

      If you get any error regarding minSdkVersion please update it to 19 or more.
    </Warning>
  </Step>
</Steps>

## Initialization

<Steps>
  <Step title="Initialise the Suprsend Android SDK">
    Initialise the Suprsend android SDK in **MainApplication.java** inside `onCreate` method and just above `super.onCreate()` line.

    <CodeGroup>
      ```javascript javascript theme={"system"}
      import app.suprsend.SSApi; // import sdk
      ...
      SSApi.Companion.init(this, WORKSPACE KEY, WORKSPACE SECRET); // inside onCreate method just above super.onCreate() line
      ```
    </CodeGroup>

    Replace **`WORKSPACE KEY`** and **`WORKSPACE SECRET`** with your workspace values. You will get them the tokens from **Settings -> API Keys** inside [Suprsend dashboard](https://app.suprsend.com/).
  </Step>

  <Step title="Import SuprSend SDK in your client side Javascript code.">
    <CodeGroup>
      ```javascript javascript theme={"system"}
      import suprsend from "@suprsend/react-native-sdk";
      ```
    </CodeGroup>
  </Step>
</Steps>

## Logging

By default the logs of SuprSend SDK are disabled. You can enable the logs just in debug mode while in development by the below condition.

<CodeGroup>
  ```javascript javascript theme={"system"}
  suprsend.enableLogging(); // available from v2.0.2

  // deprecated from v2.0.2
  suprsend.setLogLevel(level)
  suprsend.setLogLevel("VERBOSE")
  suprsend.setLogLevel("DEBUG")
  suprsend.setLogLevel("INFO")
  suprsend.setLogLevel("ERROR")
  suprsend.setLogLevel("OFF")
  ```
</CodeGroup>

***
