Questions tagged [fusedlocationproviderclient]

164 questions
27
votes
5 answers

LocationCallback not getting called

I am making a location request using FusedLocationProviderClient. I have kept a timer for 30 seconds to check if location is received within that timeframe. Code is below: public void requestLocationUpdates() { initializeLocationRequest(); …
12
votes
2 answers

Background Location updates using Google API - Fused Location Provider not accurate

I have been working and testing on background location updates using GoogleApiClient for Interval and Displacement based updates. On testing and analyzing for a few days I figured out some variations in the output which I did not expect. While…
Joshua
  • 1,167
  • 1
  • 14
  • 32
9
votes
3 answers

FusedLocationClient not calling onLocationResult

I'm creating a location client at the moment, currently i have public void startUpdatingLocationProcess(Context context) { parentContext = context; if (mFusedLocationClient == null){ mFusedLocationClient =…
Brandon
  • 1,158
  • 3
  • 12
  • 22
8
votes
1 answer

Android 12 doesn't return location with approximate location permission

On Pixel 4a with Android 12 (SPB5.210812.002), when approximate location permission is given by the user, no location is returned from FusedLocationProviderClient. When I change permission to exact location permission, then I'm able to get…
8
votes
2 answers

FusedLocationProviderClient getLastLocation elapsedRealtimeNanos mostly current system time

Update 2 I had a talk with a google engineer on Google I/O '18. He told me that I can trust the fusedLocationProvider. If he marks the last known location with a new timestamp the user is probably still at the same location. I'd like to do a few…
8
votes
1 answer

Location Updates with FusedLocationProviderClient produces memory leaks

I can't understand why this very simple activity produces memory leaks. It follows the guidelines given here: https://developer.android.com/training/location/receive-location-updates.html and the example code given here:…
7
votes
2 answers

location data null with .getLastLocation() FusedLocationProviderClient

I am getting coordinates with FusedLocationProviderClient in my application on a button click to store into a database. The issue is that when I reboot the phone or the emulator the .getLastLocation() is null and I have to click another time the…
6
votes
2 answers

Android - FusedLocationClient, requestLocationUpdates() not returning results and availability weird behavior

After a lot of reading and fighting with it myself I have to ask my better peers. I have a behavior that I cannot explain with FusedLocationClient. I want to get the location (only one instance) for showing some info to the user. For that I…
MadDim
  • 543
  • 6
  • 22
6
votes
0 answers

How to create FusedLocationProviderClient in a Service that can run untill stop by user?

I have successfully created an activity with FusedLocationProviderClient that returns location coordinates within a specific period of time. But I want it to run in background service that saves coordinates in local database and never ends until…
Muhammad
  • 127
  • 1
  • 2
  • 13
6
votes
0 answers

FusedLocationProviderClient onLocationResult never called

I 'm trying to get location of user every time user open my app , here is my code. I notice that onLocationResult method is never called and i can't get the location update. Can anyone help me solve this ? final LocationRequest mLocationRequest…
manhtuan21
  • 2,388
  • 2
  • 10
  • 24
5
votes
1 answer

How to remove FusedlocationProviderClient location updates from within non-activity class

I’m trying to write a utility class to wrap the Google Play Services FusedLocationProviderClient API and location permissions request as I’m sick of writing all that boilerplate every time I want to add location functionality to an app. The problem…
5
votes
1 answer

Android FusedLocationClient does not request new samples

How to force FusedLocationProviderClient explicitly ask for a new location? A few months ago, I upgraded the FusedLocationProviderClient. Ever since, requesting to sample a new location won't provide a new one. // Request a single location. // …
5
votes
2 answers

FusedLocationProviderClient is always null and locationAvailability is often false

I'm using jobScheduler to get background location updates. But each time the job is scheduled, FusedLocationProviderClient is null. Why is that? I've checked if(FusedLocationProviderClient == null) condition and each time the job is scheduled, the…
beck
  • 2,967
  • 3
  • 16
  • 27
4
votes
1 answer

getCurrentLocation() of FusedLocationProviderClient returns a success but without the location?

While it's expected that LastLocation doesn't provide a location for the first time if it's unknown. I didn't expect to see the same issue with GetCurrentLocation. val mFusedLocationClient: FusedLocationProviderClient =…
Houman
  • 64,245
  • 87
  • 278
  • 460
4
votes
3 answers

LocationRequest (FusedLocationProviderClient) - Deprecated

LocationRequest is now deprecated? What is the replacement for it? I was using it and recently got a deprecation message. What should I do now: val locationRequest = LocationRequest().apply { interval = LOCATION_UPDATE_INTERVAL …
Stefan
  • 2,829
  • 5
  • 20
  • 44
1
2 3
10 11