Questions tagged [android-fusedlocation]

Synonym for Android Fused Location Provider which intelligently manages the underlying location technology and gives you the best location according to your needs.

Fused location provider:

The Fused Location Provider intelligently manages the underlying location technology and gives you the best location according to your needs.

  • Simple APIs: Lets you specify high-level needs like "high accuracy" or "low power", instead of having to worry about location providers. Immediately available: Gives your apps immediate access to the best, most recent location.

  • Power-efficiency: Minimizes your app's use of power. Based on all incoming location requests and available sensors, fused location provider chooses the most efficient way to meet those needs.

  • Versatility: Meets a wide range of needs, from foreground uses that need highly accurate location to background uses that need periodic location updates with negligible power impact.

Tutorials:

328 questions
0
votes
0 answers

Fused Location Provider method getLastLocation() returning null values

I am implementing a location android app , using fused location provider client .It has been working few days ago but actually it craches because it is returning as value null and here is what i got as error message :…
0
votes
1 answer

Problem: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference

Process crashed while executing mainTest(ru.myitschool.lab23.InstrumentedTestGeo): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object…
0
votes
0 answers

FusedLocationProviderClient: Position frequency

I'm trying to get a good position via android and GNSS. The locationManager of Android gives me in every Case only one update per second. So i decided to switch to the GoogleFusedApi and the FusedLocationProviderClient to get my current position…
0
votes
0 answers

How to avoid wrong locations in android while getting locations through FusedLocation?

I am getting device' locations through fused location service, then sending these location to backend to draw line on map. It is working fine. As we know, fused location is a free service and it has low accuracy (as compared to google paid…
0
votes
0 answers

Smallest displacment condition OR time interval condition inside the same LocationRequest

As the documentation do not specify clearly this behaviour, I'm wondering if one could set both an interval condition AND a smallest displacement condition inside the same LocationRequest to receive updates as soon as one of the two conditions are…
avianey
  • 5,545
  • 3
  • 37
  • 60
0
votes
1 answer

Cannot stop Fused Location Provider using removeLocationUpdates()

I have an activity that is receiving the user location every X seconds. When the user location is within the radius of 15 meters from a specific point, I want the Location Provider to stop updating the user location and to start a new activity. I…
jpsf
  • 7
  • 1
  • 7
0
votes
0 answers

Android Fused Location provider accuracy in tunnels

I'm building an app where I need very good accuracy. The app is calculating trip in the car for the companies I work with. I came to the point where it counts just like a odometer in a car, but my problem is tunnels. I was thinking that in each city…
0
votes
0 answers

Some time Android Fused location client return wrong location (I am in India but it returns location for US Colorado)

Below is the code used for getting the location private fun requestLocation() { Utils.print("LocationUpdateService","request location per minute") if (ActivityCompat.checkSelfPermission( this, …
Dalvendra Singh
  • 65
  • 1
  • 10
0
votes
1 answer

Location request takes a lot time to run after refresh

I am working currently on weather app from a tutorial. The app works fine until the moment when I try to refresh everything and request once again a location and call API using the new location. Whenever I do that it either takes a lot of time to…
0
votes
0 answers

Fused location provider does not always return the location according to the criteria

I have this code for request location updates: private var fusedLocationClient = LocationServices.getFusedLocationProviderClient(context) locationRequest = LocationRequest.create().apply { priority = when…
0
votes
2 answers

How to fix memory leak issue in FusedLocationApi Fragment?

I am using fused location api to find the current location in the fragment, sometimes getting a memory leak How to fix this issue? com.android.zigmaster.ui.home.FragmentSearch instance ​ Leaking: YES (ObjectWatcher was watching this because…
Bolt UIX
  • 5,988
  • 6
  • 31
  • 58
0
votes
0 answers

Get Location Updates When App is Closed Android

I am making an app that allows users to search for nearby users of my app, so I need to update users' location periodically, and this process should be triggered even when the app is closed. I have read about the limitations of background location,…
0
votes
1 answer

GPS doesn't work or updates are very slow when device is connected to FM transmitter via USB port in the car

An user of my app reports the next I found out that when I put my phone on charger (via fm transmitter USB port) then the problem exist. If I run the phone from battery, then the GPS in the app works fine. (can get coordinates, speed, address…
0
votes
1 answer

Android battery consumption in case of frequent call of fusedLocationProviderClient lastKnownLocation?

I have this use-case of sending the user's location when I hit a certain API. As this API call is frequent, I want to avoid the battery consumption of the app. I am okay with using the lastKnownLocation of the user and sending the same. fun…
0
votes
1 answer

Foreground service is being killed by Android after some time

For location updated I have used Fused Location API, but it seems that some Android phones are killing the foreground service after a while. How I can run foreground services and be sure that they won't be terminated by Android? public class…