DeviceData.ProximityMonitoringEnabled

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As Boolean )
aDeviceData.ProximityMonitoringEnabled = newBooleanValue
or
BooleanValue = aDeviceData.ProximityMonitoringEnabled

New in 2020r2

Supported for all project types and targets.

If True, the operating system will update the app to indicate if the device is near the user or not.

Notes

To conserve battery power, set this property to True only when you need to check to see if the device is near the user or not and then immediately set it to False so that the device stops using energy to deliver this data to your app.

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

See Also

IsProximityNear property.