Criteria
open classCriteria: Parcelable
| kotlin.Any | |
| ↳ | android.location.Criteria |
A class indicating the application criteria for selecting a location provider. Providers may be ordered according to accuracy, power usage, ability to report altitude, speed, bearing, and monetary cost.
Summary
| Constants | |
|---|---|
| static Int |
A constant indicating an approximate accuracy requirement |
| static Int |
A constant indicating a finer location accuracy requirement |
| static Int |
a constant indicating a high accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy. |
| static Int |
A constant indicating a low location accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy. |
| static Int |
A constant indicating a medium accuracy requirement - currently used only for horizontal accuracy. |
| static Int |
A constant indicating that the application does not choose to place requirement on a particular feature. |
| static Int |
A constant indicating a high power requirement. |
| static Int |
A constant indicating a low power requirement. |
| static Int |
A constant indicating a medium power requirement. |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
Criteria()Constructs a new Criteria object. |
|
|
Constructs a new Criteria object that is a copy of the given criteria. |
|
| Public methods | |
|---|---|
| open Int | |
| open Int |
Returns a constant indicating desired accuracy of location. |
| open Int |
Returns a constant indicating the desired bearing accuracy. |
| open Int |
Returns a constant indicating the desired horizontal accuracy (latitude and longitude). |
| open Int |
Returns a constant indicating the desired maximum power requirement. |
| open Int |
Returns a constant indicating the desired speed accuracy. |
| open Int |
Returns a constant indicating the desired vertical accuracy (altitude). |
| open Boolean |
Returns whether the provider must provide altitude information. |
| open Boolean |
Returns whether the provider must provide bearing information. |
| open Boolean |
Returns whether the provider is allowed to incur monetary cost. |
| open Boolean |
Returns whether the provider must provide speed information. |
| open Unit |
setAccuracy(accuracy: Int)Indicates the desired accuracy for latitude and longitude. |
| open Unit |
setAltitudeRequired(altitudeRequired: Boolean)Indicates whether the provider must provide altitude information. |
| open Unit |
setBearingAccuracy(accuracy: Int)Indicates the desired bearing accuracy. |
| open Unit |
setBearingRequired(bearingRequired: Boolean)Indicates whether the provider must provide bearing information. |
| open Unit |
setCostAllowed(costAllowed: Boolean)Indicates whether the provider is allowed to incur monetary cost. |
| open Unit |
setHorizontalAccuracy(accuracy: Int)Indicates the desired horizontal accuracy (latitude and longitude). |
| open Unit |
setPowerRequirement(powerRequirement: Int)Indicates the desired maximum power requirement. |
| open Unit |
setSpeedAccuracy(accuracy: Int)Indicates the desired speed accuracy. |
| open Unit |
setSpeedRequired(speedRequired: Boolean)Indicates whether the provider must provide speed information. |
| open Unit |
setVerticalAccuracy(accuracy: Int)Indicates the desired vertical accuracy (altitude). |
| open String |
toString() |
| open Unit |
writeToParcel(parcel: Parcel, flags: Int) |
| Properties | |
|---|---|
| static Parcelable.Creator<Criteria!> | |
Constants
ACCURACY_COARSE
static valACCURACY_COARSE: Int
Deprecated: Deprecated in Java.
A constant indicating an approximate accuracy requirement
Value: 2ACCURACY_FINE
static valACCURACY_FINE: Int
Deprecated: Deprecated in Java.
A constant indicating a finer location accuracy requirement
Value: 1ACCURACY_HIGH
static valACCURACY_HIGH: Int
Deprecated: Deprecated in Java.
a constant indicating a high accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy. For horizontal and vertical position this corresponds roughly to an accuracy of less than 100 meters.
Value: 3ACCURACY_LOW
static valACCURACY_LOW: Int
Deprecated: Deprecated in Java.
A constant indicating a low location accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy. For horizontal and vertical position this corresponds roughly to an accuracy of greater than 500 meters.
Value: 1ACCURACY_MEDIUM
static valACCURACY_MEDIUM: Int
Deprecated: Deprecated in Java.
A constant indicating a medium accuracy requirement - currently used only for horizontal accuracy. For horizontal position this corresponds roughly to to an accuracy of between 100 and 500 meters.
Value: 2NO_REQUIREMENT
static valNO_REQUIREMENT: Int
Deprecated: Deprecated in Java.
A constant indicating that the application does not choose to place requirement on a particular feature.
Value: 0POWER_HIGH
static valPOWER_HIGH: Int
Deprecated: Deprecated in Java.
A constant indicating a high power requirement.
Value: 3POWER_LOW
static valPOWER_LOW: Int
Deprecated: Deprecated in Java.
A constant indicating a low power requirement.
Value: 1POWER_MEDIUM
static valPOWER_MEDIUM: Int
Deprecated: Deprecated in Java.
A constant indicating a medium power requirement.
Value: 2Public constructors
Criteria
Criteria()
Constructs a new Criteria object. The new object will have no requirements on accuracy, power, or response time; will not require altitude, speed, or bearing; and will not allow monetary cost.
Criteria
Criteria(criteria: Criteria!)
Constructs a new Criteria object that is a copy of the given criteria.
Public methods
describeContents
open fundescribeContents(): Int
Deprecated: Deprecated in Java.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getAccuracy
open fungetAccuracy(): Int
Deprecated: Deprecated in Java.
Returns a constant indicating desired accuracy of location.
| Return | |
|---|---|
Int |
Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#ACCURACY_FINE, or android.location.Criteria#ACCURACY_COARSE |
See Also
getBearingAccuracy
open fungetBearingAccuracy(): Int
Deprecated: Deprecated in Java.
Returns a constant indicating the desired bearing accuracy.
| Return | |
|---|---|
Int |
Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#ACCURACY_LOW, android.location.Criteria#ACCURACY_MEDIUM, or android.location.Criteria#ACCURACY_HIGH |
See Also
getHorizontalAccuracy
open fungetHorizontalAccuracy(): Int
Deprecated: Deprecated in Java.
Returns a constant indicating the desired horizontal accuracy (latitude and longitude).
| Return | |
|---|---|
Int |
Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#ACCURACY_LOW, android.location.Criteria#ACCURACY_MEDIUM, or android.location.Criteria#ACCURACY_HIGH |
See Also
getPowerRequirement
open fungetPowerRequirement(): Int
Deprecated: Deprecated in Java.
Returns a constant indicating the desired maximum power requirement.
| Return | |
|---|---|
Int |
Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#POWER_LOW, android.location.Criteria#POWER_MEDIUM, or android.location.Criteria#POWER_HIGH |
See Also
getSpeedAccuracy
open fungetSpeedAccuracy(): Int
Deprecated: Deprecated in Java.
Returns a constant indicating the desired speed accuracy.
| Return | |
|---|---|
Int |
Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#ACCURACY_LOW, android.location.Criteria#ACCURACY_MEDIUM, or android.location.Criteria#ACCURACY_HIGH |
See Also
getVerticalAccuracy
open fungetVerticalAccuracy(): Int
Deprecated: Deprecated in Java.
Returns a constant indicating the desired vertical accuracy (altitude).
| Return | |
|---|---|
Int |
Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#ACCURACY_LOW, android.location.Criteria#ACCURACY_MEDIUM, or android.location.Criteria#ACCURACY_HIGH |
See Also
isAltitudeRequired
open funisAltitudeRequired(): Boolean
Deprecated: Deprecated in Java.
Returns whether the provider must provide altitude information.
See Also
isBearingRequired
open funisBearingRequired(): Boolean
Deprecated: Deprecated in Java.
Returns whether the provider must provide bearing information.
See Also
isCostAllowed
open funisCostAllowed(): Boolean
Deprecated: Deprecated in Java.
Returns whether the provider is allowed to incur monetary cost.
isSpeedRequired
open funisSpeedRequired(): Boolean
Deprecated: Deprecated in Java.
Returns whether the provider must provide speed information.
See Also
setAccuracy
open funsetAccuracy(accuracy: Int): Unit
Deprecated: Deprecated in Java.
Indicates the desired accuracy for latitude and longitude. Accuracy may be ACCURACY_FINE or ACCURACY_COARSE. More accurate location may consume more power and may take longer.
| Parameters | |
|---|---|
accuracy |
Int: Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#ACCURACY_FINE, or android.location.Criteria#ACCURACY_COARSE |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if accuracy is not one of the supported constants |
setAltitudeRequired
open funsetAltitudeRequired(altitudeRequired: Boolean): Unit
Deprecated: Deprecated in Java.
Indicates whether the provider must provide altitude information. Not all fixes are guaranteed to contain such information.
setBearingAccuracy
open funsetBearingAccuracy(accuracy: Int): Unit
Deprecated: Deprecated in Java.
Indicates the desired bearing accuracy. Accuracy may be ACCURACY_LOW, ACCURACY_MEDIUM, ACCURACY_HIGH, or NO_REQUIREMENT. More accurate location may consume more power and may take longer.
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if accuracy is not one of the supported constants |
setBearingRequired
open funsetBearingRequired(bearingRequired: Boolean): Unit
Deprecated: Deprecated in Java.
Indicates whether the provider must provide bearing information. Not all fixes are guaranteed to contain such information.
setCostAllowed
open funsetCostAllowed(costAllowed: Boolean): Unit
Deprecated: Deprecated in Java.
Indicates whether the provider is allowed to incur monetary cost.
setHorizontalAccuracy
open funsetHorizontalAccuracy(accuracy: Int): Unit
Deprecated: Deprecated in Java.
Indicates the desired horizontal accuracy (latitude and longitude). Accuracy may be ACCURACY_LOW, ACCURACY_MEDIUM, ACCURACY_HIGH or NO_REQUIREMENT. More accurate location may consume more power and may take longer.
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if accuracy is not one of the supported constants |
setPowerRequirement
open funsetPowerRequirement(powerRequirement: Int): Unit
Deprecated: Deprecated in Java.
Indicates the desired maximum power requirement. The power requirement parameter may be NO_REQUIREMENT, POWER_LOW, POWER_MEDIUM, or POWER_HIGH.
| Parameters | |
|---|---|
powerRequirement |
Int: Value is android.location.Criteria#NO_REQUIREMENT, android.location.Criteria#POWER_LOW, android.location.Criteria#POWER_MEDIUM, or android.location.Criteria#POWER_HIGH |
setSpeedAccuracy
open funsetSpeedAccuracy(accuracy: Int): Unit
Deprecated: Deprecated in Java.
Indicates the desired speed accuracy. Accuracy may be ACCURACY_LOW, ACCURACY_MEDIUM, ACCURACY_HIGH, or NO_REQUIREMENT. More accurate location may consume more power and may take longer.
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if accuracy is not one of the supported constants |
setSpeedRequired
open funsetSpeedRequired(speedRequired: Boolean): Unit
Deprecated: Deprecated in Java.
Indicates whether the provider must provide speed information. Not all fixes are guaranteed to contain such information.
setVerticalAccuracy
open funsetVerticalAccuracy(accuracy: Int): Unit
Deprecated: Deprecated in Java.
Indicates the desired vertical accuracy (altitude). Accuracy may be ACCURACY_LOW, ACCURACY_MEDIUM, ACCURACY_HIGH or NO_REQUIREMENT. More accurate location may consume more power and may take longer.
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if accuracy is not one of the supported constants |
toString
open funtoString(): String
Deprecated: Deprecated in Java.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
open funwriteToParcel(
parcel: Parcel,
flags: Int
): Unit
Deprecated: Deprecated in Java.
| Parameters | |
|---|---|
dest |
The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CREATOR
static valCREATOR: Parcelable.Creator<Criteria!>
Deprecated: Deprecated in Java.