阅读不特定的应用NFC标签? [英] Read NFC tag without specific application?

查看:243
本文介绍了阅读不特定的应用NFC标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,如果有任何的方式来保存的文本(URL),以NFC标签的字符串,让我们说MIFARE或NTAG203,可以通过其他设备(智能手机),没有任何特殊的标签读取需要读应用。

我已经测试了多种应用,例如触发为Android,并注意到,如果设备读取的标签没有必要的程序读取数据/关闭标签说明它仍然打开,发送您Play商店下载该应用程序的URL。

所以,必须有一种方式来保存一些数据被所有可读/一些NFC功能的手机。简单地说我想创建一个的applcation为Android,将数据写入NFC标签和数据可以读取/开/由随机NFC功能的手机执行。

因此​​,才有可能prepare NFC标签触发读取装置上的一些动作,而不需要特定的应用程序?可能我写的NFC标签的数据类型与我的应用程序来实现这一目标?

解决方案

首先,在一般情况下,我同意CommonsWare的角度来看,它总是一个特殊的应用程序,处理NFC事件。然而,寻找到Android的时候,我会考虑从AOSP不同平台的应用程序为Android系统的一部分。尽管不是所有的人都可以适用于所有的设备。

展望Andrid 4.4+,下面的数据类型是由该系统的应用程序处理的:

  • 在浏览器:使用的URI方案HTTP:和https:开头。
  • 通讯录和拨号器:MIME类型文本/名片和文/ X-名片导入联系人
  • 电子邮件:URI的使用方案电子邮件地址:
(?)

此外,如果没有其他应用程序处理目标标记,NFC设备应具有标签的应用程序,即试图处理各种类型(在用户确认):

  • 的URI方案与电话将导致ACTION_CALL意图打电话给定的数字。
  • 的URI方案与短信/smsto将导致ACTION_SENDTO意图开始编辑的短信。
  • 在其他的URI应该(?)被转发ACTION_VIEW意图。
  • 在MIME类型的记录,类型为文本/ X-名片(如果尚未处理)应该转发在ACTION_VIEW意图。
  • 在文本RTD记录的文字信息(不是text / * MIME类型!)应显示在标签应用程序。不幸的是许多愚蠢的(!)的NFC应用程序注册为文字记录,因此你通常不会得到标签的应用程序。
  • 在MIME类型的记录类型的图像/ *(如果图像类型支持的Andr​​oid)应显示在标签应用程序。

有些记录是由NFC服务本身(这应该永远是在Android)来处理

  • 在Android应用程序记录(NFC论坛外部类型与类型名瓮:NFC:分机:android.com:PKG)引起ACTION_VIEW意图与URI市场://细节ID = {} PACKAGE_NAME是发送。
  • 在NFC论坛外部类型与类型名瓮:NFC:nokia.com:BT被解析为蓝牙连接切换
  • 开头的切换选择RTD记录和包含类型application / vnd.bluetooth.ep.oob的MIME类型的记录NDEF消息被解析为蓝牙连接的切换。

I was wondering if there is any way to save a string of text (URL) to an NFC tag, let us say MIFARE or NTAG203, that can be read by other devices (smartphones) without the need of any special tag reading application.

I have tested several applications, e.g. Trigger for Android, and noticed that if the device reading the tag does not have the required application to read the data/instructions off the tag it still opens a URL that sends you to the Play Store to download that application.

So there must be a way to save some data readable by all/some NFC enabled phones. Simply put I want to create an applcation for Android that will write data to NFC tags and the data can be read/opened/executed by a random NFC enabled phone.

So is it possible to prepare an NFC tag that triggers some action on the reading device without requiring a specific application? What type of data could I write on an NFC tag with my app to achieve this?

解决方案

First of all, in general, I agree with CommonsWare point of view that it's always a "special" app that handles NFC events. However, when looking into Android, I would consider the various platform apps from AOSP as part of the Android system. Even though not all of them may be available on all devices.

Looking into Andrid 4.4+, the following data types are handled by such system apps:

  • Browser: URIs with schemes "http:" and "https:".
  • Contacts and Dialer: MIME types "text/vcard" and "text/x-vcard" for importing contacts.
  • E-mail: URIs with scheme "mailto:"

In addition, if no other app handles a certain tag, NFC devices should(?) have the Tag app, that tries to handle various types (upon user confirmation):

  • URIs with scheme "tel" will cause an ACTION_CALL intent to call the given number.
  • URIs with schemes "sms"/"smsto" will cause an ACTION_SENDTO intent to start editing an SMS message.
  • Other URIs should(?) be forwarded in ACTION_VIEW intents.
  • MIME type records with type "text/x-vcard" (if not already handled) should be forwarded in ACTION_VIEW intents.
  • The text message of Text RTD records (not text/* MIME types!) should be displayed in the Tag app. Unfortunately many stupid(!) NFC apps register for Text records, thus you will normally not get to the Tag app.
  • MIME type records with type image/* (if image type is supported by Android) should be displayed in the Tag app.

Some records are handled by the NFC service itself (this should always be available on Android):

  • Android Application records (NFC Forum external type with type name "urn:nfc:ext:android.com:pkg") cause an ACTION_VIEW intent with the URI "market://details?id={PACKAGE_NAME}" to be sent.
  • NFC Forum external types with type name "urn:nfc:nokia.com:bt" are parsed for Bluetooth connection handover.
  • NDEF messages starting with a Handover Select RTD record and containing a MIME type record of type "application/vnd.bluetooth.ep.oob" are parsed for Bluetooth connection handover.

这篇关于阅读不特定的应用NFC标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆