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
4
votes
0 answers

Why am I getting these Android logcat error messages while accessing device location?

I am using the Fused Location Provider API to both get current location and to request regular location updates. As far as I can tell, my permissions are configured correctly (both fine and coarse are present in my manifest and checked for and…
4
votes
5 answers

ViewModel has no zero argument constructor error - even when it has a zero argument constructor

I'm new to Android and Java and am trying to make a location-based app. EDIT I've made a much, much simpler test code and get the same error. Here's the java: package com.example.viewmodeltest; import…
4
votes
0 answers

Android 10 GPS Pings in Background

With existing mobile tracking implementation we were getting logistic user's location (co-ordinates,speed etc.) using Android locationManager background service. This implementation was working fine till Android OS 9(Pie). But with OS 10(Q) upgrade,…
4
votes
1 answer

FusedLocationProvider gives wrong location sometimes

I am using FusedLocationProviderClient to get location updates in a foreground service. On testing and observing for few days, I found wrong locations which was far away from my actual location by around 4 kms similar to this, but the LocationResult…
4
votes
1 answer

FusedLocationProviderClient gives different location sometimes

public void getDeviceLocation() { fusedLocationClient = LocationServices.getFusedLocationProviderClient(getMvpView().getActivity()); settingsClient = LocationServices.getSettingsClient(getMvpView().getActivity()); …
avez raj
  • 2,055
  • 2
  • 22
  • 37
4
votes
1 answer

FusedLocationClient vs LocationManager in Initial Location

Deciding between LocationManager or FusedLocationClient in Android is pretty easy, just go for FusedLocationClient, since it will save power and it is recommended as a best practice. However, I'm in a situation where I have to fetch the "initial…
4
votes
1 answer

How to get location using Fused Location Provider in android using Network?

I have been trying to get location (lat/lon) using Fused Location Api in andriod. My code works fine when both wifi and gps are on. If I turn off the gps then i don't get any location update. I am using BALANCED_POWER_ACCURACY for location…
4
votes
3 answers

Android FusedLocationProvider stops giving location when phone is idle

I'm working on location tracking application using FusedLocationProvider. I have a background service which tracks location of phone in every 5 minutes. All works well with it, but once the phone goes idle then after 3 to 4 hours of time, the…
4
votes
1 answer

Fused location provider behavior in Android 5.0 unexpected

I am trying to make use of android fused location provider to get the device location every 30 minutes using PRIORITY_HIGH_ACCURACY. What is surprising to me is that, When GPS is disabled, I am expecting the API to make use of network provider and…
Kaps
  • 2,345
  • 2
  • 26
  • 37
4
votes
1 answer

Requesting location updates more often than 5 seconds (Android Fused location)

Im making a real time location listening app and i need to call location updates in every 3 seconds. I use Fused location. My interval is set to 3 seconds, however it looks like the minumum value for this interval is 5 seconds. Code: public class…
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
3
votes
1 answer

Recording GPS location in the background doesn't work when battery optimizations are enabled on Android

We develop an application which is used for outdoor activities (hiking, bicycle, mountain bike, ...) and one of the main features of the application is to record the track of the user thanks to the GPS of the smartphone / tablet in the background in…
3
votes
2 answers

Android FusedLocationProviderClient suddenly no longer calling callback with Location

About two weeks ago, several areas of our app stopped working randomly, specifically those that relied on up to date location. This is happening on multiple devices, both real devices and emulators. Before this, it was working every time.…
3
votes
1 answer

Customise alert message for Location Services when using FusedLocationProviderApi

I am using Fused Location Provider API to get device location in my project. When the location services are off it shows an alert dialog asking the user to turn it on. Is there any way to customize this alert dialog to show a different…
3
votes
2 answers

Workmanager (periodic) get location and upload data (Asynctask ) get killed

Workmanager doesnt send coordinates to my server when phone is in sleepmode. Asynctask get killed? I use the Workmanager (PeriodicWorkRequest) to get the coordinates every 15 min. To get the coordinates i use FusedLocationClient. That works fine....…
3
votes
2 answers

FusedLocationProviderClient constructor is marked as internal

I just updated my Google dependencies to 12.0.1 and now I'm getting this error where I'm using FusedLocationProviderClient. Any idea why is this happening? Looking into source code, I can see the the constructors are now hidden: @Hide public…
Guy
  • 6,414
  • 19
  • 66
  • 136
1 2
3
21 22