as Gabe Sechan suggested you have to call for new location if you don't want your location to be null or require a fresh location everytime.

you can do it using getCurrentLocation() method which takes priority and a cancellation token.

val priority = LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY
val cancellationTokenSource = CancellationTokenSource()

fusedLocationClient.getCurrentLocation(priority, cancellationTokenSource.token)
            .addOnSuccessListener { location ->
                Log.d("Location", "location is found: $location")
            }
            .addOnFailureListener { exception ->
                Log.d("Location", "Oops location failed with exception: $exception")
            }

you can change the priority based on your requirement as of now i have used PRIORITY_BALANCED_POWER_ACCURACY as it will search location using wifi and GPS to find location if you required with higher accuracy you can use PRIORITY_HIGH_ACCURACY

and we provide cancellation token as if in future we're not required location for e.g. Activity has been closed by user so we will cancel request using cancellationTokenSoure.cancel()

Answer from Bhavin on Stack Overflow
🌐
Google
developers.google.com › google play services › fusedlocationproviderclient
FusedLocationProviderClient | Google Play services | Google for Developers
October 31, 2024 - FusedLocationProviderClient is the main entry point for interacting with the Fused Location Provider (FLP) and requires either ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission.
🌐
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 requestCurrentLocation() { val currentTask: Task<Location> = fusedLocationProviderClient.getCurrentLocation( PRIORITY_HIGH_ACCURACY, cancellationTokenSource.token ) currentTask.addOnCompleteListener { task: Task<Location> -> if (task.isSuccessful && task.result != null) { val result: Location = task.result binding.locationUpdate.text = "Location is ${result.latitude} and ${result.longitude}" // Navigate to map activity to display location val intent = Intent(this, MapActivity::class.java) intent.putExtra("lat", result.latitude) intent.putExtra("long", result.longitude) startActivity(intent) } else { binding.locationUpdate.text = task.exception.toString() } } }
🌐
Reddit
reddit.com › r/androiddev › how does the gms fusedlocationproviderclient work ?
r/androiddev on Reddit: How does the GMS FusedLocationProviderClient work ?
February 4, 2026 -

How does the fusedLocationProviderClient work in fine/coarse permission modes ?

  • What is the minimum least required network to fetch coarse data ?

  • Is it possible with only Wifi ? (For a device with No SIM cards/eSiM)

  • Or a SIM card is a must to get the coarse mode to fetch approx. location ?

In all of the above cases, the location is turned on, I think its the permission that determines whether to use the GPS or not. So with only coarse persimmon given, what are the min requirements ?

Edit 1: I have tried with WiFi On/Off, location accuracy on/off, wifi scanning on/off, bluetooth scanning on/off, with/without connected to wifi. None of these are able to give me an approximate/Coarse location (returns null).

Edit 2: I don't want to get the FINE/Precise location. And yes, this mode works.

🌐
GitHub
github.com › raviyadav5951 › FusedLocationProviderClient
GitHub - raviyadav5951/FusedLocationProviderClient: FusedLocationProviderClient is new way to fetch the user current location in terms of latitude and longitude. · GitHub
FusedLocationProviderClient is new way to fetch the user current location in terms of latitude and longitude. - raviyadav5951/FusedLocationProviderClient
Starred by 10 users
Forked by 4 users
Languages   Java
🌐
Reddit
reddit.com › r/androiddev › fusedlocationproviderclient vs locationmanager - what to use? possible deprecation?
r/androiddev on Reddit: FusedLocationProviderClient vs LocationManager - What to use? Possible deprecation?
May 2, 2023 -

We are currently working on an App that does a lot with users' locations. Therefore we are evaluating FusedLocationProviderClient and the "old" LocationManager to access the user's location over a long period of time.

The accuracy of the location is extremely important and we want to get the maximum out of the device. Initial testing showed great results with the "new" fused location provider. However, on some devices, this client is not available and in very rare cases the locations get really inaccurate after some time (<10min).

For some devices/cases we are thinking of using the "old" LocationManager, but my question is if this LocationManager will stick around in the future. I did some research but I wasn't able to find a lot of details. Google just "highly recommends switching to FusedLocationProviderClient", but it's missing some features of the LocationManager such as providing GNSS information.

Is it a good idea to use LocationManager and all the information that it provides such as GNSS Info?

Maybe some of you also did some research on this topic and can share the results.

Find elsewhere
🌐
Fritz ai
fritz.ai › home › blog › handling location data in android
Handling Location Data in Android - Fritz ai
September 21, 2023 - // FusedLocationProviderClient - MainActivity class for receiving location updates.
🌐
MoldStud
moldstud.com › articles › it practices › android app development for e-commerce › leveraging geo-location services in android app development - a comprehensive guide
Leveraging Geo-Location Services in Android App Development - A Comprehensive Guide
December 9, 2024 - FusedLocationProviderClient fusedLocationClient = LocationServices.getFusedLocationProviderClient(this); fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
🌐
Mindorks
blog.mindorks.com › using-gps-location-manager-in-android-android-tutorial
Using Fused Location API To Fetch Current Location
June 7, 2019 - private fun setUpLocationListener() { val fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this) // for getting the current location update after every 2 seconds with high accuracy val locationRequest = LocationRequest().setInterval(2000).setFastestInterval(2000) .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) fusedLocationProviderClient.requestLocationUpdates( locationRequest, object : LocationCallback() { override fun onLocationResult(locationResult: LocationResult) { super.onLocationResult(locationResult) for (location in locationResult.locations) { latTextView.text = location.latitude.toString() lngTextView.text = location.longitude.toString() } // Few more things we can do here: // For example: Update the location of user on server } }, Looper.myLooper() ) }
🌐
CommonsWare
commonsware.com › community › t › get-current-location › 579
Get current location
April 28, 2021 - @SuppressLint("MissingPermission") private suspend fun getCurrentLocation(cancellationToken: CancellationToken): Location? { return fusedLocationProviderClient.getCurrentLocation( LocationRequest.PRIORITY_HIGH_ACCURACY, cancellationToken ).await() }
🌐
Zenn
zenn.dev › log_suzaki › articles › e63c1446c61464
FusedLocationで位置情報を継続的に取得する![ver21.0.1]
import android.Manifest import android.annotation.SuppressLint import android.app.Activity import android.content.pm.PackageManager import android.location.Location import android.os.Looper import androidx.core.app.ActivityCompat import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import com.google.android.gms.location.* class LocationSensor(private val activity: Activity) { private val fusedLocationClient: FusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(activity) private var locationCallback: LocationCallback?
🌐
Google
developers.google.com › location-context › fused-location-provider
Fused Location Provider API | Google for Developers
Get an overview of this battery-efficient location API and links to guides about how to use it.
🌐
Creativesparksolutions
creativesparksolutions.com › blog › how-to-handle-location-when-developing-an-android-app-fused-location-updated-2017
How to handle location updates using Fused Location in Android [ Updated Nougat, 2017]
March 12, 2018 - Fused location provider API (now ... these situations and removes the guesswork by automatically changing the appropriate system settings based on desired accuracy and available options /permissions....
🌐
Google
android.googlesource.com › platform › frameworks › base › + › master › packages › FusedLocation › src › com › android › location › fused › FusedLocationProvider.java
packages/FusedLocation/src/com/android/location/fused/FusedLocationProvider.java - platform/frameworks/base - Git at Google
Sign in · android/platform/frameworks/base/refs/heads/main/./packages/FusedLocation/src/com/android/location/fused/FusedLocationProvider.java · blob: 068074ae1b897f1978c779bf850150e55b2e98d9 [file] [edit] · Powered by Gitiles| Privacy| Termstxt json