title: Battery drain issue with background location service
body: <p>My app is used, amongst other features, for tracking drivers doing delivery work, so we need to track the driver's location constantly. For that, we use a Service that runs in the background and saves the coordinates internally before we send them to a server.</p>
  
  <p>The problem is, as is expected, the more precise we need to get, the more the battery drain increases. To the point where Google Play Console Vitals is showing a way above the average number for wake ups like this:
  <em>walarm</em>:com.google.android.location.ALARM_WAKEUP_LOCATOR*</p>
  
  <p>I want to know if I'm doing something wrong or if the only way I can improve the code is by doing minor tweaks.</p>
  
  <pre><code>public class LocationService extends Service implements LocationListener {
  
      private Integer gpsFreqInMillis = 1000 * 10; //10 seconds
      private Integer gpsFreqInDistance = 10; //10 meters
      ...
  
      public void startUpdatingLocation() {
  
          ...
  
  
          final LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
  
          try {
              locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, gpsFreqInMillis, gpsFreqInDistance, this);
          } catch (java.lang.SecurityException ex) {
              Log.i(TAG, "fail to request location update, ignore", ex);
          } catch (IllegalArgumentException ex) {
              Log.d(TAG, "gps provider does not exist " + ex.getMessage());
          }
  
          try {
              locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, gpsFreqInMillis, gpsFreqInDistance, this);
          } catch (java.lang.SecurityException ex) {
              Log.i(TAG, "fail to request location update, ignore", ex);
          } catch (IllegalArgumentException ex) {
              Log.d(TAG, "gps provider does not exist " + ex.getMessage());
          }
  
      }
  
      ...
  
      @Override
      public void onLocationChanged(final Location newLocation) {
          //saves location in internal database
      }
  
  }
  </code></pre>
  
  <p>Is there a way I can track a precise location without killing my user's battery? I know I can change the min distance and min time values, but 10m/10s is the most precise option we offer.</p>