Android Near Field Communication

举报
福州司马懿 发表于 2021/11/19 04:15:39 2021/11/19
【摘要】 译自 https://developer.android.google.cn/guide/topics/connectivity/nfc/index.html Near Field Communi...

译自 https://developer.android.google.cn/guide/topics/connectivity/nfc/index.html

Near Field Communication (NFC) is a set of short-range wireless technologies, typically requiring a distance of 4cm or less to initiate a connection. NFC allows you to share small payloads of data between an NFC tag and an Android-powered device, or between two Android-powered devices.

近场通讯(NFC)是一系列的短距离无线通信技术。通常需要4cm或更短的距离来发起连接。NFC允许你在NFC标签和Android设备之间,或两台Android设备之间分享小载荷的数据。

Tags can range in complexity. Simple tags offer just read and write semantics, sometimes with one-time-programmable areas to make the card read-only. More complex tags offer math operations, and have cryptographic hardware to authenticate access to a sector. The most sophisticated tags contain operating environments, allowing complex interactions with code executing on the tag. The data stored in the tag can also be written in a variety of formats, but many of the Android framework APIs are based around a NFC Forum standard called NDEF (NFC Data Exchange Format).

标签的范围可以很复杂。简单的标签只是提供了读写简单语意,有些时候,在一次性编程领域会制作一些只读的卡片。负责的标签提供了数学运算,并且有加密固件对访问的区域进行认证。最复杂的标签包括操作环境,允许在该标签上执行复杂的交互代码。数据可以用各种各样的格式存储到标签上,但是大多数Android框架应用程序接口都基于一个标准的NFC Forum,称为NDEF(NFC Data Exchange Format)。

Android-powered devices with NFC simultaneously support three main modes of operation:

  1. Reader/writer mode, allowing the NFC device to read and/or write passive NFC tags and stickers.
  2. P2P mode, allowing the NFC device to exchange data with other NFC peers; this operation mode is used by Android Beam.
  3. 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.

带NFC的Android设备同时支持了以下三种操作:
1. 读写模式,允许NFC设备被动地读或者写NFC标签和贴纸。
2. P2P模式,允许NFC设备和其它对等的NFC设备交换数据;该操作模式由Android Beam使用。
3. 模拟卡片模式,允许NFC设备自己作为一张NFC卡片。它模拟的NFC卡片接触到外部的NFC读卡器,就像一个NFC销售点终端机。

NFC Basics
(译:NFC基础技术)

This document describes how Android handles discovered NFC tags and how it notifies applications of data that is relevant to the application. It also goes over how to work with the NDEF data in your applications and gives an overview of the framework APIs that support the basic NFC feature set of Android.

该文档描述了Android如何操作已经发现的NFC标签和它如何通知相关的应用程序。它也会让你再温习一遍在你应用内的NDEF数据是如何工作的,并且给出了Android支持的一系列NFC特性的应用程序框架的概要。

Advanced NFC
(译:高级的NFC)

This document goes over the APIs that enable use of the various tag technologies that Android supports. When you are not working with NDEF data, or when you are working with NDEF data that Android cannot fully understand, you have to manually read or write to the tag in raw bytes using your own protocol stack. In these cases, Android provides support to detect certain tag technologies and to open communication with the tag using your own protocol stack.

该文档超过了提供的应用程序接口,允许使用更丰富的Android支持的标签技术。当你不使用NDEF数据,或者当你使用的NDEF数据Android不能够顽强理解时,你就必须使用基于你自己的协议栈的原始的字节数组手动地读写该标签。在这种情况下,Android提供检测已经确定的标签的支持,和使用你自己的协议栈进行通信。

Host-based Card Emulation
(译:基于主机的卡片模拟器)

This document describes how Android devices can perform as NFC cards without using a secure element, allowing any Android application to emulate a card and talk directly to the NFC reader.

该文档描述了如何Android设备在不使用安全元件的情况下怎样才能表现的和NFC卡一样,允许任何Android应用模拟一个卡片直接与NFC读卡器通信。

文章来源: blog.csdn.net,作者:福州-司马懿,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/chy555chy/article/details/53815705

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。