Questions tagged [fusedlocationproviderclient]

164 questions
0
votes
2 answers

Avoid Method invocation getLatitude may produce java.Lang.NullPointerException

I have a method to show on the map the current position of the device. I am using FusedLocationProviderClient because it seems to be the most accurate. On currentLocation.getLatitude() I get the warning: Method invocation may produce…
Stefano
  • 209
  • 2
  • 10
  • 34
0
votes
2 answers

How do i fix the getting null location value from FusedLocationProviderClient in android

I have been trying to get current location data using FusedLocationProviderClient in android. I always get null on the location variable, How do i fix it? I have tried to follow the steps from android developer website for…
AruN
  • 171
  • 4
  • 15
0
votes
1 answer

How do I assign location coordinates outside an onSuccessListener in Android (Kotlin)?

I'm trying to get the location of an Android device. I've been following these instructions for using fusedLocationClient. I can't assign variables outside .addSuccessListener. I'll that the logs outside the listener are being called before the…
0
votes
0 answers

How to use Fused Location Provider client in android lollipop

I'm trying to get my current location to show it on map using "FusedLocationProviderClient" but it is not working in android lollipop although it is working fine in all above versions. Below is code sample what I'm trying to do. if…
0
votes
1 answer

FusedLocationProviderClient requestLocationUpdates: how to make it poll if location is available

I have an android app where the GUI is running on a main thread. I have a worker thread where I am trying to fetch location. I am doing it as follows: fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, …
Omi
  • 976
  • 2
  • 20
  • 35
0
votes
0 answers

FusedLocationProviderClient returns same location sometimes

I am working on the app that tracks user live location, and I am using FusedLocationProviderClient to get the current location but it return the same location sometimes i.e app gets a location when app is opened, after moving to another place say…
0
votes
0 answers

Draw route between current location and a location fetched from server

I am new in android. I fetched my current location using FusedLocationProviderClient and i have also fetched location from sever. I want to draw a route and navigation as well from my current location and fetched location as well.…
0
votes
0 answers

Does google maps use fusedlocationproviderclient?? if yes how is google maps faster than if i use it in my location logger app

I am building a location longing app, right now i'm using fusedlocationproviderclient which is recommended in the google docs. so when i press my location log button it requests for location updates and in the location listener when i get the…
Rohit Martires
  • 313
  • 2
  • 8
0
votes
1 answer

Android FusedLocationProviderClient doesn't always work

I tested this code with three phones. It works with two of them, but doesn't work with the third one, Huawei y9 2019. What's the problem? , And Why is it show (?) and (*) sign ?? My code is: mFusedLocationProviderClient = new…
Rafat97
  • 25
  • 2
  • 8
0
votes
1 answer

Why am I getting NullPointerException with FusedLocationProviderClient when using properties from other class

Excuse me for the basic question but I am learning android programming now. I am using GoogleFusedProviderClient to get the location of the app from a custom class. I have put it in a class as I need to call this from multiple activities. fas…
0
votes
0 answers

Need some location plugin which is not using FusedLocationProvider

I need to get current location in my application and I'm using flutter location plugin. I just got this libraries for using location in flutter : _location, geolocator, geolocation, flutter_geolocation_ all this libraries are using google…
0
votes
1 answer

Why my app doesn't show location button when I accept the permission request dialog the second time is runned?

I am programming an Android App in Java. The activity holds a Google map and what I want is to have a button location at the top, like is shown in the picture: I want that when I click the location to point to my current Location and for that I am…
0
votes
0 answers

mFusedLocationProviderClient.getLastLocation() , location is always null

i am trying to build app which always track locations of my clients, the app always shows that the location is null. in the Manifest file i have ( ACCESS_FINE_LOCATION ) and (ACCESS_COARSE_LOCATION ) permissions . the problem is everytime i open…
0
votes
1 answer

Location is fetching when the app is killed and in background using FusedLocationProviderClient with pending Intent but in Irregular times

I am using FusedLocationProviderClient with pending intent. I am getting the location when the app is active. But while the app goes into background or app is killed, I am getting the location in irregular intervals say 2mins, 3 mins, 10 mins…
0
votes
0 answers

FusedLocationProviderClient stops working in Lollipop(only) while offline after updating target SDK version to 27 from 26

After the release of Oreo 8.0 and 8.1 i updated my targetSdkVersion into 27 because Notification channel is necessary for foreGround Services, but unfortunately FusedLocationProviderClient stops working if the device is not connected in internet but…
1 2 3
10
11