使得NFC /光束更加自动化 [英] Making NFC/Beam more automatic

查看:250
本文介绍了使得NFC /光束更加自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加入NFC /梁能力我的应用程序,我希望它尽可能地自动工作。我想获得从发送者和接收者屏幕扫描新标记摆脱了触摸梁屏幕。基本上,我想它的工作像它在三星商用呢!我的计算器,它看起来可能没有摆脱触摸梁屏幕的方式读出,但我希望有人有一些更新的信息,或者知道如何删除接收画面。谢谢!

I am adding NFC/Beam capabilities to my app and I would like it to work as automatically as possible. I would like to get rid of the "Touch To Beam" screen from the sender and the "New tag scanned" screen from the receiver. Basically, I want it to work like it does in the Samsung commercial!!! I read in stackoverflow that it seems like there may not be a way to get rid of the "Touch To Beam" screen, however I am hoping someone has some updated information or knows how to remove the receiver screen. Thanks!

推荐答案

在使用NFC对等网络两款Android之间的通信(又名Android Beam功能)(4.0+)设备,没有办法避免梁UI。因此,它是不可能没有触摸到梁。

Sending side

When using NFC peer-to-peer communication (aka Android Beam) between two Android (4.0+) devices, there is no way to avoid the Beam UI. So it is not possible to transfer data without the "Touch to Beam".

在Android Beam功能(有效的Andr​​oid 2.3.3-2.3.7),这是有可能通过前台NDEF推送(现在是(一)德precated及(b)在Android 4.0+通过光束实现)。在没有触摸到梁窗口立即转移这种情况下NDEF消息。

Before Android Beam (effectively Android 2.3.3-2.3.7), this was possible through foreground NDEF push (which is now (a) deprecated and (b) on Android 4.0+ implemented through Beam). In that case NDEF messages where immediately transfered without the "Touch to Beam" window.

与Android 4.4开始,存在这样的可能性,以无梁UI在NFC两款Android设备之间的通信(实际上不使用Android Beam功能和对等网络模式的话):如果两个设备都是4.4或以上版本,一台设备可以使用Android HCE来模拟非接触智能卡和一台设备可以使用读取器 - 模式API(这仅在4.4引入读卡器模式API的工作,所以两个设备需要4.4+)与模拟的智能卡进行通信。

Starting with Android 4.4, there is the possibility to communicate between two Android devices over NFC without the Beam UI (actually without using Android Beam and peer-to-peer mode at all): If both devices are 4.4+, one device can use Android HCE to emulate a contactless smartcard and one device can use the reader-mode API (this only works with the reader-mode API introduced in 4.4, so both devices need to be 4.4+) to communicate with the emulated smartcard.

如果您通过光束发送NDEF消息,你至少可以得到接收端做你想要什么。在这种情况下,您需要在应用的Andr​​oidManifest.xml注册一个合适的NDEF_DISCOVERED意图过滤器(即发送NDEF消息的第一NDEF记录的记录类型/数据类型匹配)。

If you send an NDEF message through Beam, you can at least get the receiving side to do what you want. In that case, you need to register a proper NDEF_DISCOVERED intent filter (that matches the record type/data type of the first NDEF record of the sent NDEF message) in your app's AndroidManifest.xml.

这篇关于使得NFC /光束更加自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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