1

I am trying to log information about how the app is fetching the coordinates. This is the code I used to grab the coordinates.

locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
location = locationManager.getLastKnownLocation(locationManager.NETWORK_PROVIDER);

My question is, how do I find out the source of the coordinates? (GPS, Network Triangulation, Wifi, etc. )

In other words, getLastKnownLocation returns coordinates from multiple sources, how do I get a string name of the source?

Hoose Karaki
  • 81
  • 1
  • 4
  • Check out this [question](http://stackoverflow.com/questions/6775257/android-location-providers-gps-or-network-provider) and [this](http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a/3145655#3145655). Maybe it helps. – looselessOne Jan 07 '16 at 21:28

1 Answers1

-1

You use NETWORK_PROVIDER. This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup. GPS_PROVIDER determines location using satellites.

JustOneMan
  • 231
  • 1
  • 9
  • 34