0

I am developing a location based application in which i want to get location after movement of meter from previous position. I don't want to give minimum time in

void requestLocationUpdates (String provider, 
            long minTime, 
            float minDistance, 
            LocationListener listener)

Is there any way to request location updates based only upon minimum distance?

Abdul Wahab
  • 137
  • 2
  • 11
  • Is there any way to check whether phone's location is on or off? – Abdul Wahab Oct 25 '16 at 15:47
  • Read [documentation](https://developer.android.com/reference/android/location/LocationManager.html), if you pass minTime 0, then it considers only minDistance parameter. – blackkara Oct 25 '16 at 15:48
  • Here is the answer for your question - https://stackoverflow.com/questions/44882705/getting-location-updates-based-on-time-interval-or-displacement answered by @blackkara – Joshua Feb 16 '19 at 06:10

1 Answers1

1

Here is all the information I could find (requestLocationUpdates) :

The minDistance parameter can also be used to control the frequency of location updates. If it is greater than 0 then the location provider will only send your application an update when the location has changed by at least minDistance meters, AND at least minTime milliseconds have passed. However it is more difficult for location providers to save power using the minDistance parameter, so minTime should be the primary tool to conserving battery life.

tim4dev
  • 2,846
  • 2
  • 24
  • 30