Reference:Android.location.Criteria
From Triled Wiki
android.location
public class android.location.Criteria
| java.lang.Object | ||
| android.location.Criteria | Parcelable | |
A class indicating the application criteria for selecting a location provider. Providers maybe ordered according to accuracy, power usage, ability to report altitude, speed, and bearing, and monetary cost.
[edit] Summary
[edit] Constants
| Value | ||||
|---|---|---|---|---|
| Creator | CREATOR | |||
| int | NO_REQUIREMENT | A constant indicating that the application does not choose to place requirement on a particular feature. | 0 | 0x00000000 |
| int | POWER_HIGH | A constant indicating a high power requirement. | 3 | 0x00000003 |
| int | POWER_LOW | A constant indicating a low power requirement. | 1 | 0x00000001 |
| int | POWER_MEDIUM | A constant indicating a medium power requirement. | 2 | 0x00000002 |
[edit] Public Constructors
| Criteria () | |||||
| Constructs a new Criteria object. | |||||
| Criteria (Criteria criteria) | |||||
| Constructs a new Criteria object that is a copy of the given criteria. | |||||
[edit] Public Methods
| int | getAccuracy () | ||||
| Returns the desired accuracy of latitude/longitude coordinates, in meters. | |||||
| int | getPowerRequirement () | ||||
| Returns a constant indicating the desired power requirement. | |||||
| boolean | isAltitudeRequired () | ||||
| Returns whether the provider must provide altitude information. | |||||
| boolean | isBearingRequired () | ||||
| Returns whether the provider must provide bearing information. | |||||
| boolean | isCostAllowed () | ||||
| Returns whether the provider is allowed to incur monetary cost. | |||||
| boolean | isSpeedRequired () | ||||
| Returns whether the provider must provide speed information. | |||||
| void | setAccuracy (int accuracy) | ||||
| Indicates the desired accuracy for latitude and longitude, in meters. | |||||
| void | setAltitudeRequired (boolean altitudeRequired) | ||||
| Indicates whether the provider must provide altitude information. | |||||
| void | setBearingRequired (boolean bearingRequired) | ||||
| Indicates whether the provider must provide bearing information. | |||||
| void | setCostAllowed (boolean costAllowed) | ||||
| Indicates whether the provider is allowed to incur monetary cost. | |||||
| void | setPowerRequirement (int level) | ||||
| Indicates the desired maximum power level. | |||||
| void | setSpeedRequired (boolean speedRequired) | ||||
| Indicates whether the provider must provide speed information. | |||||
| void | writeToParcel (Parcel parcel) | ||||
[edit] Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait[edit] Methods inherited from interface android.os.Parcelable
[edit] Details
[edit] Constants
[edit] public static final Creator CREATOR
[edit] public static final int NO_REQUIREMENT
A constant indicating that the application does not choose to place requirement on a particular feature. Constant Value: 0 (0x00000000)
[edit] public static final int POWER_HIGH
A constant indicating a high power requirement. Constant Value: 3 (0x00000003)
[edit] public static final int POWER_LOW
A constant indicating a low power requirement. Constant Value: 1 (0x00000001)
[edit] public static final int POWER_MEDIUM
A constant indicating a medium power requirement. Constant Value: 2 (0x00000002)
[edit] Public Constructors
[edit] 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.
[edit] public Criteria(Criteria criteria)
Constructs a new Criteria object that is a copy of the given criteria.
[edit] Public Methods
[edit] public int getAccuracy()
Returns the desired accuracy of latitude/longitude coordinates, in meters.
[edit] public int getPowerRequirement()
Returns a constant indicating the desired power requirement. The returned
[edit] public boolean isAltitudeRequired()
Returns whether the provider must provide altitude information. Not all fixes are guaranteed to contain such information.
[edit] public boolean isBearingRequired()
Returns whether the provider must provide bearing information. Not all fixes are guaranteed to contain such information.
[edit] public boolean isCostAllowed()
Returns whether the provider is allowed to incur monetary cost.
[edit] public boolean isSpeedRequired()
Returns whether the provider must provide speed information. Not all fixes are guaranteed to contain such information.
[edit] public void setAccuracy(int accuracy)
Indicates the desired accuracy for latitude and longitude, in meters. The default accuracy is 1 kilometer (1000 meters).
Throws
| IllegalArgumentException | if accuracy is negative |
|---|
[edit] public void setAltitudeRequired(boolean altitudeRequired)
Indicates whether the provider must provide altitude information. Not all fixes are guaranteed to contain such information.
[edit] public void setBearingRequired(boolean bearingRequired)
Indicates whether the provider must provide bearing information. Not all fixes are guaranteed to contain such information.
[edit] public void setCostAllowed(boolean costAllowed)
Indicates whether the provider is allowed to incur monetary cost.
[edit] public void setPowerRequirement(int level)
Indicates the desired maximum power level. The level parameter must be one of NO_REQUIREMENT, POWER_LOW, POWER_MEDIUM, or POWER_HIGH.
[edit] public void setSpeedRequired(boolean speedRequired)
Indicates whether the provider must provide speed information. Not all fixes are guaranteed to contain such information.
[edit] public void writeToParcel(Parcel parcel)
[edit] References
- Original documentation page for Android SDK build m5-rc15e - 14 apr 2008 17:27
