Windows phone 7 GPS精度问题
我正在开发一个windows phone sports tracker应用程序,它使用gps传感器来计算跑步者行驶的距离,我正在使用geocoordinatewatcher类来计算,将移动阈值设置为100。但是,我发现我的应用程序给出了距离值,即使设备保持静止。我的应用程序应该只在设备改变位置时给出距离。我在市场上的其他应用程序中发现了相同的错误,请告诉我哪里做错了?Windows phone 7 GPS精度问题,windows-phone-7,windows-phone-8,Windows Phone 7,Windows Phone 8,我正在开发一个windows phone sports tracker应用程序,它使用gps传感器来计算跑步者行驶的距离,我正在使用geocoordinatewatcher类来计算,将移动阈值设置为100。但是,我发现我的应用程序给出了距离值,即使设备保持静止。我的应用程序应该只在设备改变位置时给出距离。我在市场上的其他应用程序中发现了相同的错误,请告诉我哪里做错了? 我的密码 您正在为Windows Phone 7或Windows Phone 8开发应用程序?如果您是为后者开发的,则需要使用新
我的密码
您正在为Windows Phone 7或Windows Phone 8开发应用程序?如果您是为后者开发的,则需要使用新的Geolocator类,而不是GeoCoordinateWatcher
此外,正如刘易斯本格所说,如果你在室内测试,你可以获得WiFi位置,甚至手机数据。最好在室外测试。在测试的地方,您的GPS信号可能很弱。在室外位置试用。您是在室外还是在室内通过WiFi测试设备?如果你在室内,很可能你没有使用GPS,因此会失去一定的精确度,并切换到手机或wifi位置。可能启用了一些记录的调试信息,然后带您的设备出去走走,看看您得到了什么结果。
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
watcher.MovementThreshold = 150;
watcher.PositionChanged += watcher_PositionChanged;
watcher.Start();
{
latitudeCurrent = e.Position.Location.Latitude;
longitudeCurrent = e.Position.Location.Longitude;
if (stepCounter == 0)
{
latitudePrevious = latitudeCurrent;
longitudePrevious = longitudeCurrent;
distanceTravelled += Math.Round(Calculate(latitudePrevious,longitudePrevious,latitudeCurrent,longitudeCurrent),2);
txbDistanceTravelled.Text = distanceTravelled.ToString();
txbCalories.Text=string.Format("{0:f0}", distanceTravelled * 65);
stepCounter++;
var millisPerKilometer = (distanceTravelled) * (System.Environment.TickCount - _previousPositionChangeTick);
txbPace.Text = TimeSpan.FromMilliseconds(millisPerKilometer).ToString(@"mm\:ss");
double hrs = counterTick / 3600;
if (!double.IsNaN((distanceTravelled / hrs)))
{
txbSpeed.Text = (distanceTravelled / hrs).ToString();
}
else
{
txbSpeed.Text = "0";
}
}
}