0

I was just wondering about this, because it doesn't make sense.

I have an GoogleApiClient which I connect, and after that I request location updates using

LocationServices.FusedLocationApi.requestLocationUpdates(
googleApiClient, mLocationRequest, this);

Now, the weird thing is - onLocationChanged(Location location) is called even when I put the phone in aeroplane mode! There is no internet and I still get location updates.. how is this possible? are those updates reliable and accurate?

Ofek Agmon
  • 5,040
  • 14
  • 57
  • 101

2 Answers2

0

In regular situations, the location is calculated based on one or several sensors. The data include:

  • Cellular networks.
  • Surrounding Wi-Fi networks.
  • Surrounding bluetooth beacons.
  • GPS.

The first 3 methods require radios that can both listen and broadcast radio signals, however the GPS only listens for signals broadcasted by satellites, as it does not broadcasts anything. When you activate the airplane mode, you are basically telling to the device to stop broadcasting any kind of signal (in order to avoid interferences with the aircraft), however as the GPS chip does not broadcast anything, it can be expected to keep listening for satelite signals and thus, reporting you back the device current location.

You can programatically detect the accuracy of the location object by calling:

location.getAccuracy();

Which is the accuracy of the location in meters.

Edit: Let me add some important points that might be interesting for you:

  • GPS first fix is really slow if it does not have assistance from any other radio. It can take minutes until you see the first location.
  • GPS needs a clear view of the sky in order to receive signals. So it won't work indoors.
  • GPS is one of the more power consuming ways to get location, compared with other techniques.
tomacco
  • 710
  • 4
  • 26
0

In a case where there are no internet or any update yet, it returns your last know location. so even in flight mode, you will probably still get it, it will only change once there is a new location update which will or may require internet before getting

Ibukun Muyide
  • 1,294
  • 1
  • 15
  • 23