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
3
votes
2 answers

Fused location stops sending updates after several hours

If I left application turned on for several hours fused location stops sending updates... I am creating location request with hight priority , here is code : LocationRequest = LocationRequest.create() …
3
votes
2 answers

What are good strategies for dealing with background location limits for apps running on O devices?

Given the limits placed on location gathering on Android apps running in the background on O devices, what are good options for developers who want more frequent location updates? I realize that O is still in developer preview, but there are…
3
votes
1 answer

Is at least one location sent by location services after calling requestLocationUpdates?

When setting up receiving location update with LocationServices.FusedLocationApi.requestLocationUpdates, I need to make sure I get at least one location. For example, if the device has been still for a long time, after calling…
Don Box
  • 3,166
  • 3
  • 26
  • 55
3
votes
1 answer

Location speed Getting wrong using fused provider

I am using fused location provider with PRIORITY_HIGH_ACCURACY mode for location polling but sometimes it give wrong location speed like 77 m/s.Which is wrong so how can i achieve correct location speed? Location Request: mLocationRequest =…
MIkka Marmik
  • 1,101
  • 11
  • 29
3
votes
2 answers

How to receive location updates every 5 minutes using the FusedLocation API

I am currently working on an app that has to check the user's location every five minutes and send the coordinates to a server. I decided to go with the FusedLocation API in Google Play Services instead of the plain old LocationManager API, mainly…
3
votes
0 answers

Android Fused Location API Location Not Accurate

I am using Fused Location API for one of my app. I have set the priority to LocationRequest.PRIORITY_HIGH_ACCURACY. When I set interval/fastest interval to few milli seconds, what I observe is that GPS is on all the time and I get Lat Lng with…
3
votes
1 answer

Best practices: Getting location updates in background

Developing an android application which updates location of the user in the background. Now, for this Google provide two ways: Getting user last location through getlastlocation() function. An alarm manager can be set and with the help of broadcast…
3
votes
1 answer

Default accept "Improve Location Accuracy" popup when Google play services is updated [ROOT]

I have an application which is installed in the phones cab drivers use to track the location and distance traveled by the cab. (The phone is rooted and we have all privileges on the phone). In the first implementation of our application we used…
3
votes
1 answer

GoogleApiClient gives a nullpointer even when a context is passed to it while using Fused Location API in android

I am trying to implement Fused Location API in a service. I have done the following coding but I am getting an error as follows: java.lang.RuntimeException: Unable to instantiate service com.locate.LocationDetails: java.lang.NullPointerException:…
2
votes
3 answers

Get user's current location in Jetpack Compose Android

Intention: I am trying to get user's current location after user grants (coarse/fine)location permission. I am using jetpack compose accompanist lib to manager permission. So when user grants the permission, am using getCurrentLocation of…
2
votes
0 answers

How to detect fake location in Android?

I am working on an app in which I have to trace the location of drivers. I used fusedlocation and GPS location methods for this purpose. It is working fine. But some drivers/users have installed Fake GPS/Fake Location Apps on their devices through…
2
votes
0 answers

Independent/standalone GPS App on Samsung Galaxy Watch 4 still requires phone connection

I need my Wear OS sailing App to provide GPS updates when no phone is connected. Unfortunately despite specifying the App as standalone the GPS updates stop as soon as the Bluetooth link to the phone is lost. The documentation indicates independent…
2
votes
2 answers

FusedLocationProviderClient not working correctly when Location turned on/off

I am using location to implement geofencing functionality (limiting app usage to one country) In first activity in application I am using FusedLocationProviderClient to get location like this: Init part fusedLocationClient =…
Dejan
  • 3,046
  • 3
  • 28
  • 43
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
2 answers

Unable to clear mock location?

This is how I set a mock location in my app: public void startMockLocation(String latitude, String longitude){ FusedLocationProviderClient locationProvider = new FusedLocationProviderClient(getApplicationContext()); …
Panjeet
  • 117
  • 1
  • 18