---
updatedAt: 2026-07-16T20:01:37.000Z
agentTools:
  projectIndex: https://docs.joinforage.app/llms.txt
---

# Introduction

Accept EBT payments in your Android mobile app

<Callout icon="📘" theme="info">
  ### Looking for the Forage mobile app?

  Get instant EBT balance checks and access to exclusive grocery deals—download Forage on [iOS](https://apps.apple.com/us/app/forage-ebt-balance-savings/id6742527220) or [Android](https://play.google.com/store/apps/details?id=com.foragetechnologycorp.forage) and start saving today.
</Callout>

***

You can use the Forage Android SDK to process EBT payments in your Android app.

<Image src="https://files.readme.io/114b189-android.png" alt="Two Android phone screens, one prompting for an EBT pin to process payment, the other prompting EBT PIN for balance inquiry" align="center" />

## Features

* Native UI component for collecting and tokenizing a customer's EBT Card number (also called the card PAN)
* Native UI component for collecting a customer's EBT PIN
* Built-in EBT Card number validation
* Control over the styling of a native EBT checkout experience
* API methods that collect and tokenize an EBT Card number, perform a balance check, and capture a payment

## Requirements

Before you can use the Forage Android SDK, make sure that you have:

* Met all of the [prerequisites for working with Forage](https://docs.joinforage.app/docs/overview#prerequisites).
* Signed up for an account. [Contact us](https://www.joinforage.com/contact) if you don't yet have one.
* Built your app for Android API Level 23 (Android 6 Marshmallow) or newer.

For more information, see:

* [Android SDK GitHub repository](https://github.com/teamforage/forage-android-sdk)
* [Android Quickstart Guide](https://docs.joinforage.app/docs/forage-android-quickstart)
* [Android SDK reference docs](https://android.joinforage.app/)

## Starter code

After [installing the library](https://github.com/teamforage/forage-android-sdk#installation), include either or both of the UI components in your application's views.

For example, the following snippet adds the EBT Card number element `ForagePanEditText`:

```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.joinforage.forage.android.ecom.ui.element.ForagePANEditText
            android:id="@+id/foragePanEditText"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="16dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:textColor="?android:attr/textColor"
            android:textSize="?android:attr/textSize"
            app:panBoxStrokeColor="?attr/panBoxStrokeColor"
            app:panBoxStrokeWidthFocused="?attr/panBoxStrokeWidthFocused"
            app:panBoxStrokeWidth="?attr/panBoxStrokeWidth"
            app:cornerRadius="?attr/cornerRadius"
            app:textInputLayoutStyle="?attr/textInputLayoutStyle" />

</androidx.constraintlayout.widget.ConstraintLayout>
```

Then, reference the element in response to a user action. The example below tokenizes the EBT Card number and could be included within an `onSubmit` function:

```kotlin
// TokenizeViewModel.kt
@HiltViewModel
class TokenizeViewModel @Inject constructor(
    savedStateHandle: SavedStateHandle,
    private val moshi: Moshi
) : ViewModel() {
    private val args = TokenizeFragmentArgs.fromSavedStateHandle(savedStateHandle)

    // internal so that TokenizeFragment can access these values
    val merchantID = args.merchantAccount
    val sessionToken = args.sessionToken

    fun tokenizeEBTCard(foragePanEditText: ForagePANEditText) = viewModelScope.launch {
        _isLoading.value = true

        val response = ForageSDK().tokenizeEBTCard(
            TokenizeEBTCardParams(
                foragePANEditText = foragePanEditText,
                reusable = true,
                customerId = "<unique_id_for_your_customer>",
            )
        )

        when (response) {
            is ForageApiResponse.Success -> {
                val adapter: JsonAdapter<PaymentMethod> = moshi.adapter(PaymentMethod::class.java)
                val paymentMethod = adapter.fromJson(response.data)

                // (optional) do something with the ref
                saveToPaymentMethodRefToMyAPI(paymentMethod.ref)
            }
            is ForageApiResponse.Failure -> {
                _error.value = response.message
            }
        }

        _isLoading.value = false
    }
}
```

## Next steps

* Check out the [forage-android-sdk GitHub repository](https://github.com/teamforage/forage-android-sdk) for full installation instructions and a demo app

<br />

# Sibling pages

* [Quickstart](https://docs.joinforage.app/docs/forage-android-quickstart.md)
* [Style Android Elements](https://docs.joinforage.app/docs/forage-android-styling-guide.md)