---
title: "Android Integration"
description: "Integrate KOMOJU payments into your Android application using the official SDK. Supports Konbini, PayPay, and credit cards with composable UI components and theme customization."
url: "https://docs.priv.staging.komoju-dev.tools/en/docs/integration-guides/android-integration"
source_url: "https://docs.priv.staging.komoju-dev.tools/en/docs/integration-guides/android-integration.md"
language: en
last_modified: "2026-03-25"
---

![](https://files.readme.io/c2132915ade40224021c7f45f47512a6f9609653125b038c2eee1ba2eca018d5-Screenshot_2024-10-22_at_13.33.47.png)

# What it is?

The KOMOJU Android SDK processes payments securely by having its UI communicate directly with our backend to handle sensitive credit card data, reducing your PCI-DSS compliance burden.

## What payment method are supported?

Moreover, the Android SDK supports multiple payment methods, including Konbini and PayPay in Japan, enabling you to cater to your customers' preferred payment options.

## Show me the code

The source code is freely available on [GitHub](https://github.com/komoju/komoju-mobile-sdk) and includes a sample application for easy testing and setup.

# Payment Flow

The payment flow consists of four key steps: creating a session, retrieving the session and initializing the SDK, managing the payment completion callback, and receiving the payment.captured webhook.

_The diagram below outlines the entire process_.

![](https://files.readme.io/84ba87fa963928cf73e753f784366319c1a7a8e76ab33b50cb62a06223368a23-86ac7861d3b61775f861a8287659a69a6e28f6d0a94bd943bf4a668d582a929e-Screenshot_2024-08-26_at_9.33.06.png)

# Demo

There is a prebuilt demo named **Soundbud!** available to check the SDK in action, get the latest build from the [Github release page](https://github.com/komoju/komoju-mobile-sdk/releases/latest) from the Assets section.

# Getting Started

## Requirements

- Android API 24+
- Gradle 8.X.X+
- The Android SDK utilize the latest version of jetpack compose.

Add the below dependency to your build script as per provided SDK version.

![](https://img.shields.io/maven-central/v/com.komoju.mobile.sdk/android?style=flat&logo=android&label=Android&color=3CC239)

```kotlin
implementation("com.komoju.mobile.sdk:android:<latest-version-here>")

```

```groovy
implementation 'com.komoju.mobile.sdk:android:<latest-version-here>'

```

```toml
[versions]
komojuAndroid = "<latest-version-here>"

[libraries]
komoju-mobile-sdk-android = { group = "com.komoju.mobile.sdk", name="android", version.ref = "komojuAndroid" }

// build.gradle.kts
implementation(libs.komoju.mobile.sdk.android)

```

## Creating a session

Set up a secure endpoint and generate a [Session Object](https://docs.priv.staging.komoju-dev.tools/en/api-reference#2025-01-28/tag/sessions/POST/sessions) on your backend server (refer to the [example](https://github.com/komoju/komoju-mobile-sdk/blob/main/server/functions/index.js#L14)).

While creating the session, ensure that the redirect_url points to your app's URL scheme, e.g., **myapp://**. and add the schema to your **strings.xml** or the **build script** like below.

```kotlin
// Either in build script
resValue("string", "komoju_consumer_app_scheme", "myapp")

// Or in your strings.xml
<string name="komoju_consumer_app_scheme">myapp</string>

```

## Prepare SDK Launcher

```kotlin
val komojuPaymentLauncher = rememberLauncherForActivityResult(KomojuSDK.KomojuPaymentResultContract) { paymentResult ->
        if (paymentResult.isSuccessFul) {
            // Handle success
        } else {
            // Handle failure
        }
    }

```

```kotlin
private val komojuPaymentLauncher = registerForActivityResult(KomojuSDK.KomojuPaymentResultContract) { paymentResult ->
        if (paymentResult.isSuccessFul) {
            // Handle success
        } else {
            // Handle failure
        }
    }

```

```java
private final ActivityResultContract<KomojuSDK.Configuration, KomojuSDK.PaymentResult> activityResultContract = KomojuSDK.getKomojuPaymentResultContract();
    private final ActivityResultLauncher<KomojuSDK.Configuration> komojuPaymentLauncher = registerForActivityResult(activityResultContract, paymentResult -> {
        if (paymentResult.isSuccessFul()) {
            // Handle success
        } else {
            // Handle failure
        }
    });

```

## Create KomojuSDK Configuration

```kotlin
val komojuSDKConfigurationBuilder = KomojuSDK.Configuration.Builder(
  // The Publishable Key for the merchant
  publishableKey = publishableKey,
  // Created session Id from Your server
  sessionId = sessionId,
)
// Optional configuration

// Set SDK Language, Default is System language
komojuSDKConfigurationBuilder.setLanguage(language)

// Set SDK Currency, Default is Japanese
komojuSDKConfigurationBuilder.setCurrency(currency)

// Set SDK Theme, Default is [DefaultConfigurableTheme]
komojuSDKConfigurationBuilder.setConfigurableTheme(theme)

// Set if SDK should process credit card payment inlined, Default is false
// This one is experimental and require OptIn `ExperimentalKomojuPaymentApi`
komojuSDKConfigurationBuilder.setInlinedProcessing(boolean)

val komojuPaymentConfiguration = komojuSDKConfigurationBuilder.build()


```

```java
KomojuSDK.Configuration.Builder komojuSDKConfigurationBuilder = new KomojuSDK.Configuration.Builder(
  // The Publishable Key for the merchant
  "publishableKey",
  // Created session Id from Your server
  "sessionId");
// Optional configuration

// Set SDK Language, Default is System language
komojuSDKConfigurationBuilder.setLanguage(language);

// Set SDK Currency, Default is Japanese
komojuSDKConfigurationBuilder.setCurrency(currency);

// Set SDK Theme, Check Theme
komojuSDKConfigurationBuilder.setConfigurableTheme(theme);

// Set if SDK should process credit card payment inlined, Default is false
// This one is experimental and require OptIn `ExperimentalKomojuPaymentApi`
komojuSDKConfigurationBuilder.setInlinedProcessing(boolean);

KomojuSDK.Configuration komojuPaymentConfiguration = komojuSDKConfigurationBuilder.build();

```

## Launch Payment SDK

```kotlin
val komojuPaymentLauncher = // Created from Step 1
val komojuPaymentConfiguration = // Created from Step 2

if (komojuPaymentConfiguration.canProcessPayment()) {
      komojuPaymentLauncher.launch(komojuPaymentConfiguration)
}

```

```java
private final ActivityResultLauncher<KomojuSDK.Configuration> komojuPaymentLauncher = // Created from Step 1
private final KomojuSDK.Configuration komojuPaymentConfiguration = // Created from Step 2

if (KomojuSDKKt.canProcessPayment(komojuPaymentConfiguration)) {
  komojuPaymentLauncher.launch(komojuPaymentConfiguration);
}

```

The result will be captured in the `komojuPaymentLauncher` callback which we created on step 1

# SDK Theme

A few ui components of the SDK are configurable. Please refer to the below table

| param | sets | returns |
| --- | --- | --- |
| primaryColor | Color value for the primary components like pay button. | An integer representing a color value |
| primaryContentColor | Color value for the content (e.g., text or icon) inside the primary component. | An integer representing a color value |
| primaryButtonCornerRadiusInDP | Corner radius for the primary button in density-independent pixels (DP). | An integer representing the corner radius in DP |
| loaderColor | Color value for the loader/spinner. | An integer representing a color value |

Default theme can be seen below.

```kotlin
data class DefaultConfigurableTheme(
    override val primaryColor: Long = 0xFF297FE7, // Default blue color for primary button.
    override val primaryContentColor: Long = 0xFFFFFFFF, // Default white color for primary button content.
    override val primaryShapeCornerRadiusInDp: Int = 8, // Default corner radius of 8 DP for primary button.
    override val loaderColor: Long = 0xFF3CC239, // Default green color for loader.
) : ConfigurableTheme

```

To Override the default theme, Please copy the default theme object and pass it to the KomojuSDK.Configuration Builder, check the example below.

```kotlin
val myAppThemeForKomojuSDK = ConfigurableTheme.default.copy(
    primaryColor = Color.BLUE,
    primaryContentColor = Color.WHITE,
    primaryButtonCornerRadiusInDP = 24,
    loaderColor = Color.GREEN,
)

// Set SDK Theme, Check Theme
komojuSDKConfigurationBuilder.setConfigurableTheme(theme)


```

# Issues

If you face any issue or have a feedback, Feel free to report it on [github](https://github.com/komoju/komoju-mobile-sdk/issues).
