ภาพรวมของ Near Field Communication (NFC)
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Near Field Communication (NFC) คือชุดเทคโนโลยีไร้สายระยะสั้น ซึ่งโดยทั่วไปต้องใช้ระยะห่างไม่เกิน 4 ซม. เพื่อเริ่มต้นการเชื่อมต่อ NFC ช่วยให้คุณแชร์ข้อมูลขนาดเล็กระหว่างแท็ก NFC กับอุปกรณ์ Android หรือระหว่างอุปกรณ์ Android 2 เครื่อง
แท็กมีความซับซ้อนได้หลายระดับ แท็กแบบง่ายมีความหมายเชิงอ่านและเขียนเท่านั้น ในบางครั้งอาจมีส่วนที่โปรแกรมได้แบบครั้งเดียวเพื่อทำให้การ์ดเป็นแบบอ่านอย่างเดียว แท็กที่ซับซ้อนมากขึ้นจะดำเนินการทางคณิตศาสตร์ และมีฮาร์ดแวร์การเข้ารหัสเพื่อตรวจสอบสิทธิ์เข้าถึงภาค แท็กที่ซับซ้อนที่สุดจะมีสภาพแวดล้อมการทํางาน ซึ่งช่วยให้มีการโต้ตอบที่ซับซ้อนกับโค้ดที่ทํางานในแท็ก ข้อมูลที่จัดเก็บไว้ในแท็กยังเขียนในรูปแบบต่างๆ ได้ด้วย แต่ API เฟรมเวิร์ก Android จำนวนมากจะอิงตามมาตรฐาน NFC Forum ที่เรียกว่า NDEF (NFC Data Exchange Format)
อุปกรณ์ Android ที่มี NFC รองรับโหมดการทํางานหลัก 2 โหมดพร้อมกัน ดังนี้
- โหมดเครื่องอ่าน/เครื่องเขียน ซึ่งช่วยให้อุปกรณ์ NFC อ่านและเขียนแท็กและสติกเกอร์ NFC แบบพาสซีฟได้
- โหมดการจําลองบัตร ซึ่งช่วยให้อุปกรณ์ NFC ทำหน้าที่เป็นบัตร NFC ได้ จากนั้นตัวอ่าน NFC ภายนอก เช่น เครื่องชำระเงิน ณ จุดขาย NFC จะเข้าถึงการ์ด NFC ที่จำลองได้
- ข้อมูลพื้นฐานเกี่ยวกับ NFC
- เอกสารนี้อธิบายวิธีที่ Android จัดการแท็ก NFC ที่ค้นพบและวิธีแจ้งให้แอปพลิเคชันทราบเกี่ยวกับข้อมูลที่เกี่ยวข้องกับแอปพลิเคชัน นอกจากนี้ ยังอธิบายวิธีใช้ข้อมูล NDEF ในแอปพลิเคชันและให้ภาพรวมของ API เฟรมเวิร์กซึ่งรองรับชุดฟีเจอร์ NFC พื้นฐานของ Android
- NFC ขั้นสูง
- เอกสารนี้จะอธิบาย API ที่เปิดใช้เทคโนโลยีแท็กต่างๆ ที่ Android รองรับ เมื่อไม่ได้ทำงานกับข้อมูล NDEF หรือเมื่อทำงานกับข้อมูล NDEF ที่ Android เข้าใจได้ไม่สมบูรณ์ คุณจะต้องอ่านหรือเขียนลงในแท็กด้วยตนเองในรูปแบบไบต์ดิบโดยใช้สแต็กโปรโตคอลของคุณเอง ในกรณีเหล่านี้ Android จะให้การสนับสนุนในการตรวจหาเทคโนโลยีแท็กบางรายการและเปิดการสื่อสารกับแท็กโดยใช้สแต็กโปรโตคอลของคุณเอง
- การจําลองบัตรแบบโฮสต์
- เอกสารนี้อธิบายวิธีที่อุปกรณ์ Android ทำงานเป็นบัตร NFC ได้โดยไม่ต้องใช้องค์ประกอบที่ปลอดภัย ซึ่งช่วยให้แอปพลิเคชัน Android จำลองบัตรและสื่อสารกับเครื่องอ่าน NFC ได้โดยตรง
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[[["เข้าใจง่าย","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-26 UTC"],[],[],null,["# Near field communication (NFC) overview\n\nNear Field Communication (NFC) is a set of short-range wireless technologies,\ntypically requiring a distance of 4 cm or less to initiate a connection. NFC\nlets you share small payloads of data between an NFC tag and an\nAndroid-powered device, or between two Android-powered devices.\n\nTags can range in complexity. Simple tags offer just read and write semantics,\nsometimes with one-time-programmable areas to make the card read-only. More\ncomplex tags offer math operations, and have cryptographic hardware to\nauthenticate access to a sector. The most sophisticated tags contain operating\nenvironments, allowing complex interactions with code executing on the tag. The\ndata stored in the tag can also be written in a variety of formats, but many of\nthe Android framework APIs are based around a [NFC\nForum](http://www.nfc-forum.org/) standard called NDEF (NFC Data Exchange\nFormat).\n\nAndroid-powered devices with NFC simultaneously support two main modes of\noperation:\n\n1. **Reader/writer mode**, allowing the NFC device to read and write passive NFC tags and stickers.\n2. **Card emulation mode**, allowing the NFC device itself to act as an NFC card. The emulated NFC card can then be accessed by an external NFC reader, such as an NFC point-of-sale terminal.\n\n**[NFC Basics](/develop/connectivity/nfc/nfc)**\n: This document describes how Android handles discovered NFC tags and how it\n notifies applications of data that is relevant to the application. It also\n goes over how to work with the NDEF data in your applications and gives an\n overview of the framework APIs that support the basic NFC feature set of\n Android.\n\n**[Advanced NFC](/develop/connectivity/nfc/advanced-nfc)**\n: This document goes over the APIs that enable use of the various tag\n technologies that Android supports. When you are not working with NDEF data,\n or when you are working with NDEF data that Android cannot fully understand,\n you have to manually read or write to the tag in raw bytes using your own\n protocol stack. In these cases, Android provides support to detect certain\n tag technologies and to open communication with the tag using your own\n protocol stack.\n\n**[Host-based Card Emulation](/develop/connectivity/nfc/hce)**\n: This document describes how Android devices can perform as NFC cards without\n using a secure element, allowing any Android application to emulate a card\n and talk directly to the NFC reader."]]