【发布时间】:2015-05-19 19:09:56
【问题描述】:
我用Fused location做了一个简单的定位服务,我用真实设备和Genymotion的安卓虚拟设备测试。
获取位置的 iterval 为 5 秒。
在真实设备上运行良好,间隔几乎正好是 5 秒, 检查日志:(onLC 用于 OnLocationChanged)
03-17 11:59:27.115: I/Locationing_GpsService_Test(27147): onLC:Now!
03-17 11:59:32.189: I/Locationing_GpsService_Test(27147): onLC:Now!
03-17 11:59:37.259: I/Locationing_GpsService_Test(27147): onLC:Now!
03-17 11:59:42.171: I/Locationing_GpsService_Test(27147): onLC:Now!
03-17 11:59:47.215: I/Locationing_GpsService_Test(27147): onLC:Now!
03-17 11:59:52.240: I/Locationing_GpsService_Test(27147): onLC:Now!
在 Genymotions 虚拟设备上,间隔大概是 1 秒:
03-17 12:10:20.280: I/Locationing_GpsService_Test(2616): onLC:Now!
03-17 12:10:21.270: I/Locationing_GpsService_Test(2616): onLC:Now!
03-17 12:10:22.269: I/Locationing_GpsService_Test(2616): onLC:Now!
03-17 12:10:23.271: I/Locationing_GpsService_Test(2616): onLC:Now!
03-17 12:10:24.273: I/Locationing_GpsService_Test(2616): onLC:Now!
03-17 12:10:25.273: I/Locationing_GpsService_Test(2616): onLC:Now!
03-17 12:10:26.275: I/Locationing_GpsService_Test(2616): onLC:Now!
03-17 12:10:27.273: I/Locationing_GpsService_Test(2616): onLC:Now!
初始化位置请求的代码:
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(5000);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
谁能帮我看看这里发生了什么?
【问题讨论】:
标签: android genymotion genymotion-gps android-fusedlocation