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 / Bluetooth
  • Visible radio and connection request
  • Required permissions
  • Limitation
  • 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
Changes the visibility of a Bluetooth radio.
Note: A Bluetooth radio corresponds to a Bluetooth transmitter.. This transmitter can correspond to a Bluetooth USB key or it can be an element included in a computer (laptop for example).
Android Caution: Bluetooth functions are not available in the Android emulator.
Ejemplo
Reportes y ConsultasWindowsCódigo de Usuario (UMC)Ajax
bVisible is boolean
// Identifier of Bluetooth radios listed in a Table control 
nRadioID is int
nRadioID = TABLE_Radios.COL_ID[TABLE_Radios]
// Checks whether the selected radio is visible
bVisible = BTIsVisible(nRadioID)
// Display 
IF bVisible = True THEN
	Trace("Visible")
ELSE 
	Trace("Not visible")
END
// Change the visibility
BTChangeVisibility(nRadioID, NOT bVisible)
Sintaxis
Reportes y ConsultasWindowsCódigo de Usuario (UMC)Ajax

Syntax that can be used in Windows Ocultar los detalles

<Result> = BTChangeVisibility(<Radio identifier> , <New status>)
<Result>: Boolean
  • True if the change of visibility was successfully performed,
  • False otherwise. ErrorInfo returns more information on the error.
<Radio identifier>: Integer
Identifier of Bluetooth radio to use. This identifier is returned by BTListRadio.
<New status>: Boolean
  • True in order for the radio to become visible,
  • False in order for the radio to be hidden.
Android

Syntax that can be used in Android Ocultar los detalles

<Result> = BTChangeVisibility(<New status> [, <Duration>])
<Result>: Boolean
  • True if the change of visibility was successfully performed,
  • False otherwise. ErrorInfo returns more information on the error.
<New status>: Boolean
  • True in order for the radio to become visible,
  • False in order for the radio to be hidden.
Android The visibility cannot be disabled programmatically. This deactivation is temporary.
<Duration>: Optional integer or optional Duration
Duration (in seconds) during which the device must be made visible. This parameter must be included between 1 and 300 seconds. By default, the visibility duration is set to 120 seconds.
This parameter can correspond to:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s).
Observaciones

Visible radio and connection request

A visible Bluetooth radio automatically accepts the connection requests. When BTChangeVisibility is used to make the radio visible, the call to BTChangeConnectivity is automatically performed.
Android In Android, the visibility of the device in relation to the other Bluetooth devices is always temporary (up to 5 minutes). If BTChangeVisibility is used to make the device visible, a system dialog box will be displayed to ask for user confirmation.
Note: This dialog box is imposed by the Android system and cannot be avoided.
Android confirmation box
Android

Required permissions

This function changes the permissions required by the application.
Permission required: BLUETOOTH.
This permission allows the applications to connect to the Bluetooth services.
Windows

Limitation

Only the Microsoft Bluetooth stack is supported by this function. To know the stack used, call BTStack.
For more details, see Which stacks to use?
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 BTChangeVisibility 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: wd300com.dll
Versión mínima requerida
  • Versión 12
Esta página también está disponible para…
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