اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
مزامنة الدفعات التي تتم خارج المضيف باستخدام تقنية NFC
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يتوافق Android مع ميزة محاكاة بطاقة NFC باستخدام عنصر آمن لمحاكاة البطاقة خارج المضيف. (لمزيد من المعلومات، يُرجى الاطّلاع على
نظرة عامة على ميزة "محاكاة البطاقة المستندة إلى المضيف".)
ومع ذلك، على نظام Android الأساسي، لا تتم دائمًا مزامنة خدمة الدفع المفضّلة المحدّدة في إعدادات "الدفع بدون تلامس" مع التطبيق في العنصر
المؤمّن. وهذا يعني أنّه من الممكن أن يتم استخدام خدمة دفع غير مفضّلة في
العنصر الآمن بدلاً من خدمة الدفع المفضّلة.
في نظام التشغيل Android 11، توفّر ميزة مزامنة الدفع خارج المضيف
آلية تتيح لك مزامنة إعدادات الدفع
في ميزة "انقر وادفع" وإعدادات التوجيه في واجهة العميل
للدفع بدون تلامس الأجهزة (CLF) والحالة التي يختارها التطبيق في العنصر الآمن.
يوضّح الرسم البياني التالي بنية تصميم ميزة "مزامنة الدفعات" التي لا تعمل على المضيف.
الشكل 1. بنية تصميم ميزة مزامنة الدفعات بلا مضيف
التنفيذ
لتنفيذ ميزة مزامنة الدفعات بلا إنترنت، يجب أن يكون الجهاز مزوّدًا
بوحدة تحكّم في تقنية NFC متوافقة مع معيار NCI 2.0، ويجب أن يستخدم إطارَي عمل Android
Open Source Project NFC وOpen Mobile Application Programming Interface
(OMAPI).
واجهات برمجة التطبيقات لإطار العمل
لتنفيذ مزامنة الدفعات بلا مضيف، استخدِم واجهات برمجة تطبيقات الإطار التالي
المتوفّرة في مشروع Android Open Source Project:
للتحقّق من صحة تنفيذ ميزة مزامنة الدفع خارج المضيف،
ثبِّت تطبيقات العناصر الآمنة التي تتضمّن عناصر آمنة مقابلة، ثم تحقَّق
من تلقّي استجابات مناسبة من قارئ NFC في ظروف مختلفة.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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."]]