Search code examples
androidandroid-fusedlocationandroid-gps

Best way of getting Fast and Accurate Location


In Android I have seen many ways of getting Location. I have read this and this about Location and Also I have came to know about Fused Location Api.

My Case in App is that, When User Starts the App it must Fetch the location in a quickest way posssible . As I have to do some specific task based on user location.

So by the time Now I am using the location services. In this I have tried the Loation from GPS and Location From Network. but both of them requires my Location to be Enabled but I think that it should not matter if I am fetching location from the netwrok ? Is it ?

So what you guys would suggest me to how to get the Location ? which should return reply fast and accurate ?

  1. What is the main difference in Location from GPS and Network as both need Location to be enabled ?
  2. What is meant by the best provider in the Context ?
  3. How does the Fused Location work ?
  4. Shuld I go For Location Services of Fused Location API as my app would use data or wifi (internet) for further working ?

Please argue on this my these confusion ? what is best for me can some one please sunder stand my case and answer me accordingly ?


Solution

    1. Location you get from GPS is more accurate than the location you get from the network,so if you need accuracy use GPS

    2. Not sure about this but i think its about the context what type of location you want like you want the accuracy or the fastest one so according to that choose your provider

    3. FusedLocation provider is the most efficient and effective solution for getting the location on android now,it gathers the location data from different sources and according to the parameters passed like in how much time you want location to be updated,you want high accuracy or not etc.It provides you the best location.

    4. Yes you should use the FusedLocationProvider for getting the location on android,as google also recommends this and it the most effective and efficient way there to get location on android for now.

    I hope this will help you in making a decision.