Control NFC payments on Android
Overview
Android system settings can block contactless payments, even when your digital wallet application is correct.
This page covers the Android controls that impact NFC payments, plus the app-side requirements to support them.
Device settings that affect NFC payments
NFC toggle
Android provides a master NFC switch, similar to Wi‑Fi or mobile data.
NFC must be enabled to execute contactless payments. End users can also disable NFC to block payments.

Require device unlock (Android 12+)
On some devices (Android 12+), NFC can be configured to work only when the device is unlocked.
If enabled, the end user must unlock the device before tapping.

Application source selection (OEM-specific)
Some devices support multiple “payment locations” (for example, secure element vs HCE).
The device hardware routes inbound NFC commands to the selected location.

Default payment application
Android lets the end user choose the default payment application for Tap & Pay.

Digital wallet application requirements (HCE)
Your digital wallet application must declare an HCE service.
The NFC Wallet SDK does not declare the HCE service for you. It provides AbstractHCEService to simplify implementation.
For background, see Host-based card emulation overview.
Detect and request the default payment application
At startup, it is recommended to:
Check whether your HCE service is the default one, using CardEmulation#isDefaultServiceForCategory.
If not, prompt the end user to set your app as the default payment service by launching CardEmulation#ACTION_CHANGE_DEFAULT.
Android displays a system dialog. You cannot change its text, except for your app label.

To observe the user’s choice, call startActivityForResult and check the result in onActivityResult:
Control how your app appears in Android settings
The Tap & Pay / Contactless payments UI varies by OEM, model, and Android version.

Android populates your application entry using resources from:
AndroidManifest.xmlYour payment service metadata resource (declared via
/manifest/application/service/meta-data/@android:resource)
You can control:
Application icon:
/manifest/application/@android:iconPayment service banner: payment service metadata,
/host-apdu-service/@android:apduServiceBannerPayment service label:
/manifest/application/service/@android:labelThis label is also used in the “set default payment app” dialog.
Payment service description: payment service metadata,
/host-apdu-service/@android:description
You cannot control the ordering of applications in the list.
Pay with foreground app
Some devices expose a setting such as Pay with currently open app or Prioritize currently running app.
This setting only means the end user allows foreground apps to override the default payment service. It does not enforce that behavior.
To take advantage of it, implement CardEmulation#setPreferredService and CardEmulation#unsetPreferredService following the Android guidelines.
Recommendations:
Check that foreground preference is enabled using
CardEmulation.categoryAllowsForegroundPreference(CATEGORY_PAYMENT).Implement the default application override as explained earlier.
Warn end users about inconsistent payment experience if your digital wallet application handles contacless transaction only when it is in foreground .
Last updated
Was this helpful?