[UWP]如何确定设备是否具有GPS功能 [英] [UWP] How to determine if a device has GPS capabilities

查看:78
本文介绍了[UWP]如何确定设备是否具有GPS功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


标题是问题。

The title is the question.

我只是想在我的应用中确定  ;如果设备可以接收GPS信号,那么如果设备没有GPS芯片但可以使用Wifi,IP蜂窝等位置服务,我可以禁用某些功能......

I just want to determine in my app if a device can receive GPS signals so I can disable some functionality if a device has no GPS chip but can use location services like Wifi, cellular of IP...

推荐答案

您好DennisBakker71:

Hi DennisBakker71:

    我想你可以尝试使用Windows.Devices.Geolocation这个

     I think you may try this

using Windows.Devices.Geolocation;
...
var accessStatus = await Geolocator.RequestAccessAsync();

这是关于此的官方文件https://msdn.microsoft.com/en-us/library/windows/apps/mt219698.aspx

Here is the official document about this https://msdn.microsoft.com/en-us/library/windows/apps/mt219698.aspx


这篇关于[UWP]如何确定设备是否具有GPS功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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