---
updatedAt: 2026-04-09T17:27:49.000Z
---

# Android SDK

# Installation

The Pinwheel Android SDK is available via the [Maven Central Repository](https://search.maven.org/artifact/com.getpinwheel/pinwheel-android).

## Maven Central Repository

To install the SDK using the Maven Central Repository

1. Add `mavenCentral` to your app's `build.gradle` repositories block

```gradle
repositories {
    mavenCentral()
}
```

2. Add the package to your dependencies:

```gradle
dependencies {
    implementation 'com.getpinwheel:pinwheel-android:3.5.2'
}
```

3. Sync your Android gradle project and the library should be ready to use.

# Configuration

Some platform integrations may require camera access for verification purposes. Ensure the following permission is included in your `AndroidManifest.xml`:

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

# Usage

## `PinwheelFragment`

The Pinwheel Android SDK provides the `PinwheelFragment` that takes `linkToken` as an argument.

```kotlin
import com.underdog_tech.pinwheel_android.PinwheelFragment

// fetch link token from server
val pinwheelFragment = PinwheelFragment.newInstance(token)
// show fragment
```

## `PinwheelEventListener`

To listen for the events coming from Link, implement `PinwheelEventListener`. Then simply provide the instance of the listener to `PinwheelFragment` by setting the `pinwheelEventListener` field.

```kotlin
val callbacks = object: PinwheelEventListener {
  override fun onSuccess(result: PinwheelResult) {}
  override fun onLogin(result: PinwheelLoginPayload) {}
  override fun onError(error: PinwheelError) {}
  override fun onExit(error: PinwheelError?) {}
  override fun onEvent(eventName: PinwheelEventType, payload: PinwheelEventPayload?) {}
}
val linkToken: String = // The Link token created using the `POST /v1/link_tokens` endpoint.
val pinwheelFragment = PinwheelFragment.newInstance(linkToken)
pinwheelFragment.pinwheelEventListener = callbacks
```

## Link Initialization Params

While you must include the Link Token in your initialization of the `PinwheelFragment` and attach event listeners as shown above, there are additional parameters available to customize your implementation:

`handleInsets` defaults to true, but if set to false will prevent the Pinwheel SDK from handling the screen bezels on its own. This is very rarely needed.

`useDarkMode` defaults to false, but if set to true will render Link in dark mode. Use this in combination with whatever mechanism you use to track whether your app is rendering in dark mode for a more consistent user experience.

Example of the full params:

```kotlin
val isDarkMode = true // Determine this from your app logic
val pinwheelFragment = PinwheelFragment.newInstance(token, handleInsets = true, useDarkMode = isDarkMode)
```

# Maintenance

Pinwheel regularly releases improvements to this SDK. You should update to the latest version of the Android SDK at least quarterly to ensure the best product performance.

You can check out the full changelog [here on GitHub](https://github.com/underdog-tech/pinwheel-android-sdk/blob/main/CHANGELOG.md).