GeofenceHardware.RegisterForMonitorStateChangeCallback Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Register the callback to be notified when the state of a hardware geofence monitoring system changes.
[Android.Runtime.Register("registerForMonitorStateChangeCallback", "(ILandroid/hardware/location/GeofenceHardwareMonitorCallback;)Z", "")]
public bool RegisterForMonitorStateChangeCallback (Android.Hardware.Location.GeofenceMonitoringType monitoringType, Android.Hardware.Location.GeofenceHardwareMonitorCallback? callback);
[<Android.Runtime.Register("registerForMonitorStateChangeCallback", "(ILandroid/hardware/location/GeofenceHardwareMonitorCallback;)Z", "")>]
member this.RegisterForMonitorStateChangeCallback : Android.Hardware.Location.GeofenceMonitoringType * Android.Hardware.Location.GeofenceHardwareMonitorCallback -> bool
Parameters
- monitoringType
- GeofenceMonitoringType
Type of the monitor
- callback
- GeofenceHardwareMonitorCallback
Callback that will be called.
Returns
true on success
- Attributes
Remarks
Register the callback to be notified when the state of a hardware geofence monitoring system changes. For instance, it can change from #MONITOR_CURRENTLY_AVAILABLE
to #MONITOR_CURRENTLY_UNAVAILABLE
Requires android.Manifest.permission#ACCESS_FINE_LOCATION
permission when #MONITORING_TYPE_GPS_HARDWARE
is used.
Requires android.Manifest.permission#LOCATION_HARDWARE
permission to access geofencing in hardware.
This API should not be called directly by the app developers. A higher level api which abstracts the hardware should be used instead. All the checks are done by the higher level public API. Any needed locking should be handled by the higher level API.
The same callback object can be used to be informed of geofence transitions and state changes of the underlying hardware subsystem.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.