2

TL;DR :

Android requestLocationUpdates() has locationRequest.interval = 10000 which does not happen, is something wrong?

In Details: Successfully implemented Android period location and it works fine, using this reference https://developer.android.com/training/location/receive-location-updates

Working Code piece:

val fusedLocationClient: FusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(
            someActivity
        )

        val locationRequest = LocationRequest.create()
        locationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY
        locationRequest.interval = 10000 //This interval does not work

        fusedLocationClient.requestLocationUpdates(locationRequest,
            somelocationCallback,
            Looper.getMainLooper())

After running the code the period updates are coming in random intervals and does not follow any pattern even though locationRequest.interval = 10000. Is something is wrong?

Saswata
  • 1,290
  • 2
  • 14
  • 28

1 Answers1

0

Solution

The solution is provided here:

https://stackoverflow.com/a/40051181/10941112

Reason of the Q&A: It took quit long find out the solution with this question, so to provide better searchability the question is raised

Saswata
  • 1,290
  • 2
  • 14
  • 28