If you are worried about the battery and not so strict for a 10-minute interval, you can try using PassiveProvider instead of GPS / Coarse.
Other applications typically request locations often, so you donβt have to worry about that. If you are strict, you can try asking about the location yourself if you havenβt received for the last interval.
Here is an example of using a Passive provider.
LocationManager locationManager = (LocationManager) this .getSystemService(Context.LOCATION_SERVICE); LocationListener locationListener = new LocationListener() { @Override public void onStatusChanged(String provider, int status, Bundle extras) {} @Override public void onProviderEnabled(String provider) {} @Override public void onProviderDisabled(String provider) {} @Override public void onLocationChanged(Location location) {
source share