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

# Getting started

This page shows you how to download, import, and configure the Bidapp SDK.

## Gradle (Recommended)

Open the `build.gradle` file of your app module (app-level build.gradle) in the root of your project.

In the `dependencies` section, add the following line:

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

```groovy
dependencies {
    implementation 'io.bidapp:bidapp-sdk:+'
    ⋮
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kts
dependencies {
    implementation ("io.bidapp:bidapp-sdk:+")
    ⋮
}
```

{% endtab %}
{% endtabs %}

Save the `build.gradle` file

Now, the Bidapp SDK is integrated into your Android project using Gradle.

{% hint style="info" %}
Minimum supported version Android 7.0 (API level 24) or above
{% endhint %}

## Get the pubid string

Request pubid by sending email to <connect@bidapp.io>

## Integrate Networks SDK Adapters

Bidapp SDK contains implementations of adapters to other Networks SDKs.

To install them:

1. Open the `build.gradle` file of your app module (app-level build.gradle) in the root of your project.
2. In the `dependencies` section, add the following line or any combination of them:

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

```groovy
dependencies {
    implementation 'io.bidapp.networks:applovin:+'
    implementation 'io.bidapp.networks:applovinmax:+'
    implementation 'io.bidapp.networks:unity:+'
    implementation 'io.bidapp.networks:liftoff:+'
    implementation 'io.bidapp.networks:admob:+'
    implementation 'io.bidapp.networks:chartboost:+'
    implementation 'io.bidapp.networks:startIo:+'
    implementation 'io.bidapp.networks:facebook:+'
    implementation 'io.bidapp.networks:digitalturbine:+'
    ⋮
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kts
dependencies {
    implementation ("io.bidapp.networks:applovin:+")
    implementation ("io.bidapp.networks:applovinmax:+")
    implementation ("io.bidapp.networks:unity:+")
    implementation ("io.bidapp.networks:liftoff:+")
    implementation ("io.bidapp.networks:admob:+")
    implementation ("io.bidapp.networks:chartboost:+")
    ⋮
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you want to receive release updates for adapters, subscribe to our GitHub repository: [GitHub repository](https://github.com/bidapphub/bidapp-ads-android)
{% endhint %}

3. Save the `build.gradle` file

{% hint style="warning" %}
Before adding **Admob** adapter, it's crucial to add the Admob **APPLICATION\_ID** as a `meta-data` in your **AndroidManifest.xml** file. This is mandatory for adapter to function correctly.
{% endhint %}

{% hint style="warning" %}
Before adding **Applovin\Applovin MAX** adapters, it's crucial to add the Applovin **SDK KEY** as a `meta-data` in your **AndroidManifest.xml** file. This is mandatory for adapters to function correctly.
{% endhint %}

## Permissions

Make sure to add the next permissions to your AndroidManifest.xml to ensure the SDK functions as intended:

* For accessing the Google Advertising ID.

`<uses-permission android:name="com.google.android.gms.permission.AD_ID" />`

{% hint style="warning" %}
This is required by the Android Advertising ID (AAID) module - `com.google.android.gms:play-services-ads-identifier`
{% endhint %}

* For analytics.

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

* For the SDK to operate correctly.

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

## Initialize the SDK

Initialize the SDK in your app `onCreate()` method of your launch `Activity`

Ad assets that are fully cached result in a better user experience. Therefore, always initialize the Bidapp SDK on startup to give mediated networks the maximum amount of time to cache ads. This is especially important with video ads.

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

```java
public class MainActivity extends AppCompatActivity implements   	BIDFullscreenLoadDelegate {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        BIDConfiguration bidConfig = new BIDConfiguration();
        
        // Comment out those ad formats that you don't use:
        bidConfig.enableInterstitialAds();
        bidConfig.enableRewardedAds();
        bidConfig.enableBannerAds_320x50();
        bidConfig.enableBannerAds_300x250();

        // TODO: replace this pubid with your personal one obtained from bidapp
        String pubid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";

        BidappAds.start(pubid, bidConfig, this);
    }
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
class MainActivity : AppCompatActivity(), BIDFullscreenLoadDelegate {

    private var interstitial : Interstitial? = null
    private var rewarded : Rewarded? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_main)

      	interstitial = Interstitial(this)
	interstitial?.setLoadDelegate(this)

	rewarded = Rewarded(this)
	rewarded?.setLoadDelegate(this)


        val bidConfig = BIDConfiguration()

        //Comment out those ad formats that you don`t use:
        bidConfig.enableInterstitialAds()
        bidConfig.enableRewardedAds()
        bidConfig.enableBannerAds_320x50()
        bidConfig.enableBannerAds_300x250()

        //TODO: replace this pubid with your personal, obtained from bidapp
        val pubid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

        BidappAds.start(pubid, bidConfig, this)
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Pay attention to the **pubid** string obtained earlier at [Get the pubid string](#get-the-pubid-string) of this instruction.
{% endhint %}

## Consent and Data APIs

In order to ensure you obtain consent from your users in applicable jurisdictions on behalf of our monetization partners and correctly pass consent flag values to Bidapp, please review **App Policy Settings**
