清除融合的位置提供者的位置以进行测试 [英] Clear fused location provider's location for testing

查看:76
本文介绍了清除融合的位置提供者的位置以进行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能清除由播放服务的融合位置API存储的位置".在真实设备上测试我的应用程序时,我想重新创建一些场景,这就是我想知道这是否可行的原因.

I would like to know if it is possible to clear the "location" that is stored by play service's fused location API. When testing my app on a real device, I would like to recreate few scenarios and that's the reason I would like to know if this is possible.

我试图清除"Google Play服务"缓存和数据.但是,这似乎对我没有帮助.该位置似乎仍被缓存在某个地方.

I tried to clear "Google Play Services" cache and data. But, it does not seem to help me. Location still seems to be cached somewhere.

推荐答案

Google Play服务是中心服务,可为您设备上安装的每个应用提供服务.清除缓存和数据后,如果有任何应用程序连接到该设备上的Google Play服务(几乎每个Google应用程序都可以这样做),则Fused location api将获取并保存该应用程序的位置.之后,一旦您的应用获取了onConnected中的最后一个已知位置,它将返回该位置.

Google Play Services is central service and serves every app installed on your device. After clearing cache and data, if any app connects with Google Play services on that device(which almost every Google app do), then Fused location api will fetch and save location for that app. After that once your app fetches last known location in onConnected, it will return the location.

除非您将值硬编码为空白,否则很难模拟您要实现的方案.

It is hard to simulate the scenario your are trying to achieve unless you hard code the values to be blank.

这篇关于清除融合的位置提供者的位置以进行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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