Created
April 26, 2020 12:24
-
-
Save Lavanyagaur22/b91982554400526febc95b9388445149 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sets the desired interval for active location updates. This interval is inexact. You | |
// may not receive updates at all if no location sources are available, or you may | |
// receive them less frequently than requested. You may also receive updates more | |
// frequently than requested if other applications are requesting location at a more | |
// frequent interval. | |
locationRequest = LocationRequest().apply { | |
// Sets the desired interval for active location updates. | |
interval = TimeUnit.SECONDS.toMillis(60) | |
// Sets the fastest rate for active location updates. | |
fastestInterval = TimeUnit.SECONDS.toMillis(30) | |
// Sets the maximum time when batched location updates are delivered. Updates may be | |
// delivered sooner than this interval. | |
maxWaitTime = TimeUnit.MINUTES.toMillis(2) | |
priority = LocationRequest.PRIORITY_HIGH_ACCURACY | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment