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

# How Do I Get Started with the Android SDK (v4)?

> Install Gameball Android SDK v4.0.0 and set up your project

# Installation & Setup

This guide helps you set up your project and install the **Gameball Android SDK v4.0.0**.\
After completing these steps, proceed to **Initialize the SDK** to start using Gameball in your app.

***

## Requirements

Your project must meet the following minimum requirements:

* **Minimum SDK Version:** 24 (Android 7.0)
* **Target SDK Version:** 34
* **Kotlin:** 2.0.0+
* **AndroidX:** Required
* **Internet permission** in your `AndroidManifest.xml`:

```xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
```

> [!NOTE]
>
> **Upgrading from v3?** Version 4.0.0 raises the minimum SDK version to 24 (Android 7.0). Every v3 call works unchanged. See [Migration Notes](https://docs.gameball.co/installation-guides/v4/android/migration-notes.md).

***

## Install the SDK

### 1. Add Repositories

Add the required repositories to your **project-level** `settings.gradle` (or `build.gradle` for older projects):

```groovy theme={null}
dependencyResolutionManagement {
  repositories {
    google()
    mavenCentral()
    maven { url "https://jitpack.io" }
    maven { url 'https://developer.huawei.com/repo/' }
  }
}
```

> [!NOTE]
>
> If your project uses an older Gradle configuration, add these repositories under: `allprojects { repositories { ... } }`.

***

### 2. Add the Gameball Dependency

In your **app-level** `build.gradle`:

```groovy theme={null}
dependencies {
  implementation 'com.github.gameballers:gb-mobile-android:4.0.0'
}
```

***

### 3. (Optional) Maven Installation

If you are using Maven:

```xml theme={null}
<dependency>
  <groupId>com.github.gameballers</groupId>
  <artifactId>gb-mobile-android</artifactId>
  <version>4.0.0</version>
</dependency>
```

***

## ProGuard / R8 Configuration

If you are using ProGuard or R8, add the following rules to your [proguard-rules.pro](http://proguard-rules.pro):

```proguard theme={null}
# Gameball SDK
-keep class com.gameball.gameball.** { *; }
-keep class com.gameball.gameball.model.** { *; }

# Gson
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.google.gson.** { *; }
```

> [!NOTE]
>
> The SDK automatically enables debug logging in debug builds. Network requests and responses are logged when `BuildConfig.DEBUG` is `true`.

***

## Troubleshooting Setup

> [accordion] Dependency Not Found
>
> **Symptoms:** Gradle cannot resolve `com.github.gameballers:gb-mobile-android:4.0.0`. **Solutions:**
>
> * Ensure `jitpack.io` and Huawei repos are added under `repositories`.
> * Sync Gradle again from Android Studio.
> * Check for typos in the dependency coordinates.

> [accordion] Network Errors After Installation
>
> **Symptoms:** Calls fail or time out after integrating the SDK. **Solutions:**
>
> * Verify `INTERNET` permission is present in `AndroidManifest.xml`.
> * Check network connectivity on the test device/emulator.
> * Confirm your API key is correct in the Gameball dashboard (once you initialize the SDK).

***

## Debug Logging

The SDK logs useful information when BuildConfig.DEBUG is true.

### Logcat Tags

| **Tag** | **Description** |
| :- | :- |
| `GameballApp` | General SDK operations and lifecycle |
| `LoggingInterceptor` | Network requests and responses |
| `HeaderInterceptor` | Request headers and authentication |
| `GameballIAM` | In-app messaging (v4.0.0+): why a campaign was shown or skipped |

#### Example:

```bash theme={null}
adb logcat -s GameballApp LoggingInterceptor HeaderInterceptor GameballIAM
```

> [!TIP]
>
> No extra configuration is required, debug logs are automatically enabled in debug builds.

## Next Steps

* [Initialize SDK](https://docs.gameball.co/installation-guides/v4/android/initialize-sdk.md)
* [Initialize Customer Profile](https://docs.gameball.co/installation-guides/v4/android/initialize-profile.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.