是否可以将NFC数据从一台Android设备传输到另一台设备而无需“触摸到Beam'屏幕? [英] Is it possible to transfer NFC data from one Android device to another without the 'Touch to Beam' screen?

查看:88
本文介绍了是否可以将NFC数据从一台Android设备传输到另一台设备而无需“触摸到Beam'屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将NFC数据从一台Android设备发送到另一台.我能够使用触摸到光束"功能成功完成此操作.但是,我希望两台设备同时安装后即可自动进行数据传输.

I am trying to send NFC data from one Android device to another. I was able to do it successfully using the 'Touch to Beam' functionality. But I would like the data transfer to take place automatically as soon as both the devices are together.

我在StackOverflow中多次看到了这个问题.不幸的是,尽管有人说不可能以这种方式将NFC数据从一台Android设备发送到另一台设备,但另一些人则建议尝试前台派遣"(现已弃用官方文件).尽管我不确定是由于我的错误而导致的,但前景调度"并没有取得成功.1年前,几乎所有问题都得到了回答,所以我想知道Google是否为实现这一目标做出了一些改变.我的两个设备都在Android 4.0或更高版本上,但不是4.4.

I saw this question answered in StackOverflow multiple times. Unfortunately, while some say its not possible to send NFC data from one Android device to another this way, some others suggest to try "foreground-dispatching" (which the official documents say is now deprecated). I wasn't successful with "foreground dispatching" though I am not entirely sure if its due to my mistake. Almost all the questions were answered 1 year back, so I was wondering if Google changed something to achieve this. Both my devices are on Android 4.0 or later, but not 4.4.

推荐答案

在两个Android(4.0+)设备之间使用NFC对等通信(也称为Android Beam)时,无法避免Beam UI.因此,如果没有"Touch to Beam",就无法传输数据.

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(有效地是Android 2.3.3-2.3.7)之前,可以通过前台NDEF推送(现在(a)已弃用,而在Android 4.0+上通过Beam实现了(b))实现了这一点.在这种情况下,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 "Push to Beam" window.

仅从Android 4.4开始,可以在不使用Beam UI的情况下通过NFC在两个Android设备之间进行通信(实际上完全不使用Android Beam和对等模式):如果两个设备均为4.4+,则一个设备可以使用Android HCE来仿真非接触式智能卡,而一台设备可以使用读取器模式API(这仅适用于4.4中引入的读取器模式API,因此两个设备都必须为4.4+)才能与仿真的智能卡进行通信.

Only 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.

这篇关于是否可以将NFC数据从一台Android设备传输到另一台设备而无需“触摸到Beam'屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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