|
|
|
|
- Operating mode
- Reading the NFC sent
- Required permissions
- Application in the background: Specific case from Android 10
NFCSendTag (Function) In french: NFCEnvoieTag Sends an NFC tag to another device. Remark: The NFC functions cannot be used in the simulator or in the emulator. // 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("Unable to write NFC tag.", ErrorInfo()) END
Syntax
<Result> = NFCSendTag(<Tag>)
<Result>: Boolean - True if the sending was performed,
- False otherwise. If an error occurs, the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo.
<Tag>: nfcTag variable Name of the nfcTag variable that describes the data to be sent. Remarks 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 to prompt the users to hold their devices closer to another NFC-enabled device. 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.
Remark: 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 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: wd290android.jar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|