在 Windows Phone 7 上有没有办法获取 GPS 信号的当前强度?

发布于 2024-12-01 14:29:15 字数 379 浏览 0 评论 0原文

我目前正在使用 GeoColuteWatcher,它抽象出用于检索位置和速度的信息,它提供了状态(禁用/就绪/无数据/初始化),但仅此而已。

我见过一些应用程序(例如 RunKeeper)具有 GPS 信号强度指示器,但我不确定这是否准确,或者是否是根据 GeoCord 的 Horizo​​ntalAccuracy 属性计算出来的

注意:我已阅读此链接: 如何在 Windows Mobile 中读取 GPS 信号强度?

但这是针对 WP6.5 的,我认为对 WP7 没有帮助。

I'm currently using the GeoCordinateWatcher which abstracts away the information used to retrieve the position and speed it provides a status (disabled/ready/nodata/initializing) but that's all.

I've seen a few apps such as RunKeeper that have a GPS signal strength indicator but I wasn't sure whether that was accurate or whether it was calculated based on the HorizontalAccuracy property of the GeoCordinate

NOTE: I have read this link:
How to read GPS signal strength in Windows Mobile?

But this is dealing with WP6.5 and I don't think helps on WP7.

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

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

发布评论

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

评论(1

夏末的微笑 2024-12-08 14:29:15

从经验来看(作为 RunKeeper Windows Phone 应用程序的开发者),您无法直接访问 GPS 信号强度,但您可以使用 Horizo​​ntalAccuracy 来显示相对强度指示器。

我使用 Rx Extensions 在 GeoCoordinateWatcher 上提供可观察的位置流,然后在此基础上创建可观察的精度流,以便我可以订阅与位置更改分开的精度更改(而不必检查和更新每个位置)。


// Extension method.
        public static IObservable<GeoPositionChangedEventArgs<:GeoCoordinate>> GetPositionChangedEventStream(this GeoCoordinateWatcher watcher)
        {
            return Observable.Create<GeoPositionChangedEventArgs<GeoCoordinate>>(observable =>
            {
                EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>> handler = (s, e) =>
                {
                    observable.OnNext(e);
                };
                watcher.PositionChanged += handler;
                return () => { watcher.PositionChanged -= handler; };
            });
        }

// Usage:
        var positionStream = this._watcher.GetPositionChangedEventStream();
        var accuracyStream = positionStream.Select(p => p.Position.Location.HorizontalAccuracy);
        ...
        accuracyStream.Subscribe((accuracy) =>
            {
                // Do something with the accuracy.
            });

Speaking from experience (as the developer of the RunKeeper Windows Phone app), you can't access the GPS signal strength directly, but you can use the HorizontalAccuracy to display a relative strength indicator.

I use Rx Extensions to provide an observable position stream on the GeoCoordinateWatcher, then create an observable accuracy stream on top of that, so that I can subscribe to accuracy changes separate from position changes (rather than having to check and update on every position).


// Extension method.
        public static IObservable<GeoPositionChangedEventArgs<:GeoCoordinate>> GetPositionChangedEventStream(this GeoCoordinateWatcher watcher)
        {
            return Observable.Create<GeoPositionChangedEventArgs<GeoCoordinate>>(observable =>
            {
                EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>> handler = (s, e) =>
                {
                    observable.OnNext(e);
                };
                watcher.PositionChanged += handler;
                return () => { watcher.PositionChanged -= handler; };
            });
        }

// Usage:
        var positionStream = this._watcher.GetPositionChangedEventStream();
        var accuracyStream = positionStream.Select(p => p.Position.Location.HorizontalAccuracy);
        ...
        accuracyStream.Subscribe((accuracy) =>
            {
                // Do something with the accuracy.
            });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文