我正在 xaml 中开发 Windows 8 应用商店应用程序,它使用用户的 GPS 位置。有什么方法可以通过编程方式知道用户使用的设备是否具有 GPS 功能?
与 Windows Phone 不同,它仅在有互联网连接时才工作?
最佳答案
您需要检查位置传感器的状态
var location = new Geolocator();
if(location.LocationStatus == PositionStatus.NotAvailable)
{
//Do Something
}
else
{
//Do Something else
}
以下文章很好地涵盖了地理位置
主题
http://www.jeffblankenburg.com/2012/11/14/31-days-of-windows-8-day-14-geolocation/
关于windows-8 - 如何知道 Windows 8 设备(笔记本电脑/平板电脑/台式机)是否支持 GPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13639266/