DeviceData.ProximityMonitoringEnabled
From Xojo Documentation
Property (As Boolean )
aDeviceData.ProximityMonitoringEnabled = newBooleanValue
or
BooleanValue = aDeviceData.ProximityMonitoringEnabled
New in 2020r2
Supported for all project types and targets.
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
If System.Device.IsProximityNear Then
MessageBox("The device is close to you.")
End If
System.Device.ProximityMonitoringEnabled=False
See Also
IsProximityNear property.