# NFC

Supported Platforms: Android

Support HCE (Host Based Card Emulation) mode, which simulates Android phones as physical smart cards. Support NFC Read and write, that is, the mobile phone is used as a card reader.

  • Applicable models: Support NFC Function, and the system version is Android 5.0 And Above Mobile Phones
  • Applicable Card Scope: ISO 14443-4 Standard CPU card
  • Support Reader / Writer (Reader / Writer) mode, that is, to support the NFC Device reads or writes passively NFC Labels and Stickers
  • Applicable models: Support NFC Function, and the system version is Android 5.0 And Above Mobile Phones
  • Scope of application:
    • Support NFC-A (ISO 14443-3A) / NFC-B (ISO 14443-3B) / NFC-F (JIS 6319-4) / NFC-V (ISO 15693) / ISO-DEP (ISO 14443-4) Standard reading and writing
    • (Partially Android Mobile Phone) Support Rice fever Classic / Rice fever Ultralight Tag reading and writing
    • Support for the NDEF Format NFC On the label. NDEF Read and write data

# Basic process

Past NFC-A Card writing apdu Instruction for example

  • call wx.getNFCAdapter() Obtain NFC Adapter Instance
  • call NFCAdapter.onDiscovered(function callback) Register Card Monitor Callback
  • call NFCAdapter.startDiscovery(Object object) Start listening and posting.
  • Paste card, onDiscovered Callback
    • according to onDiscovered Callback res Object's techs Field matches to card support NFC-A standard
    • adopt NFCAdapter.getNfcA() Obtain NfcA Example
  • use NfcA Example to read and write
    • call NfcA.connect() and NFC Cards Establish Connections
    • call NfcA.transceive(Object object) to NFC Card writing apdu Instructions and receive card return data
    • Read and write, call NfcA.close() Disconnect the connection
  • call NFCAdapter.stopDiscovery(Object object) End of listening post card

# NFC Tab Open Mini Program

In addition to the above Mini Program foundation NFC Ability, WeChat also supports the adoption of NFC The ability to quickly pull up Mini Program pages. Can be used for intelligent equipment fast distribution network, fast control and other scenarios.

For detailed documentation, please refer to:NFC Tab Open Mini Program