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
1
vote
1 answer

Unresolved reference: LocationRequest for Android S (12)

Android 12 SDK seems to be stable now if compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { minSdkVersion 23 targetSdkVersion 30 then Play Services Location works fine but if compileSdkVersion 31 buildToolsVersion…
1
vote
0 answers

What are the request limits on background location in Android 11+ in a foreground service (FLP)?

Our Android app starts a foreground service that is guaranteed to be foregrounded by the user before use. However, we now need to get user location even when the user has backgrounded the app or locked the phone or something. If the app has been…
1
vote
0 answers

Android location update using fused returns null. How to ensure I get it from foreground activity?

I need the location once in my foreground activity. But I get a null response. Weirdly once I open google maps the location callback returns a valid object. What is google maps doing that I'm not? How do I ensure the value is not null in my…
ir2pid
  • 5,604
  • 12
  • 63
  • 107
1
vote
1 answer

Android FusedLocationClient with PendingIntent not receiving location update when app is in background

I'm using FusedLocationClient and broadcast receiver to get location in background, i enabled background location background permission and locations (FINE and COARSE) permission. i receive location update when app in foreground but when moving app…
1
vote
0 answers

What is recommended interval for location updates to get real-time vehicle speed?

Right now I have such settings for location updates: private const val LOCATION_MIN_TIME_INTERVAL = 200L private val locationRequest = LocationRequest().apply { interval = LOCATION_MIN_TIME_INTERVAL fastestInterval =…
user924
  • 8,146
  • 7
  • 57
  • 139
1
vote
1 answer

FusedLocationProviderClient.getCurrentLocation(): Background apps calling this method will be throttled under background location limits

In the docs for FusedLocationProviderClient.getCurrentLocation() it says as follows: This method may return locations that are a few seconds old, but never returns much older locations. This is suitable for foreground applications that need a…
1
vote
0 answers

Fusedlocation requestLocationUpdates not working in background

I am trying to print out my location from my app. It works fine in the foreground, but as soon as I move to background, it stops printing out. I have made a location class, i.e. it's a normal class and not an activity or fragment. I start up the…
1
vote
0 answers

Not able to get location setting as AVAILABLE if FakeGPS apps are enabled

In my app, i need to check whether user has enabled location setting or not before requesting location updates. The way i'm doing that is exactly like in the official documentation:…
div
  • 1,475
  • 3
  • 22
  • 32
1
vote
0 answers

FusedLocationProviderClient - Bad accuracy

I'm getting a very bad accuracy with FusedLocationProviderClient and PRIORITY_HIGH_ACCURACY. Example of Locations returned (I'm stoped, i'm not moving). Location[fused 38,993027,-1,871872 hAcc=7 et=+4d9h38m28s50ms alt=734 vel=0.01439964 bear=180.0…
1
vote
1 answer

Why the permission Manifest.permission.ACCESS_FINE_LOCATION not active the "Location" option?

I have a code that makes location requests for the user, everything works fine as long as the user is already in the "location" mode is active, however, if the "location" mode is not activated in the device notification bar location returns null, I…
1
vote
1 answer

FusedLocationProviderClient stop giving locationResult after several LocationRequest

Please help if anybody has idea what happened with this case. I have BroadcastReceiver which register to ForegroundService. This BroadcastReceiver will listen to Intent.ACTION_SCREEN_ON and called startLocationUpdates() if it receive any. fun…
1
vote
1 answer

How to add progressbar in fusedlocationproviderclient.oncompletelistener()?

I am using fusedlocationproviderclient for finding the current location but i want progressbar should display till location found, but i dont understand how to use progress bar in oncomplete() method Here is the code of my fusedlocation…
1
vote
0 answers

Background location updates stopped when app is killed mode

My problem is i can get the location in background but once app is killed it stopped updating. i am storing the latitude and longitude into firebase once it's fetching from getlastlocation method. and foreground and background mode it's updating…
1
vote
1 answer

FusedLocationProviderClient cannot get GPS location over 3G or 4G network unless first connected to WIFI network

One of our applications is running on Sunmi's T1 and T2 mini's. The application sends back the device's location data using the LocationUtil class below: public class LocationUtil { private static final String TAG =…
1
vote
0 answers

location is always null at startup

I am trying to get my latitude and longitude when my app starts, but it is always empty. If I get out and open the app again, I am getting the location. My codes are: mainactivity public class MainActivity extends AppCompatActivity …
BaRud
  • 3,055
  • 7
  • 41
  • 89