Near field communication (NFC) is a set of ideas and technology that enables smartphones and other devices to establish radio communication with each other by touching the devices together or bringing them into proximity to a distance of typically 10 cm (3.9 in) or less.
RFID is the process by which items are uniquely identified using radio waves, and NFC is a specialized subset within the family of RFID technology. Specifically, NFC is a branch of High-Frequency (HF) RFID, and both operate at the 13.56 MHz frequency. Evolved from radio frequency identification (RFID) tech, an NFC chip operates as one part of a wireless link. Once it's activated by another chip, small amounts of data between the two devices can be transferred when held a few centimeters from each other.
NFC is designed to be a secure form of data exchange, and an NFC device is capable of being both an NFC reader and an NFC tag. This unique feature allows NFC devices to communicate peer-to-peer. At the end of the day, NFC builds upon the standards of HF RFID and turns the limitations of its operating frequency into a unique feature of near-field communication.
The HCE(Host-based Card Emulation) architecture in Android is based around Android Service components (known as "HCE services"). One of the key advantages of a service is that it can run in the background without any user interface. This is a natural fit for many HCE applications like loyalty or transit cards, with which the user shouldn't need to launch the app to use it. The whole idea behind using a service as the target for HCE events (and not an activity as it is the case for other NFC events) is that the HCE functionbality should be accessible at any time and does not require an activity to be in the foreground.
NFC does not work if screen is BLACKED out. NFC may not work if the screen is UNLOCKED. NFC will work when is screen is LOCKED. That’s when HCE Service on the device wakes up. processCommandApdu() is called whenever a NFC reader sends an Application Protocol Data Unit (APDU) to your service. APDUs are defined in the ISO/IEC 7816-4 specification as well. APDUs are the application-level packets being exchanged between the NFC reader and your HCE service. That application-level protocol is half-duplex: the NFC reader will send you a command APDU, and it will wait for you to send a response APDU in return.
RFID is the process by which items are uniquely identified using radio waves, and NFC is a specialized subset within the family of RFID technology. Specifically, NFC is a branch of High-Frequency (HF) RFID, and both operate at the 13.56 MHz frequency. Evolved from radio frequency identification (RFID) tech, an NFC chip operates as one part of a wireless link. Once it's activated by another chip, small amounts of data between the two devices can be transferred when held a few centimeters from each other.
NFC is designed to be a secure form of data exchange, and an NFC device is capable of being both an NFC reader and an NFC tag. This unique feature allows NFC devices to communicate peer-to-peer. At the end of the day, NFC builds upon the standards of HF RFID and turns the limitations of its operating frequency into a unique feature of near-field communication.
The HCE(Host-based Card Emulation) architecture in Android is based around Android Service components (known as "HCE services"). One of the key advantages of a service is that it can run in the background without any user interface. This is a natural fit for many HCE applications like loyalty or transit cards, with which the user shouldn't need to launch the app to use it. The whole idea behind using a service as the target for HCE events (and not an activity as it is the case for other NFC events) is that the HCE functionbality should be accessible at any time and does not require an activity to be in the foreground.
NFC does not work if screen is BLACKED out. NFC may not work if the screen is UNLOCKED. NFC will work when is screen is LOCKED. That’s when HCE Service on the device wakes up. processCommandApdu() is called whenever a NFC reader sends an Application Protocol Data Unit (APDU) to your service. APDUs are defined in the ISO/IEC 7816-4 specification as well. APDUs are the application-level packets being exchanged between the NFC reader and your HCE service. That application-level protocol is half-duplex: the NFC reader will send you a command APDU, and it will wait for you to send a response APDU in return.
public class MyHostApduService extends HostApduService {
@Override
public byte[] processCommandApdu(byte[] apdu, Bundle extras) {
...
}
@Override
public void onDeactivated(int reason) {
...
}
}
ref:
NFC - http://www.nearfieldcommunication.org/
Emulate a NFC tag with HCE to open a door with a NFC/RFID lock - http://www.reddit.com/r/
NFC HCE - https://developer.android.
NFC vs RFID - http://blog.atlasrfidstore.com/rfid-vs-nfc