I am trying to position my location in an android application that I am developing. I was reading on the internet that there are 3 types of providers and I read their differences so in the end I opted for NETWORK_PROVIDER but I don't quite understand if it is necessary to have the gps activated for it to work with the network.
This is an interesting question, when you use as a provider
NETWORK_PROVIDER
, your device does not need to have theGPS
. You can have both providers enabled or one of them.There are important differences that I think are important to comment on:
If your geo-location services are determined by the WiFi or mobile network, the battery consumption is low, but the position accuracy is not as reliable.
On the other hand, if your geo-location services are determined by GPS, the battery consumption is higher compared to the network provider, but the position accuracy is much better.
As I comment, you can use one or both providers, you can even individually determine the availability of one:
Currently most devices can configure which providers to use to obtain geo-location. To obtain greater accuracy, the two providers are used A), to use only the network, with low energy consumption the network B) or you can only use the GPS C).