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

# Installing the Android SDK

Next, quickly embed the SDK in your Android app to
store card details, authorize payments, and capture a transaction.

## Add the SDK

The [Android SDK](https://github.com/gr4vy/gr4vy-android) is available as a Maven bundle
on [Jitpack](https://jitpack.io/#gr4vy/gr4vy-android). In Gradle,
this can be set up as follows.

```js theme={"system"}
repositories {
  mavenCentral()
  maven { url "https://jitpack.io" }
}

dependencies {
  implementation 'com.github.gr4vy:gr4vy-android:v1.4.0'
}
```

## Set up the app

Next, add the following meta information to your app's manifest.

```xml theme={"system"}
<meta-data android:name="gr4vy-id" android:value="[ID]" />
<meta-data android:name="gr4vy-environment" android:value="[ENVIRONMENT]" />
```

<Warning>
  Replace `[ID]` with the ID of your instance and
  `[ENVIRONMENT]` with either `sandbox` or `production`.
</Warning>

Additionally, ensure you have internet access added
to the permissions in your manifest.

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

## Prepare the SDK

Next, add the following to the top of your activity where
you want to enable the payment sheet.

```java theme={"system"}
private lateinit var gr4vySDK: Gr4vySDK
```

Then, initialize the SDK within the `onCreate()` method of your activity.

```java theme={"system"}
gr4vySDK = Gr4vySDK(activityResultRegistry, this, this)
```

Next, register the observer as follows.

```java theme={"system"}
lifecycle.addObserver(gr4vySDK)
```

Finally, implement the `Gr4vyResultHandler` interface on the activity
and implement the required methods.

```java theme={"system"}
class MainActivity : ComponentActivity(), Gr4vyResultHandler
```
