Methods Summary |
---|
public abstract int | getAccuracy()Returns a constant describing horizontal accuracy of this provider.
If the provider returns finer grain or exact location,
{@link Criteria#ACCURACY_FINE} is returned, otherwise if the
location is only approximate then {@link Criteria#ACCURACY_COARSE}
is returned.
|
public java.lang.String | getName()Returns the name of this provider.
return mName;
|
public abstract int | getPowerRequirement()Returns the power requirement for this provider.
|
public abstract boolean | hasMonetaryCost()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.
|
public boolean | meetsCriteria(Criteria criteria)Returns true if this provider meets the given criteria,
false otherwise.
if ((criteria.getAccuracy() != Criteria.NO_REQUIREMENT) &&
(criteria.getAccuracy() < getAccuracy())) {
return false;
}
int criteriaPower = criteria.getPowerRequirement();
if ((criteriaPower != Criteria.NO_REQUIREMENT) &&
(criteriaPower < getPowerRequirement())) {
return false;
}
if (criteria.isAltitudeRequired() && !supportsAltitude()) {
return false;
}
if (criteria.isSpeedRequired() && !supportsSpeed()) {
return false;
}
if (criteria.isBearingRequired() && !supportsBearing()) {
return false;
}
return true;
|
public abstract boolean | requiresCell()Returns true if the provider requires access to an appropriate
cellular network (e.g., to make use of cell tower IDs), false
otherwise.
|
public abstract boolean | requiresNetwork()Returns true if the provider requires access to a
data network (e.g., the Internet), false otherwise.
|
public abstract boolean | requiresSatellite()Returns true if the provider requires access to a
satellite-based positioning system (e.g., GPS), false
otherwise.
|
public abstract boolean | supportsAltitude()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.
|
public abstract boolean | supportsBearing()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.
|
public abstract boolean | supportsSpeed()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.
|