Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.location.provider.ProviderProperties.Builder

Builder for ProviderProperties.

Summary

Public constructors

Builder(providerProperties: ProviderProperties)

Public methods
ProviderProperties

Builds a new ProviderProperties.

ProviderProperties.Builder
setAccuracy(accuracy: Int)

Sets a very rough bucket of provider location accuracy.

ProviderProperties.Builder
setHasAltitudeSupport(supportsAltitude: Boolean)

Sets whether a provider can provide altitude information.

ProviderProperties.Builder
setHasBearingSupport(supportsBearing: Boolean)

Sets whether a provider can provide bearing information.

ProviderProperties.Builder

Sets whether a provider requires cell tower access.

ProviderProperties.Builder
setHasMonetaryCost(monetaryCost: Boolean)

Sets whether a provider has a monetary cost.

ProviderProperties.Builder

Sets whether a provider requires network access.

ProviderProperties.Builder
setHasSatelliteRequirement(requiresSatellite: Boolean)

Sets whether a provider requires satellite access.

ProviderProperties.Builder
setHasSpeedSupport(supportsSpeed: Boolean)

Sets whether a provider can provide speed information.

ProviderProperties.Builder
setPowerUsage(powerUsage: Int)

Sets a very rough bucket of provider power usage.

Public constructors

Builder

Added in API level 31
Builder()

Builder

Added in API level 31
Builder(providerProperties: ProviderProperties)
Parameters
providerProperties ProviderProperties: This value cannot be null.

Public methods

build

Added in API level 31
fun build(): ProviderProperties

Builds a new ProviderProperties.

Return
ProviderProperties This value cannot be null.

setAccuracy

Added in API level 31
fun setAccuracy(accuracy: Int): ProviderProperties.Builder

Sets a very rough bucket of provider location accuracy. ACCURACY_COARSE by default.

Parameters
accuracy Int: Value is android.location.provider.ProviderProperties#ACCURACY_FINE, or android.location.provider.ProviderProperties#ACCURACY_COARSE
Return
ProviderProperties.Builder This value cannot be null.

setHasAltitudeSupport

Added in API level 31
fun setHasAltitudeSupport(supportsAltitude: Boolean): ProviderProperties.Builder

Sets whether a provider can provide altitude information. False by default.

Return
ProviderProperties.Builder This value cannot be null.

setHasBearingSupport

Added in API level 31
fun setHasBearingSupport(supportsBearing: Boolean): ProviderProperties.Builder

Sets whether a provider can provide bearing information. False by default.

Return
ProviderProperties.Builder This value cannot be null.

setHasCellRequirement

Added in API level 31
fun setHasCellRequirement(requiresCell: Boolean): ProviderProperties.Builder

Sets whether a provider requires cell tower access. False by default.

Return
ProviderProperties.Builder This value cannot be null.

setHasMonetaryCost

Added in API level 31
fun setHasMonetaryCost(monetaryCost: Boolean): ProviderProperties.Builder

Sets whether a provider has a monetary cost. False by default.

Return
ProviderProperties.Builder This value cannot be null.

setHasNetworkRequirement

Added in API level 31
fun setHasNetworkRequirement(requiresNetwork: Boolean): ProviderProperties.Builder

Sets whether a provider requires network access. False by default.

Return
ProviderProperties.Builder This value cannot be null.

setHasSatelliteRequirement

Added in API level 31
fun setHasSatelliteRequirement(requiresSatellite: Boolean): ProviderProperties.Builder

Sets whether a provider requires satellite access. False by default.

Return
ProviderProperties.Builder This value cannot be null.

setHasSpeedSupport

Added in API level 31
fun setHasSpeedSupport(supportsSpeed: Boolean): ProviderProperties.Builder

Sets whether a provider can provide speed information. False by default.

Return
ProviderProperties.Builder This value cannot be null.

setPowerUsage

Added in API level 31
fun setPowerUsage(powerUsage: Int): ProviderProperties.Builder

Sets a very rough bucket of provider power usage. POWER_USAGE_HIGH by default.

Parameters
powerUsage Int: Value is android.location.provider.ProviderProperties#POWER_USAGE_LOW, android.location.provider.ProviderProperties#POWER_USAGE_MEDIUM, or android.location.provider.ProviderProperties#POWER_USAGE_HIGH
Return
ProviderProperties.Builder This value cannot be null.