使用Windows Phone7中的Microsoft位置服务API确定位置 [英] Determine location using Microsoft Location Service API in Windowsphone7

查看:130
本文介绍了使用Windows Phone7中的Microsoft位置服务API确定位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在windows-phone7商店提交我的应用程序,Microsoft需要遵循以下要求来验证应用程序。
以下要求适用于接收用户移动设备位置的应用程序:
2.7.1您的应用程序必须使用Microsoft位置服务API确定位置。
2.7.2您应用程序的隐私政策必须告知用户如何使用和披露位置服务API中的位置数据,以及用户对使用和共享
位置数据的控制措施。这可以托管在应用程序中或直接与应用程序链接。
请帮助我想提及或执行的应用程序的认证。

I submit my app on windows-phone7 store, Microsoft need following requirement to certify the app. The following requirements apply to applications that receive the location of a user's mobile device: 2.7.1 Your application must determine location using Microsoft Location Service API. 2.7.2 The privacy policy of your application must inform users about how location data from the Location Service API is used and disclosed and the controls that users have over the use and sharing of location data. This can be hosted within or directly linked from the application. Please help me what i want to mentioned or implement to certify the app.

推荐答案

这里是我使用的代码获取位置。

Here is the code I use to get the location.

            private static GeoCoordinateWatcher Watcher;            

            private void StartGeoWatcher()
            {

                if (Watcher == null)
                {
                    Watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
                    Watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(OnPositionChanged);
                    Watcher.TryStart(false, System.TimeSpan.FromMilliseconds(1000));
                }

            }

            private void OnPositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
            {

                    latitude = e.Position.Location.Latitude;
                    longitude = e.Position.Location.Longitude;


            }

这篇关于使用Windows Phone7中的Microsoft位置服务API确定位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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