融合位置提供商的更新速度不够快

时间:2016-10-02 04:34:13

标签: android performance fusedlocationproviderapi

前段时间我写了一个Unity程序,它记录了GPS坐标,并在驾驶时每秒约3次获得一个新位置。我在Android Studio中重写应用并使用融合位置提供程序API。它非常慢,驾驶时只能获得5-15秒的GPS坐标。以下是我的代码中的一些内容,我认为这会影响获取位置的速度。

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    ...
    locationRequest = new LocationRequest();
    locationRequest.setInterval(10);
    locationRequest.setFastestInterval(15*1000);
    locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
    ...
    @Override
    public void onLocationChanged(Location location) {
    myLatitude = location.getLatitude();
    mylongitude = location.getLongitude();
    ....

为了使这个应用程序可行,它需要每秒至少记录几次GPS坐标。我应该回到android.location方法的位置,即使建议不要这样做吗?

如何加快接收GPS坐标?

1 个答案:

答案 0 :(得分:1)

你在这里通过间隔10秒,最快间隔15秒。你只需要通过最小秒数。

最快意味着至少通过正常时间间隔的一半。 试试这种方式,如果你遇到任何问题,请告诉我。

只需删除它并像这样传递到这里。

df <- structure(list(gene = c("a", "b", "c", "d", "e"), index = c(1L, 
    1L, 1L, 2L, 2L)), .Names = c("gene", "index"), row.names = c(NA, 
    -5L), class = "data.frame")

我已经回复了here,请查看更多信息。

谢谢希望这会对你有所帮助。

相关问题