使用 GeoCoordinateWatcher 时 Windows Phone 7 出现性能问题?

发布于 2024-10-10 03:57:39 字数 106 浏览 0 评论 0原文

我可以在Application_Launching中使用GeoCooperativeWatcher来检查手机定位服务是否启用或禁用吗?这会影响性能吗?

问候,

派纳奇

Can I use GeoCoordinateWatcher in Application_Launching to check that the phone location service is enabled or disabled? Does this affect performance?

Regards,

Panache

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌无敌 2024-10-17 03:57:39

不!

让应用程序启动,然后再决定。
即使定位服务被禁用,您也需要您的应用程序正常运行。

确认定位服务正在运行没有时间保证,因此如果您等待,可能会超出允许的启动时间。

或者您只是想问如何使用 GeoCoordinateWatcher?

编辑:
如果您只想显示一次,则只需跟踪是否显示了提示/消息即可。

另请注意,由于在应用程序被逻辑删除时设置发生更改,仅在应用程序启动时执行检查并不能保证它始终正确。

例如

  • ,当应用程序禁用位置服务时
    已启动的
  • 应用程序显示提示
  • 用户按下开始(应用程序逻辑删除)
  • 使用更改设置来启用位置服务
  • 用户使用后退按钮重新激活应用程序应用
  • 程序重新启动(如果不重新检查服务是否已启用则将是错误的)

Don't!

Let the app launch and then decide.
You need your app to function even if the location service is disabled.

There is no time guarantee in confirming the location service is running so if you wait you may go over your allowed start up time.

Or are you just asking how to use a GeoCoordinateWatcher?

Edit:
If you want to only display this once, then just keep track of if you've displayed the prompt/message.

Also be aware that due to settings being changed while your app is tombstoned just performing the check on application launch does not guarantee that it will always be correct.

e.g.

  • location service disabled when app
    started
  • App displays prompt
  • User presses start (app tombstoned)
  • uses changes settings to enable location service
  • user uses back button to reactivate app
  • app restarted (If doesn't RE-check if service enabled then would be wrong)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文