AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones NFC
  • Operating mode
  • Reading the NFC sent
  • Required permissions
  • Aplicación en segundo plano: Caso específico a partir de Android 10
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Advertencia
A partir de la versión 2024, está funcionalidad no estará disponible.
Sends an NFC tag to another device.
Remark: The NFC functions cannot be used in the simulator or in the emulator.
Ejemplo
// Envoie une URL à un autre appareil
tag is nfcTag
url is nfcData
url.Type = nfcURI
url.Content = "www.pcsoft.com"
Add(tag.Data, url)
IF NFCSendTag(tag) = False THEN
Error("Echec de l'écriture sur le tag NFC.", ErrorInfo())
END
Sintaxis
<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.
Observaciones

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

Using 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.
Android

Aplicación en segundo plano: Caso específico a partir de Android 10

A partir de Android 10, no se puede abrir una ventana si la aplicación está en segundo plano.
La función NFCSendTag puede abrir una ventana. Si se utiliza esta función cuando la aplicación está en segundo plano, se producirá un error fatal.
Consejos:
  • Para saber si la aplicación está en segundo plano, utilice la función InBackgroundMode.
  • Si una aplicación necesita interactuar con el usuario cuando está en segundo plano, se puede mostrar una notificación (con el tipo Notification). La aplicación volverá al primer plano cuando se haga clic en la notificación, si la propiedad ActivateApplication se establece en True. También es posible abrir una ventana desde el procedimiento pasado a la propiedad ActionClick.
Para obtener más información, consulte Android 10: Comportamiento de aplicaciones en segundo plano.
Componente: wd290android.jar
Versión mínima requerida
  • Versión 18
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 24/02/2024

Señalar un error o enviar una sugerencia | Ayuda local