windows-phone-7 - Windows Phone 8 GeoCoordinateWatcher 与 Geolocator

标签 windows-phone-7 windows-phone-8 location

Windows Phone 8 具有 GeoCoordinateWatcher它存在于 Windows Phone 7 中,但它也有 Geolocator ,两者都执行相同的功能,即允许您“观察”地理位置的变化。我找不到任何关于 GeoCoordinateWatcher 的信息。已弃用,无论 Geolocator现在应该使用 - 或两者之间的差异。

有任何想法吗?

最佳答案

简单 - 如果您不需要或计划 WP7 的版本,仅适用于 WP8,则使用 Geolocator - 它比 GeoCoordinateWatcher 更易于配置。
或者,我在我的应用程序中使用了另一种解决方案,使用依赖注入(inject)并为您的地理定位服务实现通用接口(interface),这将在 WP8 版本中使用 Geolocator 并在 WP7 中使用 GeoCoordinateWatcher 来实现。

关于windows-phone-7 - Windows Phone 8 GeoCoordinateWatcher 与 Geolocator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14217408/

相关文章:

multithreading - WP7 App 从服务和更新 UI 更新可观察集合

windows - Windows Phone 7 和 webos 模拟器

c# - WP7.1 系统.NotSupportedException : "LaunchForTest is not supported"

c# - 使用 RestSharp 进行 Xml 序列反序列化

ios - 在 Firebase/Swift 中检索 5 个最近的用户的数据量最少的方法?

java - 当我将标记当前位置拖到另一个位置时,如何更新位置?

windows-phone-7 - 如何在 wp7 中不使用启动器和选择器来撰写消息?

web-services - WP8 SDK import Service Reference with task-based operations not possible

c# - 无法启动 Windows Phone 模拟器

android - 如何在单击 android 中的按钮时找到我的当前位置(纬度 + 经度)?