Builder

A builder class for LocationRequestCompat.

Constructors

Link copied to clipboard
constructor(intervalMillis: Long)
Creates a new Builder with the given interval.
constructor(@NonNull locationRequest: @NonNull LocationRequestCompat)
Creates a new Builder with all parameters copied from the given location request.

Functions

Link copied to clipboard
@NonNull
open fun build(): @NonNull LocationRequestCompat
Builds a location request from this builder.
Link copied to clipboard
Clears an explicitly set minimum update interval and reverts to an implicit minimum update interval (ie, the minimum update interval is the same value as the interval).
Link copied to clipboard
@NonNull
open fun setDurationMillis(@IntRange(from = 1) durationMillis: Long): @NonNull LocationRequestCompat.Builder
Sets the duration this request will continue before being automatically removed.
Link copied to clipboard
@NonNull
open fun setIntervalMillis(@IntRange(from = 0) intervalMillis: Long): @NonNull LocationRequestCompat.Builder
Sets the request interval.
Link copied to clipboard
@NonNull
open fun setMaxUpdateDelayMillis(@IntRange(from = 0) maxUpdateDelayMillis: Long): @NonNull LocationRequestCompat.Builder
Sets the maximum time any location update may be delayed, and thus grouped with following updates to enable location batching.
Link copied to clipboard
@NonNull
open fun setMaxUpdates(@IntRange(from = 1, to = Integer.MAX_VALUE) maxUpdates: Int): @NonNull LocationRequestCompat.Builder
Sets the maximum number of location updates for this request before this request is automatically removed.
Link copied to clipboard
@NonNull
open fun setMinUpdateDistanceMeters(@FloatRange(from = 0, to = Float.MAX_VALUE) minUpdateDistanceMeters: Float): @NonNull LocationRequestCompat.Builder
Sets the minimum update distance between location updates.
Link copied to clipboard
@NonNull
open fun setMinUpdateIntervalMillis(@IntRange(from = 0) minUpdateIntervalMillis: Long): @NonNull LocationRequestCompat.Builder
Sets an explicit minimum update interval.
Link copied to clipboard
@NonNull
open fun setQuality(quality: Int): @NonNull LocationRequestCompat.Builder
Sets the request quality.