ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Bluetooth
  • Visible radio and connection request
  • Required permissions
  • Application in the background: Specific case from Android 10
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
BTChangeVisibility (Function)
In french: BTChangeVisibilité
Changes the visibility of a Bluetooth radio.
Remark: 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.
Example
Syntax
Android

Syntax that can be used in Android Hide the details

<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 through programming. 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 be:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s).
Remarks

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.
Remark: This dialog box is imposed by the Android system and therefore it cannot be avoided.
Android confirmation box
Android

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: BLUETOOTH.
This permission allows the applications to connect to the Bluetooth services.
Android

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
BTChangeVisibility can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
Component: wd290com.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help