ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / NFC functions
  • Overview
  • Use cases
  • Implementation
  • Necessary conditions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
NFC (Near Field Communication) is a wireless communication technology at short range and high frequency used to exchange data (named "tag") between two devices or between a device and a bullet even at short distance (few centimeters).
The NFC technology is an extension of RFID: the main differences are a shorter communication distance (ten centimeters for the NFC) and a higher volume of exchanged data (40 bytes for most of the RFID tags and up to 8 KB for the NFC tags).
NFC allows several uses, some of them are related to the field of contactless cards (ATM, payment, access, etc.) while others are based on the interaction between the individual persons and their environment: objects, persons.
  • Card emulation mode:
    In passive card emulation mode, the mobile device behaves like a contactless smart card.
    Android This mode is not supported at the moment on the Android devices.
  • Reader/writer mode:
    The device becomes a reader for contactless smart cards (active mode) and RFID tags (electronic tags). This mode allows you to read information by moving your mobile device in front of electronic labels found in the street, on bus stops, monuments, posters, ... or on packages, products or business card (vCard), ...
    It is also possible to write the content of these tags from the mobile device.
  • Peer-to-peer mode:
    This mode allows two devices to exchange information, e.g. vCards, photos, videos, money, tickets, etc. A device equipped with the NFC technology can exchange information with contactless smart cards but also with other devices equipped with this technology.

Use cases

  • Payment using a contactless credit or debit card or a mobile device (cell phone, laptop, tablet, etc.) with a contactless payment terminal.
  • Payment for parking at a terminal that accepts contactless payment using your NFC phone.
  • Buying and validating a transportation ticket or a ticket for a show via a mobile device.
  • Managing the vouchers in a store or a loyalty customer card.
  • Accessing and starting a vehicle via a mobile phone.
  • Reading information about products (price, composition, allergy, etc.) in a store.
  • Checking the access to restricted areas (meeting rooms, company, university, etc.).
  • Exchanging profiles between two users of a social network or between two gamers by "typing" the two phones (peer-to-peer mode).
  • Reading an electronic business card.
  • Synchronizing Internet tags and contacts between a PDA and a cell phone.
  • Retrieving the WiFi key of an access point by moving the "NFC device" near the hotspot.
Implementation
To manage the NFC, WINDEV Mobile proposes:
  • Two types of data to define the tag:
    nfcDataThe nfcData type is used to describe and handle the data of a variable of type nfcTag.
    nfcTagThe nfcTag type is used to define the advanced characteristics of an NFC tag (Near Field Communication).
  • Various functions:
    • Function to find out the status of the sensor:
      NFCStatusReturns the activation status of the NFC sensor found on the device.
    • Functions to read and write the NFC tags:
      NFCReadTagStarts reading a NFC tag or enables the detection of NFC tags for the current window.
      NFCWriteTagStarts writing data to an NFC tag.
    • Function to establish a "peer-to-peer" communication:
      NFCSendTagSends a NFC tag to another device.
Remarks: The NFC functions cannot be used in the simulator or in the emulator.
iPhone/iPad

Necessary conditions

Calling NFC functions modifies the AppIDs of the application in the Apple developer account. It is necessary to activate the "NFC Tag Reading" App ID.
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment

Last update: 01/26/2023

Send a report | Local help