How to do NFC peer to peer connection in android? [closed]

让人想犯罪 __ 提交于 2019-12-07 20:27:02

问题


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.


回答1:


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

And check out the docs here:

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

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.

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




回答2:


Did you look at http://developer.android.com/resources/samples/NFCDemo/index.html It contains the tutorials you are looking for



来源:https://stackoverflow.com/questions/7803373/how-to-do-nfc-peer-to-peer-connection-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!