Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/location/Criteria#constants) \| [Inherited Constants](https://developer.android.com/reference/android/location/Criteria#inhconstants) \| [Fields](https://developer.android.com/reference/android/location/Criteria#lfields) \| [Ctors](https://developer.android.com/reference/android/location/Criteria#pubctors) \| [Methods](https://developer.android.com/reference/android/location/Criteria#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/location/Criteria#inhmethods)

# Criteria

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/location/Criteria "View this page in Kotlin") \|Java


`
public


class
Criteria
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.location.Criteria |

<br />

*** ** * ** ***


**This class was deprecated
in API level 34.**   

Criteria based APIs are deprecated because they cannot fully capture the complexity
of location providers, and encourage bad development practices. Prefer to explicit
select the location provider of interest (`https://developer.android.com/reference/android/location/LocationManager#FUSED_PROVIDER`,
`https://developer.android.com/reference/android/location/LocationManager#GPS_PROVIDER`, etc), rather than relying on 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 ||
|---|---|
| `int` | `https://developer.android.com/reference/android/location/Criteria#ACCURACY_COARSE` A constant indicating an approximate accuracy requirement |
| `int` | `https://developer.android.com/reference/android/location/Criteria#ACCURACY_FINE` A constant indicating a finer location accuracy requirement |
| `int` | `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` a constant indicating a high accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy. |
| `int` | `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` A constant indicating a low location accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy. |
| `int` | `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` A constant indicating a medium accuracy requirement - currently used only for horizontal accuracy. |
| `int` | `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` A constant indicating that the application does not choose to place requirement on a particular feature. |
| `int` | `https://developer.android.com/reference/android/location/Criteria#POWER_HIGH` A constant indicating a high power requirement. |
| `int` | `https://developer.android.com/reference/android/location/Criteria#POWER_LOW` A constant indicating a low power requirement. |
| `int` | `https://developer.android.com/reference/android/location/Criteria#POWER_MEDIUM` A constant indicating a medium power requirement. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/location/Criteria>` | `https://developer.android.com/reference/android/location/Criteria#CREATOR` |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/location/Criteria#Criteria()() ` Constructs a new Criteria object. |
| ` https://developer.android.com/reference/android/location/Criteria#Criteria(android.location.Criteria)(https://developer.android.com/reference/android/location/Criteria criteria) ` Constructs a new Criteria object that is a copy of the given criteria. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/location/Criteria#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/location/Criteria#getAccuracy()() ` Returns a constant indicating desired accuracy of location. |
| ` int` | ` https://developer.android.com/reference/android/location/Criteria#getBearingAccuracy()() ` Returns a constant indicating the desired bearing accuracy. |
| ` int` | ` https://developer.android.com/reference/android/location/Criteria#getHorizontalAccuracy()() ` Returns a constant indicating the desired horizontal accuracy (latitude and longitude). |
| ` int` | ` https://developer.android.com/reference/android/location/Criteria#getPowerRequirement()() ` Returns a constant indicating the desired maximum power requirement. |
| ` int` | ` https://developer.android.com/reference/android/location/Criteria#getSpeedAccuracy()() ` Returns a constant indicating the desired speed accuracy. |
| ` int` | ` https://developer.android.com/reference/android/location/Criteria#getVerticalAccuracy()() ` Returns a constant indicating the desired vertical accuracy (altitude). |
| ` boolean` | ` https://developer.android.com/reference/android/location/Criteria#isAltitudeRequired()() ` Returns whether the provider must provide altitude information. |
| ` boolean` | ` https://developer.android.com/reference/android/location/Criteria#isBearingRequired()() ` Returns whether the provider must provide bearing information. |
| ` boolean` | ` https://developer.android.com/reference/android/location/Criteria#isCostAllowed()() ` Returns whether the provider is allowed to incur monetary cost. |
| ` boolean` | ` https://developer.android.com/reference/android/location/Criteria#isSpeedRequired()() ` Returns whether the provider must provide speed information. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setAccuracy(int)(int accuracy) ` Indicates the desired accuracy for latitude and longitude. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setAltitudeRequired(boolean)(boolean altitudeRequired) ` Indicates whether the provider must provide altitude information. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setBearingAccuracy(int)(int accuracy) ` Indicates the desired bearing accuracy. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setBearingRequired(boolean)(boolean bearingRequired) ` Indicates whether the provider must provide bearing information. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setCostAllowed(boolean)(boolean costAllowed) ` Indicates whether the provider is allowed to incur monetary cost. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setHorizontalAccuracy(int)(int accuracy) ` Indicates the desired horizontal accuracy (latitude and longitude). |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setPowerRequirement(int)(int powerRequirement) ` Indicates the desired maximum power requirement. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setSpeedAccuracy(int)(int accuracy) ` Indicates the desired speed accuracy. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setSpeedRequired(boolean)(boolean speedRequired) ` Indicates whether the provider must provide speed information. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#setVerticalAccuracy(int)(int accuracy) ` Indicates the desired vertical accuracy (altitude). |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/location/Criteria#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/location/Criteria#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel parcel, int flags) ` Flatten this object in to a Parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### ACCURACY_COARSE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ACCURACY_COARSE
```

A constant indicating an approximate accuracy requirement

<br />

Constant Value:

2
(0x00000002)


### ACCURACY_FINE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ACCURACY_FINE
```

A constant indicating a finer location accuracy requirement

<br />

Constant Value:

1
(0x00000001)


### ACCURACY_HIGH

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ACCURACY_HIGH
```

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.

<br />

Constant Value:

3
(0x00000003)


### ACCURACY_LOW

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ACCURACY_LOW
```

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.

<br />

Constant Value:

1
(0x00000001)


### ACCURACY_MEDIUM

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ACCURACY_MEDIUM
```

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.

<br />

Constant Value:

2
(0x00000002)


### NO_REQUIREMENT

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int NO_REQUIREMENT
```

A constant indicating that the application does not choose to
place requirement on a particular feature.

<br />

Constant Value:

0
(0x00000000)


### POWER_HIGH

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int POWER_HIGH
```

A constant indicating a high power requirement.

<br />

Constant Value:

3
(0x00000003)


### POWER_LOW

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int POWER_LOW
```

A constant indicating a low power requirement.

<br />

Constant Value:

1
(0x00000001)


### POWER_MEDIUM

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int POWER_MEDIUM
```

A constant indicating a medium power requirement.

<br />

Constant Value:

2
(0x00000002)


## Fields

### CREATOR

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<Criteria> CREATOR
```

<br />

<br />

## Public constructors

### Criteria

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

### Criteria

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Criteria (Criteria criteria)
```

Constructs a new Criteria object that is a copy of the given criteria.

<br />

| Parameters ||
|---|---|
| `criteria` | `Criteria` <br /> |

## Public methods

### describeContents

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getAccuracy

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getAccuracy ()
```

Returns a constant indicating desired accuracy of location.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_FINE` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_COARSE` |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setAccuracy(int)`

### getBearingAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getBearingAccuracy ()
```

Returns a constant indicating the desired bearing accuracy.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setBearingAccuracy(int)`

### getHorizontalAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getHorizontalAccuracy ()
```

Returns a constant indicating the desired horizontal accuracy (latitude and longitude).

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setHorizontalAccuracy(int)`

### getPowerRequirement

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getPowerRequirement ()
```

Returns a constant indicating the desired maximum power requirement.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#POWER_LOW` - `https://developer.android.com/reference/android/location/Criteria#POWER_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#POWER_HIGH` |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setPowerRequirement(int)`

### getSpeedAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSpeedAccuracy ()
```

Returns a constant indicating the desired speed accuracy.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setSpeedAccuracy(int)`

### getVerticalAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getVerticalAccuracy ()
```

Returns a constant indicating the desired vertical accuracy (altitude).

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setVerticalAccuracy(int)`

### isAltitudeRequired

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAltitudeRequired ()
```

Returns whether the provider must provide altitude information.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setAltitudeRequired(boolean)`

### isBearingRequired

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isBearingRequired ()
```

Returns whether the provider must provide bearing information.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setBearingRequired(boolean)`

### isCostAllowed

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isCostAllowed ()
```

Returns whether the provider is allowed to incur monetary cost.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isSpeedRequired

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isSpeedRequired ()
```

Returns whether the provider must provide speed information.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/location/Criteria#setSpeedRequired(boolean)`

### setAccuracy

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAccuracy (int accuracy)
```

Indicates the desired accuracy for latitude and longitude. Accuracy may be
`https://developer.android.com/reference/android/location/Criteria#ACCURACY_FINE` or `https://developer.android.com/reference/android/location/Criteria#ACCURACY_COARSE`. More accurate location may consume more
power and may take longer.

<br />

| Parameters ||
|---|---|
| `accuracy` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_FINE` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_COARSE` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if accuracy is not one of the supported constants |

### setAltitudeRequired

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAltitudeRequired (boolean altitudeRequired)
```

Indicates whether the provider must provide altitude information. Not all fixes are
guaranteed to contain such information.

<br />

| Parameters ||
|---|---|
| `altitudeRequired` | `boolean` <br /> |

### setBearingAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setBearingAccuracy (int accuracy)
```

Indicates the desired bearing accuracy. Accuracy may be `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW`,
`https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM`, `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH`, or `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT`. More accurate
location may consume more power and may take longer.

<br />

| Parameters ||
|---|---|
| `accuracy` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if accuracy is not one of the supported constants |

### setBearingRequired

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setBearingRequired (boolean bearingRequired)
```

Indicates whether the provider must provide bearing information. Not all fixes are guaranteed
to contain such information.

<br />

| Parameters ||
|---|---|
| `bearingRequired` | `boolean` <br /> |

### setCostAllowed

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setCostAllowed (boolean costAllowed)
```

Indicates whether the provider is allowed to incur monetary cost.

<br />

| Parameters ||
|---|---|
| `costAllowed` | `boolean` <br /> |

### setHorizontalAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setHorizontalAccuracy (int accuracy)
```

Indicates the desired horizontal accuracy (latitude and longitude). Accuracy may be
`https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW`, `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM`, `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` or
`https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT`. More accurate location may consume more power and may take longer.

<br />

| Parameters ||
|---|---|
| `accuracy` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if accuracy is not one of the supported constants |

### setPowerRequirement

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setPowerRequirement (int powerRequirement)
```

Indicates the desired maximum power requirement. The power requirement parameter may be
`https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT`, `https://developer.android.com/reference/android/location/Criteria#POWER_LOW`, `https://developer.android.com/reference/android/location/Criteria#POWER_MEDIUM`, or `https://developer.android.com/reference/android/location/Criteria#POWER_HIGH`.

<br />

| Parameters ||
|---|---|
| `powerRequirement` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#POWER_LOW` - `https://developer.android.com/reference/android/location/Criteria#POWER_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#POWER_HIGH` |

### setSpeedAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSpeedAccuracy (int accuracy)
```

Indicates the desired speed accuracy. Accuracy may be `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW`,
`https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM`, `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH`, or `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT`. More accurate
location may consume more power and may take longer.

<br />

| Parameters ||
|---|---|
| `accuracy` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if accuracy is not one of the supported constants |

### setSpeedRequired

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSpeedRequired (boolean speedRequired)
```

Indicates whether the provider must provide speed information. Not all fixes are guaranteed
to contain such information.

<br />

| Parameters ||
|---|---|
| `speedRequired` | `boolean` <br /> |

### setVerticalAccuracy

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVerticalAccuracy (int accuracy)
```

Indicates the desired vertical accuracy (altitude). Accuracy may be `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW`,
`https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM`, `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` or `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT`. More accurate
location may consume more power and may take longer.

<br />

| Parameters ||
|---|---|
| `accuracy` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/location/Criteria#NO_REQUIREMENT` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_LOW` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_MEDIUM` - `https://developer.android.com/reference/android/location/Criteria#ACCURACY_HIGH` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if accuracy is not one of the supported constants |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel parcel, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `parcel` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |