Slide 7
Slide 7 text
-PDBUJPO.BOBHFS
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setPowerRequirement(Criteria.POWER_HIGH);
criteria.setAltitudeRequired(false);
criteria.setSpeedRequired(true);
criteria.setCostAllowed(true);
criteria.setBearingRequired(false);
//API level 9 and up
criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
criteria.setVerticalAccuracy(Criteria.ACCURACY_HIGH);
Integer gpsFreqInMillis = 1000;
Integer gpsFreqInDistance = 5; // in meters
locationManager.addGpsStatusListener(this);
locationManager.requestLocationUpdates(gpsFreqInMillis,
gpsFreqInDistance,
criteria, this, null);
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setPowerRequirement(Criteria.POWER_HIGH);
criteria.setAltitudeRequired(false);
criteria.setSpeedRequired(true);
criteria.setCostAllowed(true);
criteria.setBearingRequired(false);
//API level 9 and up
criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
criteria.setVerticalAccuracy(Criteria.ACCURACY_HIGH);
Integer gpsFreqInMillis = 1000;
Integer gpsFreqInDistance = 5; // in meters
locationManager.addGpsStatusListener(this);
locationManager.requestLocationUpdates(gpsFreqInMillis,
gpsFreqInDistance,
criteria, this, null);
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setPowerRequirement(Criteria.POWER_HIGH);
criteria.setAltitudeRequired(false);
criteria.setSpeedRequired(true);
criteria.setCostAllowed(true);
criteria.setBearingRequired(false);
//API level 9 and up
criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
criteria.setVerticalAccuracy(Criteria.ACCURACY_HIGH);
Integer gpsFreqInMillis = 1000;
Integer gpsFreqInDistance = 5; // in meters
locationManager.addGpsStatusListener(this);
locationManager.requestLocationUpdates(gpsFreqInMillis,
gpsFreqInDistance,
criteria, this, null);
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setPowerRequirement(Criteria.POWER_HIGH);
criteria.setAltitudeRequired(false);
criteria.setSpeedRequired(true);
criteria.setCostAllowed(true);
criteria.setBearingRequired(false);
//API level 9 and up
criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
criteria.setVerticalAccuracy(Criteria.ACCURACY_HIGH);
Integer gpsFreqInMillis = 1000;
Integer gpsFreqInDistance = 5; // in meters
locationManager.addGpsStatusListener(this);
locationManager.requestLocationUpdates(gpsFreqInMillis,
gpsFreqInDistance,
criteria, this, null);