java.lang.Object | |
↳ | com.neomades.location.Criteria |
The Criteria class lets user choose some criterias, that will be used by the platform when acquiring the location of the device.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ACCURACY_DEFAULT | A constant indicating an approximate accuracy requirement | |||||||||
int | ACCURACY_FINE | A constant indicating a finer location accuracy requirement | |||||||||
int | NO_REQUIREMENT | A constant indicating that the application does not choose to place requirement on a particular feature. | |||||||||
int | POWER_HIGH | A constant indicating a high power requirement. | |||||||||
int | POWER_LOW | A constant indicating a low power requirement. | |||||||||
int | POWER_MEDIUM | A constant indicating a medium power requirement. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Criteria()
Constructs a new Criteria object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
getAccuracy()
Returns the accuracy value set in this Criteria.
| ||||||||||
int |
getMinDistance()
Returns the minimum distance between two location updates in meters.
| ||||||||||
int |
getMinTime()
Returns the minimum time interval between two location updates in
milliseconds.
| ||||||||||
int |
getPowerRequirement()
Returns the preferred power consumption.
| ||||||||||
boolean |
isAltitudeRequired()
Returns whether the location provider should be able to determine altitude.
| ||||||||||
boolean |
isCostAllowed()
Returns the preferred cost setting.
| ||||||||||
Criteria |
setAccuracy(int accuracy)
Sets the desired accuracy preference.
| ||||||||||
Criteria |
setAltitudeRequired(boolean altitudeRequired)
Sets whether the location provider should be able to determine altitude.
| ||||||||||
Criteria |
setCostAllowed(boolean costAllowed)
Indicates whether the provider is allowed to incur monetary cost.
| ||||||||||
Criteria |
setMinDistance(int minDistance)
Sets minimum distance between location updates, in meters
| ||||||||||
Criteria |
setMinTime(int minTime)
Sets the minimum time interval between location updates, in milliseconds.
| ||||||||||
Criteria |
setPowerRequirement(int level)
Sets the preferred maximum level of power consumption.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
A constant indicating an approximate accuracy requirement
A constant indicating a finer location accuracy requirement
A constant indicating that the application does not choose to place requirement on a particular feature.
A constant indicating a high power requirement.
A constant indicating a low power requirement.
A constant indicating a medium power requirement.
Constructs a new Criteria object.
The new object will have no requirements on accuracy, or power; will not require altitude, speed, or bearing; and will not allow monetary cost.
The default minimum time and minimum distance for updates value is 0.
Returns the accuracy value set in this Criteria.
ACCURACY_DEFAULT
or
ACCURACY_FINE
Returns the minimum distance between two location updates in meters.
By default, the minimum distance is set to 0.
Returns the minimum time interval between two location updates in milliseconds.
By default, the minimum time is set to 0.
Not taken into account on iOS platform.
Returns the preferred power consumption.
Not taken into account on iOS platform.
NO_REQUIREMENT
,
POWER_LOW
, POWER_MEDIUM
, or
POWER_HIGH
.
Returns whether the location provider should be able to determine altitude.
Not taken into account on iOS platform.
Returns the preferred cost setting.
Not taken into account on iOS platform.
Sets the desired accuracy preference.
More accurate location may consume more power and may take longer.
accuracy | must be one of ACCURACY_FINE ,
ACCURACY_DEFAULT , or
NO_REQUIREMENT . |
---|
IllegalArgumentException | if the accuracy parameter is not one of the accuracy constants |
---|
Sets whether the location provider should be able to determine altitude.
Not taken into account on iOS platform.
altitudeRequired | if set to true, the LocationProvider is required to be able to normally determine the altitude. if set the false, the course is not required. Not all fixes are guaranteed to contain such information. |
---|
Indicates whether the provider is allowed to incur monetary cost.
Not taken into account on iOS platform.
Note that the platform implementation may not always be able to know if a location method implies cost to the end user or not. If the implementation doesn't know, it assumes that it may cost.
costAllowed | - false if location determination is not allowed to cost, true if it is allowed to cost. When this criteria is set to false, the implementation may only return a LocationProvider of which it is certain that it does not cause a per usage cost to the end user. |
---|
Sets minimum distance between location updates, in meters
minDistance | - the minimum distance between location updates, in meters |
---|
IllegalArgumentException | if min distance is negative |
---|
Sets the minimum time interval between location updates, in milliseconds.
minTime | - the minimum time interval between location updates, in milliseconds |
---|
IllegalArgumentException | if the min time is negative |
---|
Sets the preferred maximum level of power consumption.
level | - the preferred maximum level of power consumption; must be one of
NO_REQUIREMENT , POWER_LOW ,
POWER_MEDIUM , or POWER_HIGH . |
---|
IllegalArgumentException | if the level parameter is not one of the power constants |
---|