🌐
Google
developers.google.com › google play services › locationrequest
LocationRequest | Google Play services | Google for Developers
October 31, 2024 - This method is deprecated. Use LocationRequest.Builder.setPriority(int) instead.
🌐
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 ·
🌐
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); }
🌐
Android Developers
developer.android.com › core areas › sensors and location › change location settings
Change location settings | Sensors and location | Android Developers
July 7, 2023 - 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.
🌐
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.
🌐
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 ·
🌐
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 · 中文 – 简体
🌐
GitHub
github.com › lostzen › lost › blob › master › lost › src › main › java › com › mapzen › android › lost › api › LocationRequest.java
lost/lost/src/main/java/com/mapzen/android/lost/api/LocationRequest.java at master · lostzen/lost
April 23, 2023 - public LocationRequest setPriority(int priority) { if (priority != PRIORITY_HIGH_ACCURACY · && priority != PRIORITY_BALANCED_POWER_ACCURACY · && priority != PRIORITY_LOW_POWER · && priority != PRIORITY_NO_POWER) { throw new IllegalArgumentException("Invalid priority: " + priority); } ·
Author   lostzen
Find elsewhere
🌐
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!"); }
🌐
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 — // ...
🌐
Coding-blocks-ebooks
coding-blocks-ebooks.github.io › blocks-of-android › 15-location-and-sensors › 15-1-location.html
15.1 Location API · GitBook
Link: developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long) setPriority(int priority) - This method sets the priority of the request, which gives the Google Play services location services a strong hint about which location sources ...
🌐
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); }
🌐
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%
🌐
Tabnine
tabnine.com › home page › code › java › android.location.locationrequest
android.location.LocationRequest.setSmallestDisplacement java code examples | Tabnine
public LocationRequest buildLocationRequest() { LocationRequest locRequest = LocationRequest.create(); // Use high accuracy locRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); // how often do you need to check for the location // (this is an indication, it's not exact) locRequest.setInterval(REQUIRED_INTERVAL_SEC * 1000); // if others services requires the location more often // you can still receive those updates, if you do not want // too many consider setting this lower limit locRequest.setFastestInterval(FASTEST_INTERVAL_SEC * 1000); // do you care if the user moved 1 meter?