title: Location tracking while device is moving
body: <p></p>
  
  <p>
  I am developing an application that tracks the device's location specially when it is moving. I am getting different response in Samsung and HTC device with different OS version for same API call. </p>
  
  <p>Here is my code.</p>
  
  <p><code>private static final long HUNDERE_METERS = 100; // in Meters</code><br>
  <code>private static final long TWO_MIN = 60000*2; // in Milliseconds</code>    </p>
  
  <pre><code>Criteria criteria = new Criteria();
  criteria.setAccuracy(Criteria.ACCURACY_FINE);
  criteria.setBearingRequired(true);
  criteria.setBearingAccuracy(Criteria.ACCURACY_HIGH);
  criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
  String provider = mlocManager.getBestProvider(criteria, false);
  mlocManager.requestLocationUpdates(provider, TWO_MIN, HUNDERE_METERS, mlocListener);
  </code></pre>
  
  <p>'Samsung Galaxy Nexus-4.1.1' gives the location updates on every distance moved by HUNDRED_METERS (100 meters) which is fine. But in 'HTC EVO 3D PG86100-4.0.3' GPS become unavailable for 2 minutes and then become available which is causing location updates after every 2 minutes.</p>
  
  <p>I modified the code as below</p>
  
  <pre><code>mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, TWO_MIN, HUNDERE_METERS, mlocListener);
  </code></pre>
  
  <p>Now HTC start working fine and giving locations for every distance moved by 100 meters but in Samsung GPS become unavailable for every 2 minutes.</p>
  
  <p>Please suggest with what argument should I call requestLocationUpdates to get location updates for distance moved by desired distance which should we work for all Android devices and OS.</p>