Questions tagged [nfc]

Near Field Communication (NFC) is a set of short-range communication protocols that enables electronic devices to exchange data within short distances of roughly 10 cm or less. Can be used with Tags [mifare] [iso-15693] [ndef] [nfc-p2p], etc., as some questions are very specific to the NFC Tag type.

Near field communication (NFC) builds on the RFID standards that have bi-directional contactless communications: ISO/IEC 14443, ISO/IEC 18092 and JIS 6319-4 (FeliCa). Nowadays, almost all smartphone manufacturers (and some tablet manufacturers) have added support for this technology in their high-end devices. It allows users to share data through NFC tags and NFC peer-to-peer communication between 2 devices and, in some regions, to use their device as a contactless payment card.

Tag Types & Modes of operation

In addition to the signaling technologies used by near field communication technology, four tag types and two sets of active/passive roles exist. Tag types refer to the speed and compatibility between an NFC tag and NFC readers, and the roles define how active and passive devices respond during a NFC communication. Most often a URL will be embedded in a NFC tag. URLs take up only a small amount of memory, lowering the production cost of the NFC tags since many are placed on posters or other items that are thrown away later on. NFC tags can, however, hold nearly any type of information, though more memory costs more money.

Tag Types:

  • Type 1: Type 1 NFC tags have data collision protection and can be set to either read and rewrite capable or read-only. Read-only programming prevents the information from being changed or written over once embedded in the tag. Type 1 tags have 96 bytes of memory, enough for a URL or a small amount of data. The tag’s memory can expand to a larger size as needed. The low price makes type 1 tags to ideal choice for most near field communication needs.
  • Type 2: Type 2 NFC tags also have data collision protection and can be rewriteable or read-only. They start at 48 bytes of memory, half of what the type 1 tags can hold, but can expand to be as large as a type 1 tag. Communication speeds are the same for tag types 1 and 2.
  • Type 3: Also equipped with data collision protection, NFC tag type 3 has larger memory and faster speeds than tag types 1 and 2. This tag is part of the FeliCa system. The bigger size lets it hold more complex codes beyond URLs, but it costs more to create each tag.
  • Type 4: Type 4 NFC tags can use either NFC-A or NFC-B communication and have data collision protection. The tag is set as either rewritable or read-only when manufactured and this setting cannot be changed by the user, unlike the other NFC tags which can be altered at a later date. The tag holds 32 Kbytes in memory and has faster speeds than the other tags.
  • Type 5: Type 5 NFC tags use NFC-V communication and offer support for offers support for the ISO/IEC 15693 specification. Type 5 Tags are NFC-RFID crossover technology that gives longer range ‘vicinity’ communication with dedicated reader hardware and also allows ‘proximity’ interaction with a NFC readers.

In addition to the five tag types, four modes of operation exist. The modes – reader/writer, card, initiator, and target – describe what role a device or tag is playing in an NFC transaction. Devices can switch between more than one role depending on the transaction being processed.

NFC Basic Roles:

  • Reader/Writer and Card – Typically a transaction occurs between an active device that sends out signals and receives information and a passive device that simply sends the information and does not receive anything other than instructions on what data to reply with. The reader/writer is the smartphone serving as the active device and the card is the NFC tag serving as the passive device. Smartphones can take on the role of card, however, when they act as a credit card for contactless payments. Then the credit card reader becomes the reader/writer and the smartphone serves as the passive card device.
  • Initiator and Target – NFC technology has a major advantage over other technologies such as RFID. NFC can create peer-to-peer sharing between two phones. In this case, the phone making the connection or sending an invitation is the initiator and the phone receiving the instructions and sending back information is the target. Yet both phones can serve both roles by switching back and forth depending on what transmission is being sent, though this requires a higher level of technology.

The Nokia C7-00 was the first smartphone with NFC shortly followed by the Google Nexus S. Any two NFC-enabled Android or Windows (Phone) 8 devices can share data by touching with each other, such as web page URLs, files and even apps. The first Android OS that supported NFC was 2.3.3. Android 4.0 made NFC more powerful with the so-called Android Beam functionality. Android NFC devices often also support the related RFID technology ISO/IEC 15693. Many devices also support the proprietary MIFARE protocol.

In addition to the commercial products, the academic world seems to be interested in this technology as well. More and more literature is published in areas like home care, mobile sensing and game supply.

The is the first Apple hardware to offer NFC, limited reading support was available in iOS 11 with more complete reading and writing support available in iOS 13

4425 questions
18
votes
5 answers

How to read and write Android NFC tags?

I followed some tutorial using the adam rocker source code for my NFCTest. I want to be able to read and write NFC tags and also launch an application.
ogfasasi
  • 181
  • 1
  • 1
  • 4
18
votes
3 answers

Reading multiple NFC tags simultaneously in Android

The new 2.3.3 SDK includes improved NFC support, and I'd like to write an app that relies on this. Ultimately, I'd like to be able to read data from multiple tags that enter the field simultaneously, but Android only seems to trigger on the first…
Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
18
votes
2 answers

What's the difference between enableReaderMode and enableForegroundDispatch?

I found two approaches to let an Android app detect and process NFC tags: NfcAdapter.enableReaderMode(activity, callback, flags, extras) and then receive the tag info in the callback. NfcAdapter.enableForegroundDispatch(activity, intent, filters,…
Héctor
  • 24,444
  • 35
  • 132
  • 243
18
votes
4 answers

Check programmatically if device has NFC reader

Is there a way to check at run time whether a device has an NFC reader? My app uses NFC to perform a task, but if no reader is present, it can perform the same task by using a button.
giozh
  • 9,868
  • 30
  • 102
  • 183
17
votes
4 answers

how do you read the unique ID of an NFC tag on android?

Tag myTag = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); Log.i("tag ID", myTag.getId().toString()); This gives me an ID like "[B@40521c40" but this ID changes every read. Any help would be greatly appreciated. Thanks.
user635028
  • 251
  • 1
  • 5
  • 9
17
votes
3 answers

Can we emulate NFC cards in iOS 13?

Apple just announced new NFC Core API to public. Here is what they said. Core NFC With Core NFC framework, your apps can now support tag writing, including writing to NDEF formatted tags. The framework also provides supports for reading and writing…
Pemassi
  • 612
  • 1
  • 7
  • 20
17
votes
2 answers

Editing Functionality of Host Card Emulation in Android

I'm currently in the process of developing a project for my University course wherein I will be hopefully editing the functionality of the HCE Feature of Android to allow me to set my own UID when emulating a card. Now, i've downloaded the AOSP…
Jay Allen
  • 331
  • 1
  • 2
  • 7
17
votes
1 answer

Android NFC in Embarcadero XE5

Trying to get NFC to work on Android in Embarcadero XE5. Started with the following: https://forums.embarcadero.com/thread.jspa?threadID=97574 which seem to be working. Now would like to register callback for the NFC Intent Java approach: 1.…
Boris Mocialov
  • 3,439
  • 2
  • 28
  • 55
17
votes
2 answers

NFC standards (NFC Forum, ISO/IEC, ECMA

I am often being asked about standards, the NFC is based on. I summarized my knowledge in the text below. I hope it can be an answer to such questions. Please feel free to correct it by posting comments and replies - I will include it into my…
STeN
  • 6,262
  • 22
  • 80
  • 125
16
votes
2 answers

NFC card emulation Android

the Nexus S device NXP PN544 NFC controller supports not only SWP for UICC based SE, but also the S2C (aka NFC-WI) for the external, e.g. micro SD card SE. Does anybody know how this can be enabled and what it means for the SD card? That is not…
STeN
  • 6,262
  • 22
  • 80
  • 125
16
votes
5 answers

Getting Nexus S Android NFC into Card emulation mode

Has anyone been able to get the nexus s into card emulation mode? The latest android release does not seem to support this yet. This article says it's possible…
kgibbon
  • 726
  • 1
  • 15
  • 37
16
votes
1 answer

Instant Apps with NFC

I'm trying to get an instant app to be opened via NFC. I have something like the below in my AndroidManifest.xml
Ryan C
  • 1,003
  • 1
  • 14
  • 26
16
votes
2 answers

How to implement NFC payments?

I want to add NFC payment to an Android application I'm working on to allow the users to pay directly to a POS. I'm interested in supporting as much POS as possible. I was wondering if it's really possible or it depends on propietary…
angudu
  • 183
  • 1
  • 2
  • 6
16
votes
1 answer

How to get AID for reader Host based card emulation

I'm trying to do Host card emulation on an Android device using this example using ACR1281U NFC tag reader. This is the kind of application I want to make. As per the Android documentation and the example, it is required to register an AID in the…
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66
16
votes
5 answers

List of devices support HCE?

As more and more devices have KitKat, I'm trying to compile a list of devices support HCE. Does anyone have the list? Feel free to add comments to contribute to this list. Below is what I have so far: Notes: Not all KitKat devices support HCE. To…
Trung
  • 1,655
  • 2
  • 18
  • 26