[android] Android Location Providers - GPS or Network Provider?

In my application I would like to determine the user's current location. I do however have a couple of questions in this regard:

  1. There are different Location Providers, which one is the most accurate? The GPS Provider or the Network Provider?

  2. In how far do those available provider differ? How do they function?

  3. Could you please provide me with some code-snippets or tutorials on how to get started with implementing GPS functionality in my application?

This question is related to android location location-provider

The answer is


GPS is generally more accurate than network but sometimes GPS is not available, therefore you might need to switch between the two.

A good start might be to look at the android dev site. They had a section dedicated to determining user location and it has all the code samples you need.

http://developer.android.com/guide/topics/location/obtaining-user-location.html


There are some great answers mentioned here. Another approach you could take would be to use some free SDKs available online like Atooma, tranql and Neura, that can be integrated with your Android application (it takes less than 20 min to integrate). Along with giving you the accurate location of your user, it can also give you good insights about your user’s activities. Also, some of them consume less than 1% of your battery