Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

3. Consider application start

Overview

When your application starts, initialize the NFC Wallet SDK.

Also set the payment experience your digital wallet application supports:

  • Support single-tap payments.

  • Or require two-tap payments.

Even if you enable single-tap, some transactions can fall back to two-tap. See Single-tap can fall back to two-tap.

Payment application in background

When the digital wallet application is the default payment application (see Default payment app), Android may keep it in the background. This lets it respond quickly to contactless payment APDUs from the POS terminal without recreating the Application.

Some devices terminate the default payment application while it is in the background. On these devices, contactless payments can trigger an application cold start. See Optimize cold starts.

SDK integration

Update application startup

In Application.onCreate(), your application must:

  1. Run SDK quick configuration.

  2. Set the expected payment experience:

    • ONE_TAP_ENABLED to support single-tap transactions

    • TWO_TAP_ALWAYS to always require authentication after the first tap (always two-tap payments)

  3. Initialize the SDK in a separate thread.

  4. Optional: after initialization succeeds, activate pre-entry. See Activate pre-entry.

For steps 1 and 2, see Initialize the NFC Wallet SDK.

Single-tap can fall back to two-tap

Reduce cold start time

Some devices terminate the default payment application while it is in the background. On these devices, a contactless payment can trigger an application cold start.

APDU processing starts immediately after the cold start.

The cold start process includes:

  • Service binding (around 100–200 milliseconds)

  • Completion of Application.onCreate()

Minimize work in Application.onCreate(). Limit it to NFC Wallet SDK configuration and initialization.

Avoid other operations in the first 0.5 seconds after Application.onCreate() starts. Parallel work can delay APDU handling when Android sends APDU commands to the POS terminal.

If needed, delay non-payment work by at least 0.5 seconds after SDK initialization completes.

Activate pre-entry

Use pre-entry to support single-tap payments.

Pre-entry lets the end user authenticate before the payment flow starts.

Authentication happens when the end user unlocks the device with biometrics or device keyguard (PIN, pattern, or password). This enables a payment without an additional verification step.

Only one payment is allowed per device unlock when this mode is enabled.

Last updated

Was this helpful?