PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
New WINDEV Mobile 23 feature!
  • Necessary version
  • Required permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Used to find the Beacon tags nearby the device.
Example
// In a museum, we want to display on the visitor device the information
// regarding the masterpiece he is looking at. Associate to each Beacon tag
// the same UUID corresponding to the museum as well as Major and Minor numbers
// used to identify each tag in a unique way.
// A Beacon tag is placed near each masterpiece.
// The application must call the BeaconDetectPrecise function with a
// BeaconGroup variable corresponding to the museum tags.
// The callback procedure passed in parameter to the function will be called whenever
// a new list of Beacon tags is detected. Then, all you have to do is find
// the nearest tag to identify the masterpiece watched by the visitor and to display
// the corresponding information in the application.

// Museum UUID
sUUID is string = "f4231ab6-5ef2-6c99-4229-af6c72e0446e"
// Create a beaconGroup variable corresponding to the museum tags
groupMuseum is beaconGroup
groupMuseum..UUID = sUUID
// Start the detection
BeaconDetectPrecise(groupMuseum, ProcDetection)
INTERNAL PROCÉDURE ProcDetection(arrInfo is array of beaconDetectionInfo)
nMinDistance is int
NearestTag is beaconDetectionInfo
FOR EACH Information OF arrInfo
IF nMinDistance = 0 _OR_ Information..Distance < nMinDistance
NearestTag = Information
END
END
// Display information about the masterpiece associated with the tag
DisplayMasterpieceInfo(NearestTag..Major, NearestTag..Minor)
END
Syntax
<Result> = BeaconDetectPrecise(<Group of Tags> , <Procedure Name>)
<Result>: Boolean
  • True if the detection was started,
  • False otherwise. To find out the error details, use ErrorInfo.
<Group of Tags>: beaconGroup variable
Name of beaconGroup variable describing the group of sought Beacon tags.
<Procedure Name>: Character string (with or without quotes)
WLanguage procedure ("callback") called when detecting a new list of Beacon tags.
This procedure has the following format:
PROCEDURE <Procedure Name>(<Array of Detection Info>)
where <Array of Detection Info> is a beaconDetectionInfo variable describing information about the detected Beacon tags (identifiers, Major/Minor numbers, distance, etc.)
Remarks
  • This function thoroughly studies the Bluetooth emissions around the device in order to detect the Beacon tags and to estimate their distance. This study consumes a lot of energy: therefore, we advise you to call this function only if at least one group tag is found nearby.
    To do so, you have the ability to call BeaconDetectBackground then BeaconDetectPrecise from the callback procedure run when the entry into the emission area of group tags was detected by the application.
    Furthermore, we advise you to stop the precise detection as soon as possible. BeaconStopPreciseDetection is used to stop the current detection: it can for example be called in the WLanguage procedure run when the exit from the emission area of group tags was detected by the application.
  • The precise detection of Beacon tags is performed only when the application is found in the foreground. When the application goes into background, the detection is automatically suspended and it will resume as soon as the application goes back into foreground. The detection is permanently stopped when the application is stopped. To perform a detection in background, use BeaconDetectBackground.
  • iPhone/iPad When generating the application, you have the ability to allow the call to BeaconDetectPrecise when the application is in background ("Allow GPSFollowMovement and BeaconDetectPrecise to be called when the application is in background" in the "Configuration" step of wizard). In this case, the precise detection can continue when the application is in background or when the device is in stand-by mode. See Generating an iOS application for more details.
  • Several precise detections cannot be started at the same time. If BeaconDetectPrecise is called while a detection is already in progress, the current detection will be stopped and a new detection will be started.
AndroidAndroid Widget

Necessary version

The functions for managing Beacon tags are available for the devices running an Android version greater than or equal to version 4.3 (api level 18).
A fatal error will occur if the function is used with an earlier system version.
To find out the version of Android system on which the application is run, use SysAndroidVersion.
AndroidAndroid Widget The device must support the Bluetooth Low Energy technology (Bluetooth LE).
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: ACCESS_COARSE_LOCATION : Allows the application to get the approximate device position.
Components
Android wd230android.jar
Minimum required version
  • Version 23
Comments
Click [Add] to post a comment