小编dep*_*dep的帖子

协助数据注入GPS

我正在尝试开发一个使用GPS的应用程序,我想将XTRA数据和时间参考注入GPS,以便更快地修复.我的代码如下:

Bundle bundle = new Bundle();
boolean xtraInjection=locationmanager.sendExtraCommand(LocationManager.GPS_PROVIDER,"force_xtra_injection",bundle);
boolean timeInjection=locationmanager.sendExtraCommand(LocationManager.GPS_PROVIDER,"force_time_injection",bundle);
Run Code Online (Sandbox Code Playgroud)

无论互联网连接是打开还是关闭(没有蜂窝也没有wifi),xtraInjection和timeInjection布尔值总是正确的.因此,我无法检测辅助信息是否被很好地注入GPS.

启用wifi连接后,将显示下一条日志消息(如果wifi关闭,则不会显示错误消息):

I/app (  627): timeInjection:true
....
D/GpsLocationProvider(   96): NTP server returned: 1306322421969 (WedMay 25 13:20:21 GMT+02:00 2011) reference: 338139 certainty: 77 systemtime offset: 7162
D/lib_locapi( 96): loc_eng_inject_time, uncertainty = 77
Run Code Online (Sandbox Code Playgroud)

相反,没有与XTRA数据相关的日志消息.如果XTRA数据仍然有效,系统不会请求它吗?我如何才能看到它是否成功注入?

为了进行这些测试,我还尝试删除了辅助数据,但我知道这样做并不好:

我的代码:

boolean reset=locationmanager.sendExtraCommand(LocationManager.GPS_PROVIDER, "delete_aiding_data", null);
Run Code Online (Sandbox Code Playgroud)

日志:

I/app (  627): reset:false
D/lib_locapi(   96): loc_eng_ioctl for aiding data deletion returned 0, 1 for success
Run Code Online (Sandbox Code Playgroud)

我也试过GPS STATUS应用程序,结果是相同的,注入和删除.

简而言之,我不知道问题是在我的代码中还是在驱动程序实现中.除了logcat之外,还有什么方法可以获得有关这些问题的更多信息吗?(我无法使用我的设备).

先感谢您

gps android locationmanager supl

5
推荐指数
1
解决办法
5834
查看次数

标签 统计

android ×1

gps ×1

locationmanager ×1

supl ×1