WP7.5上的位置感知应用程序 [英] Location-aware applications on WP7.5

查看:162
本文介绍了WP7.5上的位置感知应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在WP7.5上创建位置感知应用程序



在没有我们的应用程序在后台运行的情况下,是否可以自动获取位置更改的触发器?



例如:

我想知道用户是否已搬到新位置。如果用户已移动,我想从我的应用程序中触发特定事件。我唯一担心的是,如果我从我的应用程序中这样做,我会消耗大量的电池。这是一个特定的WP7服务,它可以通知我的应用程序,用户已经改变了他的位置并从我的应用程序中触发了一个事件吗?

如果可以,请您指点我一个例子?

解决方案

您可以使2认为:

$ ul b $ b

  • 使用定期代理 a>每30分钟获得一次地理位置

  • 使用 GeoCoordinateWatcher 在您的应用程序中设置 MovementThreshold 仅在位置确实发生变化时才能获取数据。这种方式只有在您的应用程序实际在设备上运行时才有效 - 当用户离开应用程序监视器时将停止工作。


  • I would like to create a location-aware application on WP7.5

    Is it possible to automatically get a trigger on location change without our application running on background?

    For example:

    I would like to know if a user has moved in a new location. If the user has moved I would like to trigger a specific event from my application. My only concern is that if I do that from my application I will consume a significant amount of battery. Is it a specific WP7 service which can inform my application that the user has changed his location and trigger an event from my application?

    If it is possible can you please point me an example?

    解决方案

    You can make 2 thinks:

    • Use Periodic Agent to get geoposition every 30 minuts
    • Use GeoCoordinateWatcher inside your app and set MovementThreshold to get data only when position really changed. This way will work only if your app is actually running on the device - when user left the application watcher will stop working.

    这篇关于WP7.5上的位置感知应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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