Android NFC 手机可以充当 NFC 标签吗?

发布于 2024-11-09 17:17:05 字数 121 浏览 0 评论 0原文

据我目前的了解,NFC 手机将充当 NFC 读取器,从 NFC 标签读取数据。现在我的问题是,我们可以改变这一点吗?我们能否让 Android NFC 手机充当 NFC 读取器从中获取数据的标签?

感谢您的帮助。

From what I have understood so far, an NFC phone will act as an NFC reader which will read data from an NFC tag. Now my question is, can we switch this around? Can we make an Android NFC phone behave as the tag which an NFC reader will get data from?

Thanks for your assistance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

榆西 2024-11-16 17:17:05

此时,我会回答“否”或“有困难”,但随着 Android NFC API 的发展,这种情况可能会随着时间而改变。

NFC 交互共有三种模式:

  1. 读写器:手机读取标签并写入标签。它不是模拟卡,而是模拟 NFC 读取器/写入器设备。因此,您无法在此模式下模拟标签。

  2. 点对点:手机可以读取并传回ndef消息。如果标签阅读器支持点对点模式,那么手机就可以充当标签。但是,我不确定 android 是否在 LLCP 协议(​​NFC 逻辑链路协议)之上使用自己的协议,这会阻止大多数读者将手机视为 nfc 标签。

  3. 卡模拟模式:手机使用安全元件来模拟智能卡或其他非接触式设备。我不确定这是否已经启动,但可能会带来希望。但是,使用安全元素可能需要硬件供应商或其他人验证您的应用程序/授予其访问安全元素的权限。它并不像创建常规 NFC Android 应用程序那么简单。

更多详细信息请参见此处:
http://www.mail-archive.com/[email protected]/msg152222.html

一个真正的问题是:你为什么要模仿一个简单的旧NFC标签?有什么我没有想到的应用程序吗?通常,您想要模拟交通卡、访问密钥或信用卡等需要安全元素的东西(我认为,但不确定)。

At this time, I would answer "no" or "with difficulty", but that could change over time as the android NFC API evolves.

There are three modes of NFC interaction:

  1. Reader-Writer: The phone reads tags and writes to them. It's not emulating a card instead an NFC reader/writer device. Hence, you can't emulate a tag in this mode.

  2. Peer-to-peer: the phone can read and pass back ndef messages. If the tag reader supports peer-to-peer mode, then the phone could possibly act as a tag. However, I'm not sure if android uses its own protocol on top of the LLCP protocol (NFC logical link protocol), which would then prevent most readers from treating the phone as an nfc tag.

  3. Card-emulation mode: the phone uses a secure element to emulate a smart card or other contactless device. I am not sure if this is launched yet, but could provide promising. However, using the secure element might require the hardware vendor or some other person to verify your app / give it permissions to access the secure element. It's not as simple as creating a regular NFC android app.

More details here:
http://www.mail-archive.com/[email protected]/msg152222.html

A real question would be: why are you trying to emulate a simple old nfc tag? Is there some application I'm not thinking of? Usually, you'd want to emulate something like a transit card, access key, or credit card which would require a secure element (I think, but not sure).

无风消散 2024-11-16 17:17:05

我们可以制作一个 Android NFC 作为 NFC 读取器从中获取数据的标签吗?

Nexus S 支持点对点模式,即它的名字暗示,使一部手机充当另一部手机可以读取的标签。这是一次非常精彩的 Google I/O 会议 今年的 NFC。如果您对 NFC 感兴趣,我建议您观看它。

Can we make an Android NFC as the tag which an NFC reader will get data from?

The Nexus S supports peer-to-peer mode, which as its name implies, causes one phone to act as a tag which another phone can read. There was a really good Google I/O session on NFC this year. I would recommended watching it if you're at all interested in NFC.

做个ˇ局外人 2024-11-16 17:17:05

检查 Android 4.4 中可用的基于主机的卡模拟 (HCE) NFC 模式。

API 指南:https://developer.android.com/guide/topics/connectivity/nfc/hce .html

Check the Host-based Card Emulation (HCE) NFC mode available in Android 4.4.

API guide: https://developer.android.com/guide/topics/connectivity/nfc/hce.html

不再见 2024-11-16 17:17:05

是的,你可以。 Android kitkat 在此处增强了此功能

yes you can. Android kitkat boosts of this functionality here

瑾夏年华 2024-11-16 17:17:05

可以让 Android 设备充当 NFC 标签。这种行为称为卡模拟

  • 卡仿真可以是基于主机的 (HCE) 或基于安全元件的 (CE)。
  • 在 HCE 中,运行在 Android 主处理器上的应用程序响应读取器。所以,手机需要开机。
  • 在CE中,驻留在安全元件中的小程序对读取器做出响应。在这里,为 NFC 控制器供电就足够了,而设备的其余部分则暂停。
  • 其中一种或两种方法可以同时激活。
    路由表指示 NFC 控制器将读取器的命令路由到何处。

Its possible to make Android device behave as an NFC Tag. Such a behaviour is called Card Emulation.

  • Card emulation can be host-based(HCE) or secure-element based(CE).
  • In HCE, an application running on the Android main processor responds to the reader. So, the phone needs to be ON.
  • In CE, an applet residing in the Secure element responds to the reader. Here, its sufficient to have the NFC controller powered, with rest of the device suspended.
  • One of these or both approaches can be active simultaneously.
    A routing table instructs the NFC controller where route the Reader's commands to.
生生不灭 2024-11-16 17:17:05

是的,看看 NFCManager 中的 NDEF Push - 使用 Android 4,您现在甚至可以创建 NDEFMessage 以在交互发生时推送到活动设备。

Yes, take a look at NDEF Push in NFCManager - with Android 4 you can now even create the NDEFMessage to push to the active device at the time the interaction takes place.

挽袖吟 2024-11-16 17:17:05

请阅读此处:http://groups.google.com/group/android-developers/browse_thread/thread/d5fc35a9f16aa467/dec4843abd73d9e9%3Flnk%3Dgst%26q%3Dsecure%2Belement%2Bdiff%2527s%23dec4843abd73d9e9?pli=1< /a>

我自己还没有证实这一点,但看起来人们设法再次将隐藏代码包含到 Android 中。
他们似乎能够模拟 Mifare Classic 卡 (iso-14443)。
我很快就会亲自测试一下,它看起来很有趣。

如果您想为商业/免费应用程序执行此操作,您将遇到困难,您的用户不会喜欢更改其内核来支持您的应用程序。

更新:
有一个简单的技巧可以让您的手机模拟票证:
您可以获取 NFC 贴纸并将其放入手机中或手机上。这样您就可以随时读取和写入它,其他设备也可以读取和写入它。
这只是我的一个想法,当然从未见过在任何地方使用过;)

Read here: http://groups.google.com/group/android-developers/browse_thread/thread/d5fc35a9f16aa467/dec4843abd73d9e9%3Flnk%3Dgst%26q%3Dsecure%2Belement%2Bdiff%2527s%23dec4843abd73d9e9?pli=1

I've not verified that myself but it looks like people managed to include the hidden code into Android again.
They seem to be able to emulate a Mifare Classic card (iso-14443).
I'll soon test this myself, it looks very interesting.

If you want to do it for a commercial/free app you'll have a hard time, your users won't like to change their kernel to support your app.

Update:
There would be a simple trick to make your phone emulate a ticket:
You can get a NFC-sticker and put it in or on the phone. This way you are able to read and write it at all times and other devices can also read and write it.
It's just an idea I had, never seen that used anywhere of course ;)

风和你 2024-11-16 17:17:05

在关于 NFC 的 google io 会议中,qa 部分。有这样一个问题:

卡模拟?
不支持卡模拟的 API
进行卡牌模拟时没有一致的用户体验,也没有引人入胜的故事

In the google io session about NFC, qa section. There was such a question:

card emulation?
No API support for card emulation
No consistent user experience when doing card emulation and no compelling story

牵你手 2024-11-16 17:17:05

如果您的意思是让一个通电的 NFC 设备假装成无源设备(例如标签).. 不确定它的工作效果如何,但 android 应用程序 NFCClassic 声称可以记录标签内容,然后允许激活标签并显示为将复制的标签复制到 NFC 读取器。创建记录标签库。

If you mean getting a powered NFC device to pretend to be a passive one (eg a tag).. not sure how well it works but the android app NFCClassic purports to record tag contents and then allow the tag to be activated and appear to be the copied tag to NFC readers. Creates a library of recorded tags.

|煩躁 2024-11-16 17:17:05

不,目前还不行。谷歌在Google IO 2011上指出,不支持并且暂时不会支持卡模拟。主要(且易于理解)问题:哪个应用程序应该在手机上获得模拟智能卡的权限?

No, not at the moment. Google pointed out at the Google IO 2011, that card emulation is not supported and won't be supported for a while. Main (and easy to understand) problem: Which App should get the right on the phone to emulate a smartcard?

浪菊怪哟 2024-11-16 17:17:05

您绝对可以使用点对点支持中的 NDEFPush 功能使 Android 手机写入标签读取器 - 但您需要在标签读取器端编写代码才能使用点对点 (llcp) 。

You can definitely make an Android phone write to a tag reader using the NDEFPush functionality in the peer-to-peer support - but you will need to write the code on the tag reader side to use peer-to-peer as well (llcp).

失退 2024-11-16 17:17:05

是的,您可以,这就是点对点模式

点对点模式


双向P2P连接在设备之间交换数据

– 接近触发交互

– Nexus S:设备必须背对背放置

应用示例

交换电子卡 –

门票和门票的移交P2P支付

——网页共享、Youtube视频共享——

应用程序共享

Yes you can which is Peer-To-Peer Mode

Peer-To-Peer Mode


Bidirectional P2P connection to exchange data between devices

–Proximity triggered interactions

–Nexus S: Devices have to be placed back-to-back

Example of Applications

–Exchange of vCards

–Hand-over of Tickets & P2P Payment

–Web-page sharing, Youtube-video-sharing

–Application sharing

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文