LocationManager.RegisterGnssMeasurementsCallback 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.
Overloads
| Name | Description |
|---|---|
| RegisterGnssMeasurementsCallback(GnssMeasurementsEvent+Callback) |
Registers a GNSS measurements callback which will run on a binder thread. |
| RegisterGnssMeasurementsCallback(GnssMeasurementsEvent+Callback, Handler) |
Registers a GNSS measurements callback which will run on a binder thread. |
| RegisterGnssMeasurementsCallback(IExecutor, GnssMeasurementsEvent+Callback) |
Registers a GNSS measurements callback which will run on a binder thread. |
| RegisterGnssMeasurementsCallback(GnssMeasurementRequest, IExecutor, GnssMeasurementsEvent+Callback) |
Registers a GNSS measurements callback which will run on a binder thread. |
RegisterGnssMeasurementsCallback(GnssMeasurementsEvent+Callback)
Registers a GNSS measurements callback which will run on a binder thread.
[Android.Runtime.Register("registerGnssMeasurementsCallback", "(Landroid/location/GnssMeasurementsEvent$Callback;)Z", "GetRegisterGnssMeasurementsCallback_Landroid_location_GnssMeasurementsEvent_Callback_Handler", ApiSince=24)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")]
public virtual bool RegisterGnssMeasurementsCallback(Android.Locations.GnssMeasurementsEvent.Callback callback);
[<Android.Runtime.Register("registerGnssMeasurementsCallback", "(Landroid/location/GnssMeasurementsEvent$Callback;)Z", "GetRegisterGnssMeasurementsCallback_Landroid_location_GnssMeasurementsEvent_Callback_Handler", ApiSince=24)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")>]
abstract member RegisterGnssMeasurementsCallback : Android.Locations.GnssMeasurementsEvent.Callback -> bool
override this.RegisterGnssMeasurementsCallback : Android.Locations.GnssMeasurementsEvent.Callback -> bool
Parameters
- callback
- GnssMeasurementsEvent.Callback
a GnssMeasurementsEvent.Callback object to register. This value cannot be null.
Returns
true always
- Attributes
Remarks
This method was deprecated in API level 30. Use registerGnssMeasurementsCallback(GnssMeasurementsEvent.Callback,Handler) or registerGnssMeasurementsCallback(Executor,GnssMeasurementsEvent.Callback) instead.
Registers a GNSS measurements callback which will run on a binder thread.
See registerGnssMeasurementsCallback(Executor,GnssMeasurementsEvent.Callback) for more detail on how this method works. Requires Manifest.permission.ACCESS_FINE_LOCATION
Android reference for android.location.LocationManager.registerGnssMeasurementsCallback.
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.
Applies to
RegisterGnssMeasurementsCallback(GnssMeasurementsEvent+Callback, Handler)
Registers a GNSS measurements callback which will run on a binder thread.
[Android.Runtime.Register("registerGnssMeasurementsCallback", "(Landroid/location/GnssMeasurementsEvent$Callback;Landroid/os/Handler;)Z", "GetRegisterGnssMeasurementsCallback_Landroid_location_GnssMeasurementsEvent_Callback_Landroid_os_Handler_Handler", ApiSince=24)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")]
public virtual bool RegisterGnssMeasurementsCallback(Android.Locations.GnssMeasurementsEvent.Callback callback, Android.OS.Handler? handler);
[<Android.Runtime.Register("registerGnssMeasurementsCallback", "(Landroid/location/GnssMeasurementsEvent$Callback;Landroid/os/Handler;)Z", "GetRegisterGnssMeasurementsCallback_Landroid_location_GnssMeasurementsEvent_Callback_Landroid_os_Handler_Handler", ApiSince=24)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")>]
abstract member RegisterGnssMeasurementsCallback : Android.Locations.GnssMeasurementsEvent.Callback * Android.OS.Handler -> bool
override this.RegisterGnssMeasurementsCallback : Android.Locations.GnssMeasurementsEvent.Callback * Android.OS.Handler -> bool
Parameters
- callback
- GnssMeasurementsEvent.Callback
a GnssMeasurementsEvent.Callback object to register. This value cannot be null.
- handler
- Handler
the handler that the callback runs on. This value may be null.
Returns
true always
- Attributes
Remarks
Registers a GNSS measurements callback.
See registerGnssMeasurementsCallback(Executor,GnssMeasurementsEvent.Callback) for more detail on how this method works. Requires Manifest.permission.ACCESS_FINE_LOCATION
Android reference for android.location.LocationManager.registerGnssMeasurementsCallback.
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.
Applies to
RegisterGnssMeasurementsCallback(IExecutor, GnssMeasurementsEvent+Callback)
Registers a GNSS measurements callback which will run on a binder thread.
[Android.Runtime.Register("registerGnssMeasurementsCallback", "(Ljava/util/concurrent/Executor;Landroid/location/GnssMeasurementsEvent$Callback;)Z", "GetRegisterGnssMeasurementsCallback_Ljava_util_concurrent_Executor_Landroid_location_GnssMeasurementsEvent_Callback_Handler", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")]
public virtual bool RegisterGnssMeasurementsCallback(Java.Util.Concurrent.IExecutor executor, Android.Locations.GnssMeasurementsEvent.Callback callback);
[<Android.Runtime.Register("registerGnssMeasurementsCallback", "(Ljava/util/concurrent/Executor;Landroid/location/GnssMeasurementsEvent$Callback;)Z", "GetRegisterGnssMeasurementsCallback_Ljava_util_concurrent_Executor_Landroid_location_GnssMeasurementsEvent_Callback_Handler", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")>]
abstract member RegisterGnssMeasurementsCallback : Java.Util.Concurrent.IExecutor * Android.Locations.GnssMeasurementsEvent.Callback -> bool
override this.RegisterGnssMeasurementsCallback : Java.Util.Concurrent.IExecutor * Android.Locations.GnssMeasurementsEvent.Callback -> bool
Parameters
- executor
- IExecutor
the executor that the callback runs on. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.
- callback
- GnssMeasurementsEvent.Callback
the callback to register. This value cannot be null.
Returns
true always
- Attributes
Remarks
Registers a GNSS measurements callback. GNSS measurements information will only be received while the GPS_PROVIDER is enabled, and while the client app is in the foreground.
Not all GNSS chipsets support measurements updates, see getGnssCapabilities().
On Android R devices that have not yet upgraded to Android R QPR1, using this API will cause unavoidable crashes in the client application when GNSS measurements are received. If a client needs to receive GNSS measurements on Android R devices that have not been upgraded to QPR1, clients are instead encouraged to use LocationManagerCompat.registerGnssMeasurementsCallback() from the compat libraries instead to avoid this crash. Requires Manifest.permission.ACCESS_FINE_LOCATION
Android reference for android.location.LocationManager.registerGnssMeasurementsCallback.
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.
Applies to
RegisterGnssMeasurementsCallback(GnssMeasurementRequest, IExecutor, GnssMeasurementsEvent+Callback)
Registers a GNSS measurements callback which will run on a binder thread.
[Android.Runtime.Register("registerGnssMeasurementsCallback", "(Landroid/location/GnssMeasurementRequest;Ljava/util/concurrent/Executor;Landroid/location/GnssMeasurementsEvent$Callback;)Z", "GetRegisterGnssMeasurementsCallback_Landroid_location_GnssMeasurementRequest_Ljava_util_concurrent_Executor_Landroid_location_GnssMeasurementsEvent_Callback_Handler", ApiSince=31)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")]
public virtual bool RegisterGnssMeasurementsCallback(Android.Locations.GnssMeasurementRequest request, Java.Util.Concurrent.IExecutor executor, Android.Locations.GnssMeasurementsEvent.Callback callback);
[<Android.Runtime.Register("registerGnssMeasurementsCallback", "(Landroid/location/GnssMeasurementRequest;Ljava/util/concurrent/Executor;Landroid/location/GnssMeasurementsEvent$Callback;)Z", "GetRegisterGnssMeasurementsCallback_Landroid_location_GnssMeasurementRequest_Ljava_util_concurrent_Executor_Landroid_location_GnssMeasurementsEvent_Callback_Handler", ApiSince=31)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")>]
abstract member RegisterGnssMeasurementsCallback : Android.Locations.GnssMeasurementRequest * Java.Util.Concurrent.IExecutor * Android.Locations.GnssMeasurementsEvent.Callback -> bool
override this.RegisterGnssMeasurementsCallback : Android.Locations.GnssMeasurementRequest * Java.Util.Concurrent.IExecutor * Android.Locations.GnssMeasurementsEvent.Callback -> bool
Parameters
- request
- GnssMeasurementRequest
extra parameters to pass to GNSS measurement provider. For example, if GnssMeasurementRequest.isFullTracking() is true, GNSS chipset switches off duty cycling. This value cannot be null.
- executor
- IExecutor
the executor that the callback runs on. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.
- callback
- GnssMeasurementsEvent.Callback
a GnssMeasurementsEvent.Callback object to register. This value cannot be null.
Returns
true always
- Attributes
Remarks
Registers a GNSS measurement callback. Requires Manifest.permission.ACCESS_FINE_LOCATION
Android reference for android.location.LocationManager.registerGnssMeasurementsCallback.
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.