怎么办NFC点对点android系统连接? [英] How to do NFC peer to peer connection in android?

查看:343
本文介绍了怎么办NFC点对点android系统连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做点对点2台NFC功能的设备之间的连接,我需要一些教程这样做,如果有人做了给我链接或解释。

I need to do peer to peer connection between two nfc enabled device, i need some tutorial to do it if anyone done it send me link or explain.

推荐答案

这是样品老德使用precated的API(这仍然需要虽然支持GB)。请看看这一个,而不是如果您正在使用ICS的工作:

That sample is old and uses deprecated APIs (which are still needed though to support GB). Please look at this one instead if you are working with ICS:

http://developer.android.com/resources/samples/AndroidBeamDemo/ index.html的

在这里检查出文档:

http://developer.android.com/guide/topics/ NFC / nfc.html#P2P

基本上,你需要做的就是创建一个用于创建NDEF消息的应用程序,什么寄存器推的消息,并且还创建了Android清单的意图过滤器也筛选所创建的意图,当应用程序推在NDEF消息。

Basically, what you need to do is create an app that creates the NDEF message, registers the message to be pushed, and also creates an intent filter in the android manifest to also filter for the intent that is created when the application pushes the ndef message.

当给设备接触的(安装了应用程序),一台设备将数据推到对方。其他设备有一个意图过滤器,过滤器正确的消息并处理它。

When to devices come in contact (with the application installed), one device will push the data onto the other. The other device has an intent filter that correctly filters for the message and handles it.

这是它的基本机制。退房的Andr​​oid束演示的更多信息。

That's the basic mechanics of it. Check out the Android beam demo for more info.

这篇关于怎么办NFC点对点android系统连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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