Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release, bukan aosp-main, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Android mendukung emulasi kartu NFC dengan elemen pengaman untuk emulasi kartu
di luar host. (Untuk informasi selengkapnya, lihat
Ringkasan emulasi kartu berbasis host.)
Namun, di platform Android, layanan pembayaran pilihan yang ditentukan dalam
setelan Tempel & bayar tidak selalu disinkronkan dengan aplikasi di elemen
aman. Artinya, layanan pembayaran yang tidak dipilih di
elemen aman mungkin digunakan, bukan layanan pembayaran yang dipilih.
Di Android 11, fitur sinkronisasi pembayaran di luar host
menyediakan mekanisme yang memungkinkan Anda menyinkronkan konfigurasi
pembayaran di fitur Tempel & bayar, konfigurasi pemilihan rute di frontend
nirsentuh (CLF), dan status yang dipilih aplikasi di elemen aman.
Diagram berikut mengilustrasikan arsitektur desain fitur sinkronisasi pembayaran
di luar host.
Gambar 1. Arsitektur desain sinkronisasi pembayaran
di luar host
Implementasi
Untuk menerapkan fitur sinkronisasi pembayaran off-host, perangkat harus memiliki
pengontrol NFC yang mendukung standar NCI 2.0 dan harus menggunakan framework
Android Open Source Project NFC dan Open Mobile Application Programming Interface
(OMAPI).
Framework API
Untuk menerapkan sinkronisasi pembayaran di luar host, gunakan API framework berikut
yang ditemukan di Project Open Source Android:
Untuk memvalidasi penerapan fitur sinkronisasi pembayaran off-host,
instal aplikasi elemen aman dengan elemen aman yang sesuai, lalu periksa
respons yang sesuai dari pembaca NFC dalam kondisi yang berbeda.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-27 UTC."],[],[],null,["# NFC off-host payment synchronization\n\nAndroid supports NFC card emulation with a secure element for off-host card\nemulation. (For more information, see\n[Host-based card emulation overview](https://developer.android.com/guide/topics/connectivity/nfc/hce).)\nHowever, on the Android platform, the preferred payment service specified in the\nTap \\& pay setting isn't always synchronized with the app in the secure\nelement. This means it's possible that a nonpreferred payment service in the\nsecure element is used instead of the preferred payment service.\n\nIn Android 11, the *off-host payment synchronization*\nfeature provides a mechanism that lets you synchronize the payment\nconfiguration in Tap \\& pay, the routing configuration on the contactless\nfrontend (CLF), and the app-selected state in the secure element.\n\nThe following diagram illustrates the design architecture of the off-host\npayment synchronization feature.\n**Figure 1.** Off host payment synchronization design architecture\n\nImplementation\n--------------\n\nTo implement the off-host payment synchronization feature, the device must have\nan NFC controller that supports the NCI 2.0 standard and must use the Android\nOpen Source Project NFC and Open Mobile Application Programming Interface\n(OMAPI) frameworks.\n\n### Framework APIs\n\nTo implement off-host payment synchronization, use the following framework APIs\nfound in the Android Open Source Project:\n\n- [`getAidsForPreferredPaymentService()`](https://developer.android.com/reference/android/nfc/cardemulation/CardEmulation#getAidsForPreferredPaymentService()): Retrieves the registered AIDs for the preferred payment service.\n- [`getRouteDestinationForPreferredPaymentService()`](https://developer.android.com/reference/android/nfc/cardemulation/CardEmulation#getDescriptionForPreferredPaymentService()): Retrieves the route destination for the preferred payment service.\n- [`getDescriptionForPreferredPaymentService()`](https://developer.android.com/reference/android/nfc/cardemulation/CardEmulation#getRouteDestinationForPreferredPaymentService()): Returns a user-visible description of the preferred payment service.\n- [`android.permission.NFC_PREFERRED_PAYMENT_INFO`](https://developer.android.com/reference/android/Manifest.permission#NFC_PREFERRED_PAYMENT_INFO) (permission): Allows apps to receive NFC preferred payment service information.\n- [`android.nfc.action.PREFERRED_PAYMENT_CHANGED`](https://developer.android.com/sdk/api_diff/r-dp1/changes/android.nfc.NfcAdapter) (broadcast action): Intent to notify if the preferred payment service changed.\n\nValidation\n----------\n\nTo validate your implementation of the off-host payment synchronization feature,\ninstall secure element apps with corresponding secure elements and then check\nfor appropriate responses from an NFC reader in different conditions."]]