Are there any advantages of using FusedLocationProviderApi over LocationManager?

后端 未结 3 406
陌清茗
陌清茗 2020-12-16 14:13

Earlier to get user current location I have used LocationManager:

LocationManager locationManager = (LocationManager) getActivity().getSystemService(Context.         


        
3条回答
  •  难免孤独
    2020-12-16 14:44

    In some situations FusedLocationProvider performs horribly. If you want to track your path on a map for example, it may decide to switch between GPS data and Wifi data. To calculate an accurate distance travelled, it is much better to force GPS readings with LocationManager, especially if you also want to track altitude, which wifi doesn't provide.

提交回复
热议问题