You just need to include this in your build.gradle file:

implementation "com.google.android.gms:play-services-location:15.0.1"

or if you're not using latest gradle version:

compile "com.google.android.gms:play-services-location:15.0.1"

Note: It's recommended to use Google Play services version 15.0.1 or higher, which includes bug fixes for this class. More details here.

https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderClient

Answer from Reza 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.
🌐
Akaver
courses.taltech.akaver.com › 13 - fused location
13 - Fused location | Native Mobile Applications - Courses
March 29, 2026 - package ee.taltech.permissionsdemo ... androidx.core.app.NotificationManagerCompat import androidx.core.app.ServiceCompat import com.google.android.gms.location.FusedLocationProviderClient import com.google.android.gms.location.LocationCallback ...
Discussions

android - Cannot Resolve Symbol: FusedLocationProviderClient. Google play services version used 11.0.1 - Stack Overflow
The class FusedLocationProviderClient is included in this package. ... It's not working for me. What all other features be there to resolve this? 2017-08-31T09:16:27.17Z+00:00 ... Look answer below and read the docs, use specific library you need so you don't bloat your app with stuff you don't use. 2018-07-25T19:24:08.213Z+00:00 ... Import ... More on stackoverflow.com
🌐 stackoverflow.com
android - FusedLocationProviderClient when and how to stop Looper? - Stack Overflow
I used to use FusedLocationApi until I learned that it is deprecated (see references below). It was simple to implement. As the documentation says you need to use it in conjunction with GoogleApiCl... More on stackoverflow.com
🌐 stackoverflow.com
java - How to use getCurrentLocation of fused location provider client? - Stack Overflow
I am new for Android coding, and have writen a code to get location of Android Device but failed. Nothing changed (e.g. mLastKnownLocation or cityName) after runing, and no expception. I have already More on stackoverflow.com
🌐 stackoverflow.com
Newest 'fusedlocationproviderclient' Questions - Stack Overflow
Stack Overflow | The World’s Largest Online Community for Developers More on stackoverflow.com
🌐 stackoverflow.com
🌐
Android Developers
developer.android.com › core areas › sensors and location › get the last known location
Get the last known location | Sensors and location | Android Developers
private lateinit var fusedLocationClient: FusedLocationProviderClient override fun onCreate(savedInstanceState: Bundle?) { // ...
🌐
Medium
droidbyme.medium.com › get-current-location-using-fusedlocationproviderclient-in-android-cb7ebf5ab88e
Get Current location using FusedLocationProviderClient in Android | by Droid By Me | Medium
January 2, 2019 - private FusedLocationProviderClient mFusedLocationClient;private TextView txtLocation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); this.txtLocation = (TextView) findViewById(R.id.txtLocation); mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this); }; }
🌐
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() } } }
🌐
GeeksforGeeks
geeksforgeeks.org › kotlin › using-fused-location-api-to-fetch-current-location-in-android
Using Fused Location API to Fetch Current Location in Android - GeeksforGeeks
July 23, 2025 - private fun setLocationListner() { 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) { longPlaceholder.text = location.latitude.toString() latPlaceholder.text = location.longitude.toString() } // Things don't end here // You may also update the location on your web app } }, Looper.gfgLooper() ) }
Find elsewhere
🌐
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.
🌐
Mapsindoors
docs.mapsindoors.com › sdks-and-frameworks › android › user-positioning › using-google-fused-location-provider
Using Google Fused Location Provider | MapsIndoors® Documentation
April 28, 2026 - class GPSPositionProvider(context: Context): MPPositionProvider { private var fusedLocationClient: FusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context) private var mLatestPosition: MPPositionResultInterface?
Top answer
1 of 2
36

You just need to call mFusedLocationClient.removeLocationUpdates(mLocationCallback) in onPause() of your Activity. However, there is a bit more to it than just that.

Use member variables for the FusedLocationProviderClient and LocationRequest in your main activity:

import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationCallback;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationResult;

public class MainActivity extends AppCompatActivity
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener {

    FusedLocationProviderClient mFusedLocationClient;
    LocationRequest mLocationRequest;

    //..........

Use a member variable for the LocationCallback as well:

LocationCallback mLocationCallback = new LocationCallback(){
    @Override
    public void onLocationResult(LocationResult locationResult) {
        for (Location location : locationResult.getLocations()) {
            Log.i("MainActivity", "Location: " + location.getLatitude() + " " + location.getLongitude());

        }
    };

};

Then, assign mFusedLocationClient in onCreate() :

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
    requestLocationUpdates();

    //...............
}

Then in onResume(), if theFusedLocationProviderClient is set up, then use it.

@Override
public void onResume() {
    if (mFusedLocationClient != null) {
        requestLocationUpdates();
    }
}

public void requestLocationUpdates() {
    mLocationRequest = new LocationRequest();
    mLocationRequest.setInterval(120000); // two minute interval
    mLocationRequest.setFastestInterval(120000);
    mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
    if (ContextCompat.checkSelfPermission(this,
            Manifest.permission.ACCESS_FINE_LOCATION)
            == PackageManager.PERMISSION_GRANTED) {
        mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());
    }
}

And finally, in onPause(), call removeLocationUpdates():

@Override
public void onPause() {
    super.onPause();
    if (mFusedLocationClient != null) {
        mFusedLocationClient.removeLocationUpdates(mLocationCallback);
    }
}
2 of 2
1

After getting location just remove mFusedLocationClient.removeLocationUpdates as he mentioned in above answers.

if (mFusedLocationClient != null) 
        mFusedLocationClient.removeLocationUpdates(mLocationCallback);

Looper will be called requestLocationUpdates until you remove it.

In my problem, I did as I mention above. Below is my code.

  mFusedLocationClient.getLastLocation()
                    .addOnSuccessListener(new OnSuccessListener<Location>() {
                        @Override
                        public void onSuccess(Location location) {
                            // GPS location can be null if GPS is switched off
                            if (location != null) {

                                mLocation = location;

                                if (mFusedLocationClient != null) {
                                    mFusedLocationClient.removeLocationUpdates(mLocationCallback);
                                }
                          } else {
                                startLocationUpdates();
                           }
                        }
                    })
                    .addOnFailureListener(new OnFailureListener() {
                        @Override
                        public void onFailure(@NonNull Exception e) {
                            Toast.makeText(HomeActivity.this, "Error trying to get last GPS location", Toast.LENGTH_SHORT).show();
                            e.printStackTrace();
                        }
                    });

and below is my requestLocationUpdates so I will get a request until the location is available.

private void startLocationUpdates() {
        mSettingsClient.checkLocationSettings(mLocationSettingsRequest)
                .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {
                    @Override
                    public void onSuccess(LocationSettingsResponse locationSettingsResponse) {
                        Log.i(TAG, "All location settings are satisfied.");

                        getPackageManager().checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, getPackageName());
                        mFusedLocationClient.requestLocationUpdates(mLocationRequest,
                                mLocationCallback, Looper.myLooper());
                        getLastLocationNewMethod();
                    }
                })
                .addOnFailureListener(this, new OnFailureListener() {
                    @Override
                    public void onFailure(@NonNull Exception e) {
                        int statusCode = ((ApiException) e).getStatusCode();
                        switch (statusCode) {
                            case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
                                Log.i(TAG, "Location settings are not satisfied. Attempting to upgrade " +
                                        "location settings ");
                                try {
                                    ResolvableApiException rae = (ResolvableApiException) e;
                                    rae.startResolutionForResult(HomeActivity.this, 0x1);
                                } catch (IntentSender.SendIntentException sie) {
                                    Log.i(TAG, "PendingIntent unable to execute request.");
                                }
                                break;
                            case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
                                String errorMessage = "Location settings are inadequate, and cannot be " +
                                        "fixed here. Fix in Settings.";
                                Log.e(TAG, errorMessage);
                                Toast.makeText(HomeActivity.this, errorMessage, Toast.LENGTH_LONG).show();
                                //  mRequestingLocationUpdates = false;
                        }
                        getLastLocationNewMethod();  // this method is where I can get location. It is calling above method. 
                    }
                });
    }

Note: For more information here is GitHub Repo LINK

🌐
Stack Overflow
stackoverflow.com › questions › 73946530 › how-to-use-getcurrentlocation-of-fused-location-provider-client
java - How to use getCurrentLocation of fused location provider client? - Stack Overflow
FusedLocationProviderClient fusedLocationClient = LocationServices.getFusedLocationProviderClient(getContext()); fusedLocationClient.getLastLocation().addOnSuccessListener(location -> { if (location != null) { // your last known location is ...
🌐
Esri Developer
developers.arcgis.com › kotlin › sample-code › show-device-location-using-fused-location-data-source
Show device location using fused location data source | ArcGIS Maps SDK for Kotlin | Esri Developer
* */ package com.esri.arcgismaps.sample.showdevicelocationusingfusedlocationdatasource.components import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope import com.arcgismaps.location.CustomLocationDataSource import com.arcgismaps.location.LocationDisplayAutoPanMode import com.arcgismaps.mapping.ArcGISMap import com.arcgismaps.mapping.BasemapStyle import com.arcgismaps.mapping.view.LocationDisplay import com.esri.arcgismaps.sample.sampleslib.components.MessageDialogViewModel import kotlinx.coroutines.launch class ShowDeviceLocationUsi
🌐
Codepath
guides.codepath.org › android › Retrieving-Location-with-LocationServices-API
Retrieving Location with LocationServices API | Android Development | CodePath Guides
public void getLastLocation() { // Get last known recent location using new Google Play Services SDK (v11+) FusedLocationProviderClient locationClient = getFusedLocationProviderClient(this); locationClient.getLastLocation() .addOnSuccessListener(new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { // GPS location can be null if GPS is switched off if (location != null) { onLocationChanged(location); } } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Log.d("MapDemoActivity", "Error trying to get last GPS location"); e.printStackTrace(); } }); }
🌐
GitHub
github.com › rohitchaddha › Get-Current-location-using-FusedLocationProviderClient-in-Android-Kotlin-
GitHub - rohitchaddha/Get-Current-location-using-FusedLocationProviderClient-in-Android-Kotlin-: Demonstrates use of the Google Play services Location API to retrieve the last known location for a device. · GitHub
This sample uses [FusedLocationProviderClient] This sample uses [FusedLocationProviderClient] (https://developer.android.com/reference/com/google/android/gms/location/LocationServices.html). Getting Started This sample uses the Gradle build system. To build this project, use the "gradlew build" command or use "Import Project" in Android Studio.
Author   rohitchaddha
🌐
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
🌐
Stack Overflow
stackoverflow.com › questions › tagged › fusedlocationproviderclient
Newest 'fusedlocationproviderclient' Questions - Stack Overflow
I used FusedLocationProviderClient with JobScheduler to get current location all time and it working well when app in background.
🌐
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.

🌐
Medium
alexportillo0519.medium.com › fused-location-provider-in-kotlin-47350c346ef3
Fused Location Provider in Kotlin | by Alexander Portillo | Medium
March 3, 2022 - Fused Location Provider in Kotlin I will be showing you how to use the fused location provider to get the device’s current location. 1. Add the dependency Go to your build.gradle (Module: app) file …