• Operating mode
  • Reading the NFC sent
  • Required permissions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Sends a NFC tag to another device.
  • The NFC functions cannot be used in the simulator or in the emulator.
  • The NFC functions are available for the devices running Android version 2.3.3 or later (api level 10).
    A fatal error occurs if the function is used with an earlier system version.
    Reminder: To find out the version of Android system on which the application is run, use SysAndroidVersion.
// Sends an URL to another device
tag is nfcTag
url is nfcData
url..Type = nfcURI
url..Content = "www.pcsoft.com"
Add(tag..Data, url)
IF NFCSendTag(tag) = False THEN
Error("Failure writing onto the NFC tag.", ErrorInfo())
<Result> = NFCSendTag(<Tag>)
<Result>: Boolean
  • True if the sending was performed,
  • False otherwise. The ErrorOccurred variable is set to True if an error occurred. To find out the error details, use ErrorInfo.
<Tag>: nfcTag variable
Name of the nfcTag variable describing the data to send.

Operating mode

  • The NFC tags are sent by the Android Beam feature of the device. This feature must be enabled on the transmitter device and on the receiver device.
    The Android Beam feature is enabled in the window for configuring the wireless communications.
  • The call to NFCSendTag automatically opens a window asking the user to move his device near another device compatible with NFC. This window will be automatically closed:
    • when the sending is over
    • if the user cancels the sending by pressing the Back key of the device.
      Note: To customize the message displayed in this window, use NextTitle before the call to NFCSendTag.
  • On the destination device, the tag sent can be read like a standard NFC tag:
    • by an application developed with WINDEV Mobile by using NFCReadTag,
    • by a compatible external application.

Reading the NFC sent

In order for a device to read the NFC tag sent by NFCSendTag, it must support:
  • the NDEF Push Protocol (com.android.npp),
  • the SNEP protocol (Simple NDEF Exchange Protocol).
If it is running version 4.0 or later, it must support the two protocols.

Required permissions

The call to this function modifies the permissions required by the application.
Required permissions:
  • NFC: Allows the applications to perform input/output operations via the NFC technology.
  • VIBRATE: Used to access the sensor feature.
Component : wd250android.jar
Minimum version required
  • Version 18
Click [Add] to post a comment