Android的:如何重置和下载A-GPS数据? [英] Android: How to reset and download A-GPS data?

查看:1059
本文介绍了Android的:如何重置和下载A-GPS数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式重置并在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数据的全部或部分,所以它会重新下载。该文档是<一href="http://developer.android.com/reference/android/location/LocationManager.html#sendExtraCommand%28java.lang.String,%20java.lang.String,%20android.os.Bundle%29">here,但快速纲要的论点,从<引用href="http://gitorious.org/android-eeepc/base/blobs/fd9f42a6967370490cd2c66e628ccbf2eacc4a4b/location/java/com/android/internal/location/GpsLocationProvider.java#line485">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

有关临时演员,如果你通过,它会删除所有数据。如果你想只删除(如刚历书或位置)具体的数据,你可以使用<一个发现的标志href="http://gitorious.org/android-eeepc/base/blobs/fd9f42a6967370490cd2c66e628ccbf2eacc4a4b/location/java/com/android/internal/location/GpsLocationProvider.java#line495">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!

这篇关于Android的:如何重置和下载A-GPS数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆