I have implemented a locationlistener in my app which uses the Network Provider.
This all works fine because i want a location quickly and with GPS Provider it takes
You can certainly use the same listener for multiple providers. It may be better to use locationmanager.getProviders
with a Criteria
object then sort by accuracy or just listen to all of them. Not much practical difference though.
The onLocationChanged
callback gives you a Location object, which has a getProvider()
method you can use to determine where it came from. It also has a getAccuracy()
method, so you could also sort your recent fixes by accuracy.
Ideally, if you are not concerned on the battery usage, then it perfectly fine to use both providers. As Daren explained, you can filters the coordinates by using getProvider() and getAccuracy().
http://blog.shinetech.com/2011/10/14/a-good-look-at-android-location-data/