Android的NFC:SNEP协议和P2P响应 [英] Android NFC : SNEP protocol and P2P response

查看:690
本文介绍了Android的NFC:SNEP协议和P2P响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现两个Android手机(其中一人将通过一个独立的设备最终被替换)之间的P2P通信。我已经看到了安卓4.0支持SNEP这是由NFC论坛公布,并应可在非Android设备。

I am trying to implement a P2P communication between two Android phones (one of them will be replaced by an independent device in the end). I have seen that Android 4 supports SNEP which is published by the NFC forum and should be available on non-android devices.

我有以下的谷歌教程NFC P2P(http://developer.android.com/guide/topics/nfc/nfc.html#p2p),我可以从一个手机发送一些信息给对方,但我有几个问题:

I have following the Google tutorial for NFC P2P (http://developer.android.com/guide/topics/nfc/nfc.html#p2p) and I can send some information from one phone to the other, but I have a few questions:

  1. 在Android的光束仅仅是一个名称,NFC,或者是一款Android协议工作在SNEP / NPP?如果它是一个协议,该怎么办NFC点对点无梁?
  2. 如何设置使用SNEP的?
  3. 如何发送到其他设备的响应,当连接被初始化(接收第一消息)?

感谢您的帮助!

推荐答案

Android的光束只是一个名字,正确的。设备使用SNEP默认情况下,如果失败,它会尝试核电站。不能从接收装置向发送方发送响应真。一个成功的推只能使用一个回调来通知:

Android Beam is just a name, correct. Devices use SNEP by default, if that fails, it tries NPP. You can't send a response really from the receiving device to the sender. You can only use a callback to be notified of a successful push:

http://developer.android.com/reference/android/nfc/NfcAdapter.OnNdefPushCompleteCallback.html

这篇关于Android的NFC:SNEP协议和P2P响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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