【问题标题】:Android GPS accuracy安卓 GPS 精度
【发布时间】:2011-09-05 17:31:02
【问题描述】:

我想在我的应用程序中使用良好的 gps 位置。所以我按照一个简单的教程(LocationManager 的基本用法,明确推荐的 GPS 提供商,要求更新 0 ms, 0 m )并创建一个应用程序。我对更新的准确性和速度完全没有印象。速度很慢,最佳精度为 24 米,但平均为 96 米。

在同一部手机上,我在同一个位置运行广为人知的GPS STATUS。我很惊讶地看到修复的准确性。 4-6 米,始终如一。

所以我关闭 GPS 状态并运行我的应用程序 - 我看到精度为 6 米,但几秒钟后它是 24、56、90、128.... 并在 96 左右波动。

现在,我想知道:这怎么可能?有没有提高准确性的技巧?!!

有人有好的例子/教程吗?


没用

让我再说一遍:我获取并打印所有更新。所以我看到了一系列准确的位置。

我看到了波动,我看到了最好的结果,而且永远不会比 12 米更好。

现在在同一个位置,我启动 GPS 状态 =>,我看到精度如何达到 4 米!

首先我想:哈,GPS 状态作弊,只是为了准确度

但似乎不是这样,因为当我打开我的应用程序并获得最后一个已知位置时,它确实是准确度为 4 的那个!

并开始降级到最佳情况 12。

总结:相同的硬件,相同的条件,不同的应用 => 不同的准确性!

所以我的问题是:有什么技巧吗?有什么额外的命令吗?有什么特殊的电源设置吗?与“你的应用程序有多重”有什么关系吗?

相关:Android GPS. Location Listener does not want to acquire a fix :(

【问题讨论】:

标签: android gps


【解决方案1】:

使用 GnssMeasurement 可以获得最佳精度,但难以编码。 Android 7+ 我有 Doodgee shoot dual(非常不流行的中国智能手机)和工作。 https://developer.android.com/reference/android/location/GnssMeasurement https://developer.android.com/guide/topics/sensors/gnss(官方支持列表)。

GNNS(GPS/GLONASS/GALILEO/...) LocationManager,( 0 ms, 0 m ) - 不工作,一段时间后(1-20 秒)你会得到同样的协调(如果你会呆在一个地方) - 精度是 3-10m。使用 LocationManager,您不会从物理模块中获取“原始”GNNS 数据,而是通过 Android API 计算得出的。使用 GnssMeasurement,您可以得到它。

【讨论】:

    【解决方案2】:

    google 在他们最近的 Google IO 2013 活动中发布了一个不错的 API:

    https://developers.google.com/events/io/sessions/324498944

    您应该检查一下,看看如何最小化您的代码。

    请注意,它需要设备具有 Play 商店应用才能运行。

    与使用普通位置传感器(电池、速度、精度等)相比,此方法具有许多优点

    【讨论】:

      【解决方案3】:

      这个怎么样?

      -设置精度+设置功率要求高:

      try{
          locator = new GeoLocator(this);
          locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
          locationManager.addGpsStatusListener(new GPSStatusManager(locationManager));
          Criteria criteria = new Criteria();
          criteria.setAccuracy(Criteria.ACCURACY_FINE);
          criteria.setPowerRequirement(Criteria. POWER_HIGH);
          bestProvider = locationManager.getBestProvider(criteria, true);
          Bundle bundle = new Bundle();
          //I copied the next two lines out of some tutorial hoping that they would help boost my gps, but I'm really not sure what they do
          boolean xtraInjection=locationManager.sendExtraCommand(LocationManager.GPS_PROVIDER,
                                                "force_xtra_injection",bundle);
          boolean timeInjection=locationManager.sendExtraCommand(LocationManager.GPS_PROVIDER,
                                                "force_time_injection",bundle);
          locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0.0f, locator);
      }catch(Exception e){}
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-04-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-31
        相关资源
        最近更新 更多