0

we have made a tracking app in which we are using fused location provider API to track the user location.Also GoogleApiClient is used with combination of LocationServices api.

In the app we are tracking location in the time interval of 2 minutes. Sometimes location may be unavailable in some cases like user is in basement where gps is unable to provide location and there is no wi-fi or mobile network available to get location.

Let's have the table of location availability for each request.

2 pm OK 2:02 OK 2:04 NO LOCATION 2:06 NO LOCATION 2:08 OK

There are total five location request we have in the table.

At 2 pm and 2:02 location is available.

At 2:04 and 2:06 location is not available.(User in a basement or some other place where gps, wifi and mobile network unable to provide location)

At 2:08 again we have location available.

What happen with location request at time of 2:04 it will keep trying to get location or it is killed by the android os ?.

At 2:06 again new location request will be called. In this case it will replace the previous location request or the queue of the location request will be made ? That means total 2 location request will keep trying to get location.

At 2:08 When the location is available will the all request cancelled and the location will be provided for the recent location request ?

Praveen
  • 31
  • 3
  • unless you are starting another location manager yourself you are not getting multiple requests – tyczj Jul 03 '15 at 14:06

1 Answers1

0

FusedLocationProviderAPI uses whichever Location Service is most readily available. If you made a request for location updates every 2 minutes then the service will provide the most recent location available.

As such, there is no need to cancel a request if Location is unavailable.

That being said, if you want to micromanage the location requests to that extent, you could calculate if the newest location has or has not changed from an acceptable deviation of 2.00 degrees longitude/latitude.

andrewdleach
  • 2,458
  • 2
  • 17
  • 25