android nfc(官方翻译)

  次阅读 作者:智能小宝 来源:互联网 2015-09-28 16:15 我要评论(0)

为了充分详细的学习nfc相关的知识,决定阅读官方英文文档,并翻译下来供大家阅读。

NFC Basics

There are two major uses cases when working with NDEF data and Android:

Reading NDEF data from an NFC tag

Beaming NDEF messages from one device to another with Android Beam?

The Tag Dispatch System

Parsing the NFC tag and figuring out the MIME type or a URI that identifies the data payload in the tag.

解析NFC标签,计算出MINE类型或者一个URI,用于标示数据负载的身份

Encapsulating the MIME type or URI and the payload into an intent. These first two steps are described in How NFC tags are mapped to MIME types and URIs.

封装MIME类型或者URI和负载放入intent对象,这两步由 How NFC tags are mapped to MIME types and URIs描述。

Starts an activity based on the intent. This is described in How NFC Tags are Dispatched to Applications.

启动一个activity根据这个intent对象,这部分由How NFC Tags are Dispatched to Applications.描述

How NFC tags are mapped to MIME types and URIs(NFC标签是如何映射到MINE类型和URI的?)

Before you begin writing your NFC applications, it is important to understand the different types of NFC tags, how the tag dispatch system parses NFC tags, and the special work that the tag dispatch system does when it detects

an NDEF message. NFC tags come in a wide array of technologies and can also have data written to them in many different ways. Android has the most support for the NDEF standard, which is defined by the NFC Forum.

在你开始写NFC应用之前,理解不同类型的NFC标签,标签调度系统如何解析NFC标签,当标签调度系统检测到NDEC message所要做的特殊工作,NFC标签来着不同类型的技术,写入标签有不同的方式,Android推荐使用NDEF标准,它是由NFC社区发起的

NDEF data is encapsulated inside a message (NdefMessage) that contains one or more records (NdefRecord). Each NDEF record must be well-formed according to the specification of the type of record that you want to create. Android

also supports other types of tags that do not contain NDEF data, which you can work with by using the classes in the android.nfc.tech package. To learn more about these technologies, see the Advanced NFC topic. Working with these other types of tags involves

writing your own protocol stack to communicate with the tags, so we recommend using NDEF when possible for ease of development and maximum support for Android-powered devices.

NDEF数据封装在一个由多个NdefRecord组成的NdefMessage中,每一个NDEF记录必须是格式良好的根据你要创建的具体类型,Android也支持其他不包含NDEF数据的类型,你能够使用android.nfc.tech进行工作,为了学习这些技术,请看Advanced NFC topic,操作这些标签会牵涉到你自己的协议栈和标签进行交流,因此为了简化开发和最大化支持android设备,我们建议使用NDEF尽可能。

Note: To download complete NDEF specifications, go to the NFC Forum Specification Download site and see Creating common types of NDEF records for examples of how to construct NDEF records.

注意:为了下载完整的NDEF详情,去NFC社区下载然后阅读如何构建公共类型的NDEF记录的例子。

Now that you have some background in NFC tags, the following sections describe in more detail how Android handles NDEF formatted tags. When an Android-powered device scans an NFC tag containing NDEF formatted data, it parses

the message and tries to figure out the data's MIME type or identifying URI. To do this, the system reads the first NdefRecord inside the NdefMessage to determine how to interpret the entire NDEF message (an NDEF message can have multiple NDEF records). In

a well-formed NDEF message, the first NdefRecord contains the following fields:

现在你要具有NFC标签的背景,如下部分描述如何如何处理NDEF格式标签的更多详情。当一个android支持的设别检测到NFC包含NDEF格式的标签后,解析里面的信息然后试图计算数据的MIME类型和URI身份,为了读取它,系统阅读NDEF信息的第一个记录然后说明整个NDEF信息(一个NDEF信息有多个NDEF记录),在一个格式良好的NDEF信息内,第一个NdefRecord包含如下字段:

本站文章信息来源于网络以及网友投稿,本站只负责对文章进行整理、排版、编辑,是出于传递更多信息之目的,并不意味着赞同其观点或证实其内容的真实性。如果您有什么意见或建议,请联系QQ28-1688-302!

人工智能实验室
相关文章相关文章
  • 英国研发“杀生”机器人 通过生命体获取能量

    英国研发“杀生”机器人 通过生命体获取能量

  • 无人驾驶汽车如何改变城市生活?听听他们怎么说

    无人驾驶汽车如何改变城市生活?听听他们怎么说

  • 韩春雨称已能重复实验结果 近期将有消息公布

    韩春雨称已能重复实验结果 近期将有消息公布

  • 未来两年人工智能要怎么走?看这篇就够了

    未来两年人工智能要怎么走?看这篇就够了

网友点评网友点评
阅读推荐阅读推荐

据国外媒体报道,在过去两年内,聊天机器人(chatbot)、人工智能以及机器学习的研发和采用取得了巨大进展。许多初创公司正利用人工智能和...

霍金 视觉中国 图 英国著名物理学家霍金(Stephen Hawking)再次就人工智能(AI)发声,他认为:对于人类来说,强大AI的出现可能是最美妙的...

文|郑娟娟 今年,人工智能(AI) 60岁了。在AI60岁的时候,笔者想要介绍一下AI100,一个刚刚2岁的研究项目,但它的预设寿命是100年,甚至更长...

AlphaGo与李世石的人机大战,为大众迅速普及了人工智能的概念。 但对谷歌而言,除了下围棋,现在的人工智能进展到哪一步了?未来,人工智能...