title: Android location only works on WiFi
body: <p>I'm having a problem trying to get locations in a Geocatching app on Android.</p>
  
  <p>For some devices my app caches all the locations and for others devices only get locations on WiFi network. Despite on this, I checked on <a href="https://maps.google.com/locationhistory" rel="nofollow noreferrer">https://maps.google.com/locationhistory</a> and Google got all locations.</p>
  
  <p>I want to get data from both, mobile and WiFi. Is there anything I'm doing wrong? How can I make it work in all devices?</p>
  
  <p>I'm using <code>ACCESS_FINE_LOCATION</code> and <code>ACCESS_COARSE_LOCATION</code> permissions btw.</p>
  
  <p>This is an example the device that works ok, it collects mobile data as it follows the correct path:
  <a href="https://i.stack.imgur.com/hamch.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hamch.png" alt="Good location"></a></p>
  
  <p>And this, an example of the device that only works on WiFi. It links three points where I had WiFi connection.
  <a href="https://i.stack.imgur.com/850BU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/850BU.png" alt="enter image description here"></a></p>
  
  <p>Thanks in advance for your time!</p>
  
  <p>EDIT: More info.</p>
  
  <p>I get correct behaviour with HTC One, Android 4.2.2 and Nexus 5, Android 6.0.</p>
  
  <p>With Sony Xperia Z3, Android 5.1.1 I only get locations when connected to WiFi.</p>