Google
developers.google.com › google play services › locationrequest
LocationRequest | Google Play services | Google for Developers
October 31, 2024 - public final class LocationRequest extends Object implements Parcelable · An encapsulation of various parameters for requesting location through FusedLocationProviderClient. There are a variety of different situations where various types of applications may want to use different request parameters. For example, clients that are showing the user's location in realtime may consider a Priority.PRIORITY_HIGH_ACCURACY request with a short interval.
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 · 中文 – 简体
Videos
Java Tips
javatips.net › api › com.google.android.gms.location.locationrequest
Java Examples for com.google.android.gms.location.LocationRequest
Example 2 · @Override public void onConnected(@Nullable Bundle bundle) { mLocationRequest = LocationRequest.create(); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequest.setInterval(100000); if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // for ActivityCompat#requestPermissions for more details.
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(); } // Trigger new location updates at interval protected void startLocationUpdates() { // Create the location request to start receiving updates.
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.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 · 中文 – 简体
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. For example, if your application wants high accuracy location it should create a location request with setPriority(int) set to PRIORITY_HIGH_ACCURACY and setInterval(long) to 5 seconds.
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. For example, if your application wants high accuracy location it should create a location request with setPriority(int) set to PRIORITY_HIGH_ACCURACY and setInterval(long) ...
Program Creek
programcreek.com › java-api-examples
com.google.android.gms.location.LocationRequest Java Exaples
Example #4 · @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; MapUtil.changeMapStyle(TAG, mMap, this); mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(UPDATE_TIME); mLocationRequest.setFastestInterval(UPDATE_TIME); 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) { //Location Permission already granted mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper()); mMap.setMyLocationEnabled(true); } } else { mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper()); mMap.setMyLocationEnabled(true); } } Example #5 ·
Google
android.googlesource.com › platform › frameworks › base › + › refs › heads › 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
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();
GitHub
github.com › codepath › android_guides › wiki › Retrieving-Location-with-LocationServices-API
Retrieving Location with LocationServices API · codepath/android_guides Wiki · GitHub
April 4, 2020 - private LocationRequest ... startLocationUpdates() { // Create the location request to start receiving updates mLocationRequest = new LocationRequest(); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); ...
Author codepath
Google
codelabs.developers.google.com › codelabs › while-in-use-location
Receive location updates in Android with Kotlin | Google Codelabs
March 27, 2026 - In the base module, search for TODO: Step 1.3, Create a LocationRequest in the ForegroundOnlyLocationService.kt file.
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.
Medium
medium.com › @myofficework000 › real-time-location-tracking-made-easy-with-fused-location-provider-43de6437fbd3
Real-Time Location Tracking Made Easy with Fused Location Provider | by Abhishek Pathak | Medium
October 15, 2024 - @SuppressLint("MissingPermission") private fun startLocationUpdates() { val locationRequest = LocationRequest.create().apply { interval = 10000 // 10 seconds fastestInterval = 5000 priority = LocationRequest.PRIORITY_HIGH_ACCURACY } fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper()) } private val locationCallback = object : LocationCallback() { override fun onLocationResult(locationResult: LocationResult) { locationResult.lastLocation?.let { location -> // Update UI with the new location binding.locationUpdate.text = "Updated Location: ${location.latitude}, ${location.longitude}" } } }
Coderwall
coderwall.com › p › yzruog › simple-location-service-for-android
Simple location service for Android (Example)
February 25, 2016 - onConnected"); Location currentLocation = locationClient.getLastLocation(); // Create the LocationRequest object LocationRequest locationRequest = LocationRequest.create(); // Use high accuracy locationRequest.setPriority(LocationRequest.PR...