How to programmatically turn GPS on and off in Windows Phone 7

馋奶兔 提交于 2019-12-11 12:14:58

问题


So far, to turn on and off the GPS device in Wp7, I do it in Settings Menu. Wonder If this can be done in code?

Thanks

---------- Update

Sorry for the confusion. Instead of turning GPS on and off, What I really mean is how to turn on and off the LOCATION in the Settings Menu of Wp7.


回答1:


You can get the GPS data but you are not able to turn the sensor on or off via your application.

The most you can do in your application is start the geolocation data acquisition and stop it.




回答2:


Windows Phone 7 apps should not change global settings for the phone.

You should have your own settings page in your app, with it's own toggle for whether or not your app should use the location data.

Then you check your setting before you access the location data.

Why would you want to turn it off globally?



来源:https://stackoverflow.com/questions/4858901/how-to-programmatically-turn-gps-on-and-off-in-windows-phone-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!