use of android.location.Criteria in project android_frameworks_base by ResurrectionRemix.
the class LocationManagerTest method testGetBestProviderPowerCriteria.
public void testGetBestProviderPowerCriteria() {
Criteria c = new Criteria();
c.setPowerRequirement(Criteria.POWER_HIGH);
String p = manager.getBestProvider(c, true);
assertNotNull(p);
c.setPowerRequirement(Criteria.POWER_MEDIUM);
p = manager.getBestProvider(c, true);
assertNotNull(p);
c.setPowerRequirement(Criteria.POWER_LOW);
p = manager.getBestProvider(c, true);
assertNotNull(p);
c.setPowerRequirement(Criteria.NO_REQUIREMENT);
p = manager.getBestProvider(c, true);
assertNotNull(p);
}
use of android.location.Criteria in project android_frameworks_base by ResurrectionRemix.
the class LocationManagerTest method testGetBestProviderEmptyCriteria.
public void testGetBestProviderEmptyCriteria() {
String p = manager.getBestProvider(new Criteria(), true);
assertNotNull(p);
}
use of android.location.Criteria in project Ushahidi_Android by ushahidi.
the class Util method createFineCriteria.
/** this criteria needs high accuracy, high power, and cost */
public static Criteria createFineCriteria() {
Criteria c = new Criteria();
c.setAccuracy(Criteria.ACCURACY_FINE);
c.setAltitudeRequired(false);
c.setBearingRequired(false);
c.setSpeedRequired(false);
c.setCostAllowed(true);
c.setPowerRequirement(Criteria.POWER_HIGH);
return c;
}
use of android.location.Criteria in project Ushahidi_Android by ushahidi.
the class Util method createCoarseCriteria.
/** this criteria will settle for less accuracy, high power, and cost */
public static Criteria createCoarseCriteria() {
Criteria c = new Criteria();
c.setAccuracy(Criteria.ACCURACY_COARSE);
c.setAltitudeRequired(false);
c.setBearingRequired(false);
c.setSpeedRequired(false);
c.setCostAllowed(true);
c.setPowerRequirement(Criteria.POWER_HIGH);
return c;
}
use of android.location.Criteria in project dagger-test-example by aschattney.
the class LocationProvider method getBestProvider.
private String getBestProvider() {
Criteria criteria = new Criteria();
criteria.setCostAllowed(false);
criteria.setAccuracy(Criteria.ACCURACY_LOW);
return locationManager.getBestProvider(criteria, false);
}
Aggregations