PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Operating mode
  • Required permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Starts writing data onto a NFC tag.
Notes:
  • 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 will occur 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.
Example
// Writes a url into a NFC tag
tag is nfcTag
url is nfcData
url..Type = nfcURI
url..Content = "http://www.pcsoft.com"
Add(tag..Data, url)
NFCWriteTag(tag)
IF ErrorOccurred THEN
Error("Failure writing onto the NFC tag.", ErrorInfo())
END
Syntax
<Result> = NFCWriteTag(<Tag>)
<Result>: Integer
  • 1 if the writing was successful,
  • otherwise, one of the following constants:
    nfcErrDisabledThe NFC is not enabled on the device.
    nfcErrDetectionThe NFC tag has exited from the detection control during the write process.
    nfcErrEmulatorFunction called from the emulator.
    nfcErrFormatThe format of the data to write is invalid.
    nfcErrUnknownUnknown error.
    nfcErrReadOnlyThe NFC tag is protected in write mode.
    nfcErrNDEFThe NFC tag cannot be formatted to the NDEF format (NFC Data Exchange Format).
    nfcErrProtectionThe NFC tag cannot be protected in write mode (mode not supported by the tag).
    nfcErrMaxSizeThe size of the data to write exceeds the maximum size of data that can be stored on the NFC tag.

    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 write.
Remarks

Operating mode

The call to NFCWriteTag automatically opens a window asking the user to move his device near the NFC tag into which he wants to write.
This window will be automatically closed:
  • at the end of the write operation,
  • if the user cancels the operation by pressing the Back key of the device.
Note: To customize the message displayed in this window, use NextTitle before the call to NFCWriteTag.
A vibration is triggered when the device detects the NFC tag. The device must be located near the NFC tag during the entire display of the capture window otherwise the write process will be interrupted.

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.
Related Examples:
Android System Android (WINDEV Mobile): Android System
[ + ] This application is a tutorial example presenting some of the new features of WINDEV Mobile for Android.
The following system functions are used:
- NFC
- Multimedia control
- Brightness
- Volume
- WIFI
- Bluetooth
- Toast
- Progress Bar control
- 9-image mode
- Compass
- Accelerometer
- Camera control
- LED
- Vibrations
- Notifications
- Drawing functions
- Internet
Components
Android wd230android.jar
Minimum required version
  • Version 18
Comments
Click [Add] to post a comment