<bdo id='YQum3'></bdo><ul id='YQum3'></ul>

<small id='YQum3'></small><noframes id='YQum3'>

<i id='YQum3'><tr id='YQum3'><dt id='YQum3'><q id='YQum3'><span id='YQum3'><b id='YQum3'><form id='YQum3'><ins id='YQum3'></ins><ul id='YQum3'></ul><sub id='YQum3'></sub></form><legend id='YQum3'></legend><bdo id='YQum3'><pre id='YQum3'><center id='YQum3'></center></pre></bdo></b><th id='YQum3'></th></span></q></dt></tr></i><div id='YQum3'><tfoot id='YQum3'></tfoot><dl id='YQum3'><fieldset id='YQum3'></fieldset></dl></div>

  • <legend id='YQum3'><style id='YQum3'><dir id='YQum3'><q id='YQum3'></q></dir></style></legend>
    1. <tfoot id='YQum3'></tfoot>

      1. LocationManager 的 getLastKnownLocation 有多可靠,多久更

        时间:2023-09-02
      2. <small id='3T4fP'></small><noframes id='3T4fP'>

      3. <legend id='3T4fP'><style id='3T4fP'><dir id='3T4fP'><q id='3T4fP'></q></dir></style></legend>
          <tbody id='3T4fP'></tbody>

      4. <i id='3T4fP'><tr id='3T4fP'><dt id='3T4fP'><q id='3T4fP'><span id='3T4fP'><b id='3T4fP'><form id='3T4fP'><ins id='3T4fP'></ins><ul id='3T4fP'></ul><sub id='3T4fP'></sub></form><legend id='3T4fP'></legend><bdo id='3T4fP'><pre id='3T4fP'><center id='3T4fP'></center></pre></bdo></b><th id='3T4fP'></th></span></q></dt></tr></i><div id='3T4fP'><tfoot id='3T4fP'></tfoot><dl id='3T4fP'><fieldset id='3T4fP'></fieldset></dl></div>

          <tfoot id='3T4fP'></tfoot>
              • <bdo id='3T4fP'></bdo><ul id='3T4fP'></ul>
                • 本文介绍了LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在构建一个可以在某些操作上使用用户当前位置的应用.位置对用户更有利,而不是流程的关键部分.我只对非常粗略的准确性感兴趣,它可能会偏离 5 甚至 10 英里,但仍然很有价值.一般计划是查看网络提供商是否已启用,然后就这样做

                  I am building an app that can use a user's current location on certain actions. Location is more of a benefit to the user rather than a critical part of the process. I'm only interested in very rough accuracy and it can be off by 5 or even 10 miles and still be of value. General plan was to see if the network provider was enabled and then just do

                  locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER)
                  

                  假设没有其他应用在运行,手机会自动定期更新网络位置吗?IE.此代码可能总是会返回一个满足我需要的值?

                  Assuming that no other apps are running, will the phone automatically periodically update the network location? I.e. there will likely always be a value returned by this code which will meet my needs?

                  我一直在做更多的研究,我认为我在这里真正想问的问题是,Android 操作系统或手机本身是否会更新网络提供商的最后一个已知位置,因为手机锁定到不同的位置手机信号塔或 wifi 网络.答案似乎是否定的.在强制停止我的手机上我知道与位置服务交互的所有应用程序后,最后一个已知位置已停止更新.所以,我猜现在大多数手机都有可能在后台运行一些定位服务来更新最后一个已知的位置,但手机本身不会这样做.因此,如果最后一个已知位置太旧,我想我会采用某种形式的位置更新请求.

                  I've been doing a bit more research and I think the question I was really trying to ask here was if the Android operating system or the phone itself would update the last known location for the network provider as the phone locked onto different cell phone towers or wifi networks. The answer appears to be no. After force stopping all apps on my phone which I know to interaction with location services, the last known location has stopped updating. So, I'm guessing that these days chances are that most phones will have some location services running in the background updating the last known location but the phone itself won't do it. Hence I think I'll be going with some form of requesting location updates if the last known location is too old.

                  推荐答案

                  getLastKnownLocation() 只返回最后的修复.因此,如果没有更新位置提供程序,则 getLastKnownLocation() 的返回值不会改变.位置对象还将为您提供修复的准确性和时间.

                  getLastKnownLocation() only returns the last fix. So if no location providers are being updated the return value of getLastKnownLocation() will not change. The location object will also provide you with accuracy and time of the fix.

                  我会查看这篇文章以获取更多信息.您可以使用某个版本的一次性拍摄位置.

                  I would look at this post for more information. You could use some version of the one shot location.

                  http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html

                  这篇关于LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:CLLocation 返回负速度 下一篇:requestLocationUpdate() 抛出的 IllegalArgumentException

                  相关文章

                  最新文章

                  <legend id='kIUDi'><style id='kIUDi'><dir id='kIUDi'><q id='kIUDi'></q></dir></style></legend>

                    <tfoot id='kIUDi'></tfoot>

                      • <bdo id='kIUDi'></bdo><ul id='kIUDi'></ul>
                      <i id='kIUDi'><tr id='kIUDi'><dt id='kIUDi'><q id='kIUDi'><span id='kIUDi'><b id='kIUDi'><form id='kIUDi'><ins id='kIUDi'></ins><ul id='kIUDi'></ul><sub id='kIUDi'></sub></form><legend id='kIUDi'></legend><bdo id='kIUDi'><pre id='kIUDi'><center id='kIUDi'></center></pre></bdo></b><th id='kIUDi'></th></span></q></dt></tr></i><div id='kIUDi'><tfoot id='kIUDi'></tfoot><dl id='kIUDi'><fieldset id='kIUDi'></fieldset></dl></div>
                    1. <small id='kIUDi'></small><noframes id='kIUDi'>