准确跟踪GPS路线Android

时间:2015-08-31 06:19:46

标签: android xamarin gps locationmanager fusedlocationproviderapi

我正在编写一个应用程序来跟踪用户的实时位置并在地图上显示它。然而,我看到的结果并不令人满意。当我将我的应用程序与Play商店中的其他人进行比较时,差异很大。

以下是我到目前为止所尝试的内容:(以防我使用Xamarin构建此应用程序)

我之前使用的是Fused Location Api,这给用户当前位置带来了太多偏差。 所以,我尝试使用只有GPS_Provider的位置管理器。使用它,准确度增加了很多,但仍然不完美。

以下是使用位置管理器的代码:

protected void CreateLocationRequest() {
            if (locMgr.AllProviders.Contains (LocationManager.GpsProvider) && locMgr.IsProviderEnabled (LocationManager.GpsProvider)) {
                locMgr.RequestLocationUpdates (LocationManager.GpsProvider, 3000, 2, this);
            } 
        }

public void OnLocationChanged (Location location)
        {
            Console.WriteLine ("OnLocationChanged");
            if(location != null && location.Accuracy <= 20){
                drawPath (location);
            }
        }

以下是我的应用程序的屏幕截图:

enter image description here

以下是来自Playstore的应用程序的屏幕截图

enter image description here

0 个答案:

没有答案