124

From what I have understood so far, an NFC phone will act as an NFC reader which will read data from an NFC tag. Now my question is, can we switch this around? Can we make an Android NFC phone behave as the tag which an NFC reader will get data from?

Thanks for your assistance.

NFC guy
  • 10,151
  • 3
  • 27
  • 58
Joshua Partogi
  • 16,167
  • 14
  • 53
  • 75

14 Answers14

36

At this time, I would answer "no" or "with difficulty", but that could change over time as the android NFC API evolves.

There are three modes of NFC interaction:

  1. Reader-Writer: The phone reads tags and writes to them. It's not emulating a card instead an NFC reader/writer device. Hence, you can't emulate a tag in this mode.

  2. Peer-to-peer: the phone can read and pass back ndef messages. If the tag reader supports peer-to-peer mode, then the phone could possibly act as a tag. However, I'm not sure if android uses its own protocol on top of the LLCP protocol (NFC logical link protocol), which would then prevent most readers from treating the phone as an nfc tag.

  3. Card-emulation mode: the phone uses a secure element to emulate a smart card or other contactless device. I am not sure if this is launched yet, but could provide promising. However, using the secure element might require the hardware vendor or some other person to verify your app / give it permissions to access the secure element. It's not as simple as creating a regular NFC android app.

More details here: http://www.mail-archive.com/android-developers@googlegroups.com/msg152222.html

A real question would be: why are you trying to emulate a simple old nfc tag? Is there some application I'm not thinking of? Usually, you'd want to emulate something like a transit card, access key, or credit card which would require a secure element (I think, but not sure).

MakeSomething
  • 916
  • 7
  • 9
  • Ok. Google just annount google.com/wallet today. In this scenario, wouldn't the phone act as the tag? – Joshua Partogi May 27 '11 at 04:29
  • 2
    As @erich-douglass pointed out above: not necessarily. if the reader terminal is peer-to-peer, it wouldn't need to act as a tag. – denbec Sep 27 '11 at 13:50
  • as above, you can write to a reader from the phone using NDEF push and peer to peer support in android 2.3+, but you need to make sure that the reader code is peer to peer. (needs to be a phone that has an NFC chip obv e.g. Galaxy Nexus, Nexus S.) – gamozzii Jan 31 '12 at 13:12
  • The problem is that currently most NFC card readers assume passive tags. It's much more complex to support active LLCP exchanges and of course still support passive card reading. It's possible, but I haven't yet heard of a payment option implemented using LLCP... – AerandiR Mar 17 '12 at 08:42
  • The reason i would want it to act as a tag so that it can be used instead of an access card, etc. For any method of identification. – Sharjeel Ahmed Dec 15 '12 at 04:42
  • 13
    This is outdated. Android 4.4 has host-based card emulation, which allows precisely this: http://developer.android.com/guide/topics/connectivity/nfc/hce.html – Trevor Johns Jan 26 '14 at 18:42
  • @all, can iPhone be used for Card-emulation mode, so that i can write on it(phone's NFC) and read with another Phone ? I know, iOS supports some external NFC tag(ISO 7816, ISO 15693, FeliCa™, and MIFARE®) to write on, but regarding writing to iPhone itself is unclear. – Jamshed Alam Jun 16 '22 at 08:37
19

Can we make an Android NFC as the tag which an NFC reader will get data from?

The Nexus S supports peer-to-peer mode, which as its name implies, causes one phone to act as a tag which another phone can read. There was a really good Google I/O session on NFC this year. I would recommended watching it if you're at all interested in NFC.

Erich Douglass
  • 51,744
  • 11
  • 75
  • 60
  • Thanks. That makes it clear for me. But can an NFC reader read from the phone? – Joshua Partogi May 26 '11 at 13:01
  • @jpartogi I'm not completely sure, but I think the reader would have to explicitly support peer-to-peer mode for it to work. – Erich Douglass May 26 '11 at 13:56
  • peer-to-peer mode is when BOTH phones or devices act as readers. Information isn't so much as read as it is pushed (written) back and forth. – Ben Ward Dec 20 '11 at 21:46
  • @ErichDouglass the video link doesn't work, I think this is the one that you meant https://www.youtube.com/watch?v=49L7z3rxz4Q – Ahmed Hegazy Jan 13 '21 at 10:59
11

Check the Host-based Card Emulation (HCE) NFC mode available in Android 4.4.

API guide: https://developer.android.com/guide/topics/connectivity/nfc/hce.html

metch
  • 673
  • 7
  • 14
10

yes you can. Android kitkat boosts of this functionality here

iglen_
  • 301
  • 3
  • 10
6

Its possible to make Android device behave as an NFC Tag. Such a behaviour is called Card Emulation.

  • Card emulation can be host-based(HCE) or secure-element based(CE).
  • In HCE, an application running on the Android main processor responds to the reader. So, the phone needs to be ON.
  • In CE, an applet residing in the Secure element responds to the reader. Here, its sufficient to have the NFC controller powered, with rest of the device suspended.
  • One of these or both approaches can be active simultaneously.
    A routing table instructs the NFC controller where route the Reader's commands to.
Padmanabha V
  • 430
  • 4
  • 11
3

Yes, take a look at NDEF Push in NFCManager - with Android 4 you can now even create the NDEFMessage to push to the active device at the time the interaction takes place.

Sven Haiges
  • 2,636
  • 5
  • 42
  • 54
3

Read here: http://groups.google.com/group/android-developers/browse_thread/thread/d5fc35a9f16aa467/dec4843abd73d9e9%3Flnk%3Dgst%26q%3Dsecure%2Belement%2Bdiff%2527s%23dec4843abd73d9e9?pli=1

I've not verified that myself but it looks like people managed to include the hidden code into Android again. They seem to be able to emulate a Mifare Classic card (iso-14443). I'll soon test this myself, it looks very interesting.

If you want to do it for a commercial/free app you'll have a hard time, your users won't like to change their kernel to support your app.

Update: There would be a simple trick to make your phone emulate a ticket:
You can get a NFC-sticker and put it in or on the phone. This way you are able to read and write it at all times and other devices can also read and write it.
It's just an idea I had, never seen that used anywhere of course ;)

John
  • 7,507
  • 3
  • 52
  • 52
  • We have tried the trick with NFC tag emulation on iPhone with iCarte. It might work... but we decided to cancel it, since that is really unusable... – STeN Jul 26 '12 at 12:19
2

In the google io session about NFC, qa section. There was such a question:

card emulation? No API support for card emulation No consistent user experience when doing card emulation and no compelling story

Jason
  • 807
  • 5
  • 15
  • Bu again - the reason the card emulation is 'not allowed' is that usually secure element needs to be used, but for NFC tags have no security (in fact they CANNOT have any). This eliminates the secure element need and it might be possible to emulate it via application code. – STeN Jul 26 '12 at 12:20
1

If you mean getting a powered NFC device to pretend to be a passive one (eg a tag).. not sure how well it works but the android app NFCClassic purports to record tag contents and then allow the tag to be activated and appear to be the copied tag to NFC readers. Creates a library of recorded tags.

mobycoder
  • 11
  • 2
0

Yes you can which is Peer-To-Peer Mode

Peer-To-Peer Mode


Bidirectional P2P connection to exchange data between devices

–Proximity triggered interactions

–Nexus S: Devices have to be placed back-to-back

Example of Applications

–Exchange of vCards

–Hand-over of Tickets & P2P Payment

–Web-page sharing, Youtube-video-sharing

–Application sharing

0

For NFC tech, it is easy. For Google, it will not support it as Google wallet.

xding
  • 1
  • 1
0

No, not at the moment. Google pointed out at the Google IO 2011, that card emulation is not supported and won't be supported for a while. Main (and easy to understand) problem: Which App should get the right on the phone to emulate a smartcard?

denbec
  • 1,321
  • 18
  • 25
0

You can definitely make an Android phone write to a tag reader using the NDEFPush functionality in the peer-to-peer support - but you will need to write the code on the tag reader side to use peer-to-peer as well (llcp).

gamozzii
  • 3,911
  • 1
  • 30
  • 34
-4

Yes! you can Just download this app!

Download APP

And if you want to know how do you use this app have a look at this video How To use NFC tools to emulate NFC as a tag app

Thank You! Please mark my answer if it helps you!

  • Emulation only works with the paid "pro" version of the app. – mknaf Oct 24 '20 at 08:33
  • 1
    Instead of using a link, you should write the relevant stuff from the link in here (still keeping the link as source). – DFSFOT Jan 24 '21 at 15:32