Android的:如何重置和下载A-GPS数据?数据、Android、GPS

2023-09-04 23:14:29 作者:帅酷又会撩

如何以编程方式重置并在Android应用程序下载新的A-GPS数据?换句话说,如何管理A-GPS状态工具,在的 GPS状态和放大器;工具箱应用程序?

How can I programmatically reset and download new A-GPS data in an Android application? In other words, how do the "Manage A-GPS state" tools work in the GPS Status & Toolbox app?

推荐答案

您应该可以使用 LocationManager.sendExtraCommand(字符串提供商,字符串命令,捆绑演员)。这将允许你删除所有的GPS数据的全部或部分,所以它会重新下载。该文档是here,但快速纲要的论点,从this code (为GPS提供):

You should be able to use LocationManager.sendExtraCommand(String provider, String command, Bundle extras). This will allow you to delete all or part of the GPS data, so it will redownload it. The docs are here, but a quick rundown of the arguments, referenced from this code(for a GPS Provider):

有关提供商,使用 LocationManager.GPS_PROVIDER

有关命令,使用delete_aiding_data

有关临时演员,如果你通过,它会删除所有数据。如果你想只删除(如刚历书或位置)具体的数据,你可以使用this功能的作为捆绑花絮。

For extras, if you pass null, it will delete all data. If you want to delete specific data only(such as just the almanac or position), you can use the flags found in this function as extras in the bundle.

不要忘了 android.permission.ACCESS_LOCATION_EXTRA_COMMANDS 添加到您的允许列表清单!

Don't forget to add android.permission.ACCESS_LOCATION_EXTRA_COMMANDS to your permission list in the manifest!