DeviceData.IsProximityNear
From Xojo Documentation
Read-Only Property (As Boolean )
BooleanValue = aDeviceData.IsProximityNear
New in 2020r2
Supported for all project types and targets.
New in 2020r2
Supported for all project types and targets.
If true, the device is near the user.
Notes
The ProximityMonitoringEnabled property must be True for this property to return accurate information. To preserver battery power, only set ProximityMonitoringEnabled to True while calling IsProximityNear and then set it to False as soon as you no longer need it.
Sample Code
Sample Code
If the device is near the user, display a message:
System.Device.ProximityMonitoringEnabled=True
If System.Device.IsProximityNear Then
MessageBox("The device is close to you.")
End If
System.Device.ProximityMonitoringEnabled=False
If System.Device.IsProximityNear Then
MessageBox("The device is close to you.")
End If
System.Device.ProximityMonitoringEnabled=False
See Also
ProximityMonitoringEnabled property.