如何改变执行过程中的LocationManager提供商 [英] How to change the LocationManager provider during execution

查看:148
本文介绍了如何改变执行过程中的LocationManager提供商的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法运行时切换的LocationManager的提供者?

There is any way to switch the provider of the LocationManager when is running?

我需要知道的位置每2000米。所以,我创建了一个的LocationManager,并设置如下:

I need to know the position every 2000 meters. So I created a LocationManager and set like this:

locationManager.requestLocationUpdates(provider, 0, 2000, this);

我们的想法是保持的LocationManager通过所有的应用程序时,运行寿命。所以我不希望杀了的LocationManager(使用 locationManager.removeUpdates(本); )。

我在寻找一种方式来改变GPS提供商网络服务提供者,如果应用程序执行过程中,GPS被关闭或不响应(超时)

I 'm searching for a way to change GPS provider for Network provider if during the app execution the GPS is turned off or not responding (timeout)

谢谢,对不起,我的英语

Thanks and sorry for my english

推荐答案

或者你也可以使用的一体化位置提供商(谷歌播放服务)

Or you can use the Fused Location Provider (Google Play Services)

融合的位置提供智能管理的基本定位技术,让您的最佳位置,根据您的需求。

The Fused Location Provider intelligently manages the underlying location technology and gives you the best location according to your needs.


  • 简单的API:让您指定的高层次需求,如精度高或低功率,而不必担心位置提供商

  • 立即可用:使你的应用程序来最好的,最新的位置直接访问

  • 电源效率:最小化您的应用程序的使用功率。基于所有传入位置请求和可用的传感器,融合位置提供商选择最有效的方式来满足这些需求。

  • 多功能性:符合广泛的需求,从需要高度精确的位置,背景使用了与需要可以忽略不计的影响周期性位置更新的前景用途

这篇关于如何改变执行过程中的LocationManager提供商的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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