在 Windows Phone 使用后禁用 GPS
Disable GPS after use on Windows Phone
由于能量原因,我想在检索到一个位置后禁用 GPS,但由于某种原因,GPS 保持打开状态超过 10 分钟。
我使用的代码是:
Geolocator geolocator = new Geolocator();
geolocator.DesiredAccuracy = accuracy;
geolocator.MovementThreshold = 0;
var position = await geolocator.GetGeopositionAsync();
没有办法做到这一点。
使用 GPS 的最大开销通常是将其打开,您无法确定设备上的其他内容是否会很快使用它。 (这可能是本机功能、用户可能切换到的其他应用或后台进程。)
因此,OS 包含用于管理无线电的启发式逻辑
由于能量原因,我想在检索到一个位置后禁用 GPS,但由于某种原因,GPS 保持打开状态超过 10 分钟。
我使用的代码是:
Geolocator geolocator = new Geolocator();
geolocator.DesiredAccuracy = accuracy;
geolocator.MovementThreshold = 0;
var position = await geolocator.GetGeopositionAsync();
没有办法做到这一点。
使用 GPS 的最大开销通常是将其打开,您无法确定设备上的其他内容是否会很快使用它。 (这可能是本机功能、用户可能切换到的其他应用或后台进程。)
因此,OS 包含用于管理无线电的启发式逻辑