🌐
Java Tips
javatips.net › api › com.google.android.gms.location.locationrequest
Java Examples for com.google.android.gms.location.LocationRequest
@Override public void onConnected(Bundle bundle) { if (locationRequest == null) { locationRequest = LocationRequest.create(); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(DEFAULT_INTERVAL_MS); locationRequest.setFastestInterval(DEFAULT_FASTEST_INTERVAL_MS); } locationClient.requestLocationUpdates(locationRequest, this); }
🌐
Program Creek
programcreek.com › java-api-examples
com.google.android.gms.location.LocationRequest#setPriority
@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(1000); mLocationRequest.setFastestInterval(1000); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){ }else{ checkLocationPermission(); } } } Example 2 ·
🌐
Android Developers
developer.android.com › core areas › sensors and location › change location settings
Change location settings | Sensors and location | Android Developers
setPriority() - This method sets the priority of the request, which gives the Google Play services location services a strong hint about which location sources to use.
🌐
Airnativeextensions
docs.airnativeextensions.com › asdocs › location › com › distriqt › extension › location › LocationRequest.html
com.distriqt.extension.location.LocationRequest
public function setPersistInBackground(persistInBackground:Boolean = true, notificationText:String = null):LocationRequest · Sets the value of persistInBackground · Parameters · Returns · See also · persistInBackground · public function setPriority(priority:int):LocationRequest ·
🌐
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.
🌐
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 · 中文 – 简体
🌐
Stack Overflow
stackoverflow.com › questions › 28185208 › dynamically-change-setpriority-in-android-location-services
Dynamically Change setPriority in Android Location Services - Stack Overflow
January 6, 2017 - I have some code where a service starts the Google Play Services Location/Activity, when the Activity intent is called, I want to change the setPriority for the Location service. // Location mLocationRequest = LocationRequest.create(); if (mostProbActName.equals("still")) { mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); Log.i(TAG, "GOING TO BALANCED MODE!"); } else { mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); Log.i(TAG, "GOING TO HIGH MODE!"); }
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 381345 › locationrequest()-is-obsolete-and-deprecated
LocationRequest() is obsolete and deprecated - Microsoft Q&A
void CreateLocationRequest() { // mLocationRequest = new LocationRequest(); mLocationRequest = LocationRequest.Create(); mLocationRequest.SetInterval(UPDATE_INTERVAL); mLocationRequest.SetFastestInterval(FASTEST_INTERVAL); mLocationRequest.SetPriority(LocationRequest.PriorityHighAccuracy); mLocationRequest.SetSmallestDisplacement(DISPLACEMENT); locationClient = LocationServices.GetFusedLocationProviderClient(this); }
🌐
Codepath
guides.codepath.org › android › Retrieving-Location-with-LocationServices-API
Retrieving Location with LocationServices API | Android Development | CodePath Guides
private LocationRequest ... startLocationUpdates() { // Create the location request to start receiving updates. // The no-arg LocationRequest() constructor and setPriority/setInterval/ // setFastestInterval setters are deprecated as of play-services-location 21.x — // ...
🌐
Stack Overflow
stackoverflow.com › questions › 48883407 › mlocationrequest-setprioritylocationrequest-priority-balanced-power-accuracy
android studio - mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); - Stack Overflow
mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); and · LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this); I got cannot resolve symbol error. As i am new to android i am not able to get this.
🌐
GitHub
github.com › patloew › RxLocation
GitHub - patloew/RxLocation: 🗺 [DEPRECATED] Reactive Location APIs Library for Android and RxJava 2
// Create one instance and share it RxLocation rxLocation = new RxLocation(context); LocationRequest locationRequest = LocationRequest.create() .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) .setInterval(5000); rxLocation.location().updates(locationRequest) .flatMap(location -> rxLocation.geocoding().fromLocation(location).toObservable()) .subscribe(address -> { /* do something */ });
Starred by 486 users
Forked by 92 users
Languages   Java 100.0% | Java 100.0%
🌐
Stack Overflow
stackoverflow.com › questions › 45207326 › fusedlocationproviderapi-how-does-locationrequest-setpriority-work-with-locati
android - FusedLocationProviderApi: how does LocationRequest.setPriority work with "Location mode" device setting? - Stack Overflow
July 20, 2017 - If application calls LocationRequest.setPriority(PRIORITY_HIGH_ACCURACY) is called and device setting is set to "Battery saving", I assume the application won't be able to use GPS?
🌐
Radar
radar.com › blog › a-guide-to-android-location-services-for-ios-developers
An Android location services tutorial for iOS developers - Radar
September 5, 2025 - Like setting desiredAccuracy on iOS, you can call setPriority(int) on your LocationRequest instance to specify desired accuracy and hint which location sources to use. PRIORITY_HIGH_ACCURACY will request the highest accuracy available and is ...
🌐
Microsoft Learn
learn.microsoft.com › en-us › xamarin › android › platform › maps-and-location › location
Location services on Android - Xamarin | Microsoft Learn
August 6, 2022 - LocationRequest locationRequest = new LocationRequest() .SetPriority(LocationRequest.PriorityHighAccuracy) .SetInterval(60 * 1000 * 5) .SetFastestInterval(60 * 1000 * 2);