我如何知道LocationManager GPS检索的提供者?

问题描述 投票:1回答:1

我正在尝试记录有关应用程序如何获取坐标的信息。这是我用来抓取坐标的代码。

locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
location = locationManager.getLastKnownLocation(locationManager.NETWORK_PROVIDER);

我的问题是,我如何找出坐标的来源? (GPS,网络三角测量,Wifi等)

换句话说,getLastKnownLocation从多个源返回坐标,如何获取源的字符串名称?

android gps
1个回答
-1
投票

您使用NETWORK_PROVIDER。该提供商根据蜂窝塔和WiFi接入点的可用性确定位置。通过网络查找检索结果。 GPS_PROVIDER使用卫星确定位置。

© www.soinside.com 2019 - 2024. All rights reserved.