Android Beam-当只有一个Touch To Beam时会从两个设备传输有效载荷吗? [英] Android Beam - payload transfer from both devices when only one Touch To Beam?

查看:127
本文介绍了Android Beam-当只有一个Touch To Beam时会从两个设备传输有效载荷吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我从2011年在NFC上的演示

Ok, I watched the Google I/O from 2011 presentation on NFC on peer to peer.

该演示是在Gingerbread上完成的,并使用了发现应用程序便笺

The demo was done on Gingerbread and using the application Sticky Notes found

现在在此演示中,两个设备的onNewIntent()同时被调用,因此两个设备都试图彼此共享信息.

Now in this demo, both device the onNewIntent() was called at the same time so both devices are trying to share information to one another.

在ICS及更高版本上,您拥有Android Beam.

On ICS and above, you have Android Beam..

使用Android Beam,您必须触摸触发onNewIntent()事件,该事件将跨发送NDef消息.

With Android Beam, you have to touch to trigger the onNewIntent() event that will send the NDef message across.

现在的问题是,现在要在两个设备上都触发onNewIntent(),每个设备上的两个用户都必须同时触摸到光束".

Now the problem with this is that now to trigger the onNewIntent() on both devices, both user on each device has to "Touch To Beam" at the same time.

有没有一种方法可以使您在一个设备上触摸传光"时,两个都可以调用onNewIntent()?

Is there a way that when you Touch To Beam on one device, both can have the onNewIntent() to be called?

我正在尝试开发一个可以相互交换数据的应用程序,但是为了使其以一种友好的方式工作,一旦在一台设备上启动Touch To Beam,我需要这些设备在同一时间共享数据.我希望这是可能的.

I am trying to develop an app that will exchange data to each other but for it to work in a nice friendly fashion I need the devices to share the data at the same time once the Touch To Beam has been initiated on one device. I do hope this is possible.

编辑:看起来之类的,可能无法做到:(

It looks like this might not be possible to do :(

推荐答案

据我所知,所需的功能无法通过NFC本身使用.触摸光束/SNEP/NPP传输仅在Android上是一个方向.单击其屏幕的用户将向另一部手机推送NDEF消息.

As far as I can tell, the feature you want is not available over NFC itself. The touch-to-beam/SNEP/NPP transfer is one direction only on Android. The user that clicks his screen will push an NDEF message to the other phone.

我相信他们在视频中所做的是与NDEF消息建立了蓝牙连接以进行传输(如您在stickynotes演示中所看到的).不幸的是,没有很好的API.

What I believe they've done in the video is set up a bluetooth connection with the NDEF message to make the transfer (as you saw in the stickynotes demo). Unfortunately there is no nice API for this.

但是,EasyNFC项目有望使您能够在两个电话/应用程序之间创建蓝牙连接和套接字.在此处

However, the EasyNFC project promises to be able to allow you to create a bluetooth connection and socket between two phones/applications. Check it out here

我尝试了一下,但并不太喜欢蓝牙连接设置中仍然需要的触摸到光束" UI.它也不能真正满足我的需求,因为我想将电话转移到计算机上,也不想真正实现NFC P2P和蓝牙连接.

I had a try and didn't really like the Touch-to-Beam UI that was still required in the set up of the bluetooth connection. It also didnt really suit my needs, as I wanted to transfer phone to computer and didn't really want to implement NFC P2P and a bluetooth connection.

这篇关于Android Beam-当只有一个Touch To Beam时会从两个设备传输有效载荷吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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