5

If I have an NFC reader/writer device, can I get it to detect my NFC enabled android phone, so that I may be able to transfer data from my phone to the device? I have found some links on Stackoverflow related to card emulation but they all say that card emulation is not possible or is too difficult

How to make an android phone act as Contactless smart card?
NFC card emulation Android
Can an Android NFC phone act as an NFC tag?
NFC - p2p mode scenario
NFC Peer2Peer Mode - Android Beam - ISO 18092
Galaxy Nexus 4.1.1 and ISO14443 reader

But a pdf document I found online says

Card emulation mode is based on ISO standards ISO 14443-A and ISO 14443-B, which are endorsed by the NFC Forum.

Moreover, it further says that P2P mode is also endorsed by the NFC forum, which, if I understood it correctly, is also like one phone working in reader emulation mode while the other working in card emulation mode

So if I have an NFC enabled phone, and USB reader/write, such as, say, THIS ONE, can I get it to detect my phone as an NFC device and transfer some data from my phone to the reader/writer?

---EDIT---
Note: I am not talking about getting the phone to work as a secure payment system or anything like that, my question is more basic: If I send out some data (say a string "ABC" or some number 1234) from my phone using NFC, can I get the external reader/writer to detect it?

Community
  • 1
  • 1
user13267
  • 6,871
  • 28
  • 80
  • 138

2 Answers2

1

An NFC device running in P2P mode can receive data from an Android phone using Android Beam.

The NFC device has to implement an "NFC Forum Default SNEP Server", which is the equivalent of an Android Beam receiverAndroid Beam receiver.

There are various libraries and tools to do this, the one I can talk about is the Python based NFCPy, it comes with a beam.py example program that does it out of the box.

New Alexandria
  • 6,951
  • 4
  • 57
  • 77
0

It didn't used to be possible at all without some awkward hacks however things have changed.

You can now access the secure element for example. If you want to have your emulate a Mifare card for example then you can use this I believe (see here).

Or if you want it to emulate a more advanced card (such an NFC credit card) then try following the instructions on this great blog. This will require you to have a rooted phone and run Cyanogenmod.

I haven't tried the first method but the one which requires Cyanogenmod I've tested and written an application that allows my Nexus S to communicate with an ACR122 reader and send arbitrary data.

Community
  • 1
  • 1
Peanut
  • 2,221
  • 1
  • 26
  • 37
  • Currently I cannot use any method that requires rooting the phone; I need to be able to do this using the android system that comes out of the box with the phone. One thing I still don't get though is, if a phone can act as a card writer, then it should be able to send out data easily. What is the difference between sending out data as a card writer, sending out data as a phone in P2P mode, and sending out data while acting as a card for an external card reader? – user13267 Aug 06 '13 at 00:27
  • It can send out data easily, sending out data P2P is very limited by the Android software, not by the hardware and that's the problem, Android locks down a lot of the functionality. If the phone is acting as a MiFare card during emulation then cards are 'dumb', they can only responsd to data received, not send out information of their own accord. – Peanut Aug 06 '13 at 00:29
  • so that means I cannot have the phone act as a card writer and send out data, which is then read by my external reader as the data read from a card? – user13267 Aug 06 '13 at 00:42
  • where can I read more about limitations of P2P and what kind of functionality is locked down? – user13267 Aug 06 '13 at 00:43
  • This was actually meant as a comment to this answer and not as a seperate answer to the original question: As an example, the ismb-snep-java (https://code.google.com/p/ismb-snep-java/) library enables communication between an ACR122U NFC reader and standard Android NFC devices. – Michael Roland Oct 22 '13 at 19:27