LocationManager uses FusedLocationProviderApi?

和自甴很熟 提交于 2020-01-17 14:57:19

问题


During researching I realized that there are different ways in Android to get the users location. First solution is by LocationManager and the second solution is FusedLocationProviderAPI, which is based on GooglePlay Services. In the internet I just could find tutorials & explanations of them separately. At work today somebody showed me that he is using LocationManager with Criterias that in the onLocationChanged-Method locations are received with the provider "fused". Does this mean that LocationManager also gather location information from fused API if available? I couldn't find any written information about that in the net.

Hopefully somebody can make this clear.

Thank you, Fin


回答1:


LocationManager uses FusedLocationProviderApi?

No, FusedLocationProvider(FLP) uses LocationManager internally.

If you wanna interact directly provider's itself, u can use LocationManager.

FLP wraps location providers like gps, network and sensors in your device. And provides you choose how you receive locations like

  • More accurate results with more power usage
  • Less accurate results with less power usage

Also u can watch Google's video (12:12 - 14:42), nice visual explanation.



来源:https://stackoverflow.com/questions/37395614/locationmanager-uses-fusedlocationproviderapi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!