Questions tagged [fusedlocationproviderclient]

164 questions
2
votes
2 answers

How to Call getCurrentLocation() method of FusedLocationProviderClient in Kotlin

I am trying to access the location information of my Android phone using an app and I can not appear to get the current location. My code is as follows: fusedLocationClient = LocationServices.getFusedLocationProviderClient(requireActivity()) val…
Tyler
  • 127
  • 3
  • 11
2
votes
1 answer

FusedLocationProviderClient crash with java.lang.NullPointerException: parameter location specified as non-null is null

I'm using FusedLocationProviderClient in my app and it works fine to get user current location but suddenly I got this crash java.lang.NullPointerException: Parameter specified as non-null is null: method…
Amin
  • 463
  • 2
  • 11
  • 29
2
votes
0 answers

addOnFailureListener() doesnot call if user once enabled and after sometime disable location. when using LocationServices.getSettingsClient()

I have used LocationServices.getSettingsClient() to remove depricated LocationServices.SettingsApi.checkLocationSettings(). It is asking user to enable location first time when mainActivity launch if location is disabled. If in between i disable…
2
votes
1 answer

Cannot resolve method 'getCurrentLocation' in 'FusedLocationProviderClient'

I am trying to use FusedLocationProviderClient.getCurrentLocation(). It's supposed to be available according to the documentation here. But in Android Studio, I am getting the error Cannot resolve method 'getCurrentLocation' in…
chongzixin
  • 1,951
  • 4
  • 28
  • 55
2
votes
0 answers

fusedlocationproviderclient.getlastlocation() is giving same location (Latitude: 37.4219983 Longitude: -122.084)

I am trying to display my current location using Google Maps on Android Studio (Java, XML). But I am having some problems in fetching current location from FusedLocationProviderClient.getLastLocation(). Below are my related methods which are…
2
votes
2 answers

Is using Looper.myLopper() or null in FusedLocationProviderClient.requestLocationUpdates() the same thing?

I'm creating a location tracking app for which I'm using the FusedLocationProviderClient.requestLocationUpdates() method. One of its argument requires a Looper object and I'm not completely sure how it works. Right now I'm just passing null to it…
Syed Ahmed Jamil
  • 1,881
  • 3
  • 18
  • 34
2
votes
0 answers

Android: FusedLocationProviderClient doesn't call onLocationResult() when device location is already enabled

I have recently stared to get issues as my FusedLocationProviderClient doesn't call the onLocationResult() method of LocationCallback when the device location is already enabled but has no problems to do so when I ask user to enable the location…
Androidz
  • 261
  • 2
  • 11
2
votes
2 answers

Do I need a listener and a callback with FusedLocationProviderClient?

I started using FusedLocationClient and I'm not sure why would I need both an OnSuccessListener and a LocationCallback. Shouldn't just one of these suffice? private void initLocationCallback(Context context) { fusedLocationClient =…
2
votes
0 answers

Get user location with "Device Only" in Android

Context: I have been using FusedLocationProviderClient to get user's location. When the phone is in High Accuracy mode, everything works as expected. However, not all phones are in high accuracy. So, how can I manage to get the user location by GPS…
2
votes
2 answers

FusedLocationProviderClient doesn't have bearing data

I'm using FusedLocationProviderClient class in android to get user's last location. Everything is fine and I can get latitude and longitude but task.getResult().getBearing() returns 0.0 and task.getResult().hasBearing() returns false. How can I get…
mrazizi
  • 319
  • 2
  • 15
2
votes
0 answers

Getting the Nmea sentence from google fused provider

I'd like to get the NMEA sentence using the android fused location Provider Client, but I can't find any documentation. Is it possible? thx
Daitarn
  • 109
  • 1
  • 15
2
votes
0 answers

FusedLocationAPI can not remove location updates through AlarmManager

I have created simple class to get updated location using google's FusedLocationProviderClient. i.e.: public class LocationProvider extends LocationCallback {... private static FusedLocationProviderClient mFusedLocationClient; private…
2
votes
0 answers

LocationFusedAPI setMaxWaitTime works only once

I've a simple app with LocationFused API implementation: protected void startLocationUpdates() { mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this); Intent intent = new Intent(this, LocationReceiver.class); …
2
votes
1 answer

No need to manually check Google Play Services version anymore?

It's been a while since I worked with Google Play Services and I'm now implementing a feature that requires location tracking. After following a dated example that used GoogleApiClient, I found this post about the new Location APIs at Android…
2
votes
1 answer

How to detect when user turns off GPS with FusedLocationProviderClient?

Now that FusedLocationProvider API is deprecated, I am using FusedLocationProviderClient, but I couldn't find how to detect when user turns the location off. Is there any listener for this? Thank you in advance!
Andrei Pascale
  • 232
  • 1
  • 3
  • 16
1 2
3
10 11