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 concreto de Android 10
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Advertencia
A partir de la versión 2024, está funcionalidad no estará disponible.
Sends an NFC tag to another device.
Note: NFC functions cannot be used in the simulator or emulator.
Ejemplo
// 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
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.
      Note: To personalize the message displayed in this window, use the NextTitle function before calling the NFCSendTagfunction. .
  • 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

This function changes the permissions required by the application.
Required permissions:
  • NFC: Enables applications to perform input/output operations using NFC technology.
  • VIBRATE: Accesses the vibrate function.
Android

Aplicación en segundo plano: Caso concreto 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 las aplicaciones en segundo plano.
Componente: wd300android.jar
Versión mínima requerida
  • Versión 18
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

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