LocationRequest locationRequest =
new LocationRequest.Builder(
LocationRequest.PRIORITY_HIGH_ACCURACY,
10000
).build();
locationRequest.setFastestInterval(5000);
Answer from Christoph Dahlen on Stack OverflowGoogle
developers.google.com › google play services › locationrequest
LocationRequest | Google Play services | Google for Developers
October 31, 2024 - LocationRequest is used to define parameters for requesting location updates via FusedLocationProviderClient.
Android Developers
developer.android.com › api reference › locationrequest
LocationRequest | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体
Top answer 1 of 2
3
LocationRequest locationRequest =
new LocationRequest.Builder(
LocationRequest.PRIORITY_HIGH_ACCURACY,
10000
).build();
locationRequest.setFastestInterval(5000);
2 of 2
1
locationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100)
.setIntervalMillis(INTERVAL_MILLIS) // Sets the interval for location updates
.setMinUpdateIntervalMillis(INTERVAL_MILLIS/2) // Sets the fastest allowed interval of location updates.
.setWaitForAccurateLocation(false) // Want Accurate location updates make it true or you get approximate updates
.setMaxUpdateDelayMillis(100) // Sets the longest a location update may be delayed.
.build();
Codepath
guides.codepath.org › android › Retrieving-Location-with-LocationServices-API
Retrieving Location with LocationServices API | Android Development | CodePath Guides
private LocationRequest mLocationRequest; private long UPDATE_INTERVAL = 10 * 1000; /* 10 secs */ private long FASTEST_INTERVAL = 2000; /* 2 sec */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); startLocationUpdates(); ...
Android Developers
developer.android.com › api reference › locationrequest.builder
LocationRequest.Builder | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体
Google
codelabs.developers.google.com › codelabs › while-in-use-location
Receive location updates in Android with Kotlin | Google Codelabs
March 27, 2026 - // TODO: Step 1.3, Create a LocationRequest. locationRequest = LocationRequest.create().apply { // 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. // // IMPORTANT NOTE: Apps running on Android 8.0 and higher devices (regardless of // targetSdkVersion) may receive updates less frequently than this interval when the app // is no longer in the foreground.
Google
android.googlesource.com › platform › frameworks › base › + › master › location › java › android › location › LocationRequest.java
location/java/android/location/LocationRequest.java - platform/frameworks/base - Git at Google
android / platform / frameworks / base / refs/heads/main / . / location / java / android / location / LocationRequest.java
52im
docs.52im.net › extend › docs › api › android-50 › reference › com › google › android › gms › location › LocationRequest.html
LocationRequest | Android Developers
LocationRequest objects are used to request a quality of service for location updates from the FusedLocationProviderApi.
Android Developers
developer.android.com › core areas › sensors and location › request location permissions
Request location permissions | Sensors and location | Android Developers
This document describes the different types of location requirements for Android apps, including foreground and background access, and varying accuracy levels, explaining how to request the appropriate location permissions for each use case.
Android-doc
android-doc.com › reference › com › google › android › gms › location › LocationRequest.html
LocationRequest | Android Developers
LocationRequest objects are used to request a quality of service for location updates from the LocationClient.
Tabnine
tabnine.com › home › code library
Code Library - Tabnine
July 25, 2024 - Get the answers and suggestions you need from our AI code assistant. Get started in minutes with a free 90 day trial of Tabnine Pro.
Google
developers.google.com › google play services › fusedlocationproviderclient
FusedLocationProviderClient | Google Play services | Google for Developers
October 31, 2024 - On the other hand, if repeated location updates are required, such as when tracking the user's location over time, requestLocationUpdates(LocationRequest, Executor, LocationListener) or one of its variants is better suited. Clients are encourage to familiarize themselves with the full range of APIs available in this class to understand which is best suited for their needs. This constant is deprecated. Use Location.isMock() on Android S and above, otherwise use LocationCompat.isMock() from the compat libraries instead.
GitHub
google-developer-training.github.io › android-developer-advanced-course-practicals › unit-4-add-geo-features-to-your-apps › lesson-7-location › 7-1-p-use-the-device-location › 7-1-p-use-the-device-location.html
7.1: Using the device location · GitBook
Create a method called getLocationRequest() that takes no arguments and returns a LocationRequest.
Meridianapps
files.meridianapps.com › meridian-android-sdk › docs-5.0.0 › com › arubanetworks › meridian › location › LocationRequest.html
LocationRequest (Meridian API)
public static LocationRequest requestCurrentLocation(android.content.Context context, EditorKey appKey, LocationRequest.LocationRequestListener responseListener) Builds and starts a LocationRequest with the given parameters.
DEV Community
dev.to › olubunmialegbeleye › location-services-the-android-14-maybe-15-too-way-4171
Location Services- the Android 14 (maybe 15 too) way - DEV Community
July 16, 2024 - private fun checkPhoneLocationSettings( activity: Activity, locationSettingsResult: ActivityResultLauncher<IntentSenderRequest>, callback: (Boolean) -> Unit ) { val builder = LocationSettingsRequest.Builder().addLocationRequest(locationRequest) val client = LocationServices.getSettingsClient(activity) val task = client.checkLocationSettings(builder.build()) task.addOnSuccessListener { callback(true) } task.addOnFailureListener { exception -> if (exception is ResolvableApiException) { try { locationSettingsResult.launch( IntentSenderRequest.Builder(exception.resolution).build() ) } catch (sendEx: IntentSender.SendIntentException) { // Ignore the error.