Added in API level 1
Deprecated in API level 31

LocationProvider

open class LocationProvider
kotlin.Any
   ↳ android.location.LocationProvider

Information about the properties of a location provider.

Summary

Constants
static Int

static Int

static Int

Public methods
open Int

Returns the rough accuracy of this provider, one of the ProviderProperties.

open String!

Returns the name of this provider.

open Int

Returns the power requirement for this provider, one of the ProviderProperties.

open Boolean

Returns true if the use of this provider may result in a monetary charge to the user, false if use is free.

open Boolean
meetsCriteria(criteria: Criteria!)

Returns true if this provider meets the given criteria, false otherwise.

open Boolean

Returns true if the provider requires access to an appropriate cellular network (e.g., to make use of cell tower IDs), false otherwise.

open Boolean

Returns true if the provider requires access to a data network (e.g., the Internet), false otherwise.

open Boolean

Returns true if the provider requires access to a satellite-based positioning system (e.g., GPS), false otherwise.

open Boolean

Returns true if the provider is able to provide altitude information, false otherwise.

open Boolean

Returns true if the provider is able to provide bearing information, false otherwise.

open Boolean

Returns true if the provider is able to provide speed information, false otherwise.

Constants

AVAILABLE

Added in API level 1
Deprecated in API level 29
static val AVAILABLE: Int

Deprecated: Location provider statuses are no longer supported.

Value: 2

OUT_OF_SERVICE

Added in API level 1
Deprecated in API level 29
static val OUT_OF_SERVICE: Int

Deprecated: Location provider statuses are no longer supported.

Value: 0

TEMPORARILY_UNAVAILABLE

Added in API level 1
Deprecated in API level 29
static val TEMPORARILY_UNAVAILABLE: Int

Deprecated: Location provider statuses are no longer supported.

Value: 1

Public methods

getAccuracy

Added in API level 1
open fun getAccuracy(): Int

Deprecated: Deprecated in Java.

Returns the rough accuracy of this provider, one of the ProviderProperties.ACCURACY_* constants.

getName

Added in API level 1
open fun getName(): String!

Deprecated: Deprecated in Java.

Returns the name of this provider.

getPowerRequirement

Added in API level 1
open fun getPowerRequirement(): Int

Deprecated: Deprecated in Java.

Returns the power requirement for this provider, one of the ProviderProperties.POWER_USAGE_* constants.

hasMonetaryCost

Added in API level 1
open fun hasMonetaryCost(): Boolean

Deprecated: Deprecated in Java.

Returns true if the use of this provider may result in a monetary charge to the user, false if use is free. It is up to each provider to give accurate information.

meetsCriteria

Added in API level 1
open fun meetsCriteria(criteria: Criteria!): Boolean

Deprecated: Deprecated in Java.

Returns true if this provider meets the given criteria, false otherwise.

requiresCell

Added in API level 1
open fun requiresCell(): Boolean

Deprecated: Deprecated in Java.

Returns true if the provider requires access to an appropriate cellular network (e.g., to make use of cell tower IDs), false otherwise.

requiresNetwork

Added in API level 1
open fun requiresNetwork(): Boolean

Deprecated: Deprecated in Java.

Returns true if the provider requires access to a data network (e.g., the Internet), false otherwise.

requiresSatellite

Added in API level 1
open fun requiresSatellite(): Boolean

Deprecated: Deprecated in Java.

Returns true if the provider requires access to a satellite-based positioning system (e.g., GPS), false otherwise.

supportsAltitude

Added in API level 1
open fun supportsAltitude(): Boolean

Deprecated: Deprecated in Java.

Returns true if the provider is able to provide altitude information, false otherwise. A provider that reports altitude under most circumstances but may occassionally not report it should return true.

supportsBearing

Added in API level 1
open fun supportsBearing(): Boolean

Deprecated: Deprecated in Java.

Returns true if the provider is able to provide bearing information, false otherwise. A provider that reports bearing under most circumstances but may occassionally not report it should return true.

supportsSpeed

Added in API level 1
open fun supportsSpeed(): Boolean

Deprecated: Deprecated in Java.

Returns true if the provider is able to provide speed information, false otherwise. A provider that reports speed under most circumstances but may occassionally not report it should return true.