![](/img/trans.png)
[英]how to determine if network type is 2g, 3g or 4g using xamarin essential
[英]Current location issue with 3G/4G network in Windows 8.1 Store apps?
我已經使用C#開發了Windows 8.1 Store App,並且想檢測用戶的當前位置。 當我連接Wi-Fi時,我得到的位置是完美的,但是當我連接到3G / 4G網絡時,我卻根本無法獲得當前位置,或者有時它可以按位置提供附近的服務。 我正在使用以下代碼來檢測當前位置
geolocator = new Geolocator();
geolocator.DesiredAccuracy = PositionAccuracy.High;
geolocator.DesiredAccuracyInMeters = 1000;
geolocator.MovementThreshold = 100;
//geolocator.ReportInterval = 500;
try
{
Geoposition mygeoPosition = await geolocator.GetGeopositionAsync();
}
catch(UnauthorizedAccessException ex)
{
UserMessageUtil.ShowMessage("Location is disabled in Settings");
await Launcher.LaunchUriAsync(new Uri("ms-settings-location:"));
}
catch(Exception ex)
{
UserMessageUtil.ShowMessage("We are sorry, location services are unavailable.");
}
geolocator.PositionChanged += geolocator_PositionChanged;
有人可以建議我做錯什么嗎? 是否可以通過3G / 4G網絡檢查當前位置的其他應用程序?
這是可以預期的,因為位置精度會根據用於計算位置的方法而變化。 以下是大多數常見的消費類設備(有些商用設備更准確,但大多數移動電話中未使用)所使用的定位方法的准確性:
如您所見,當依靠3G / 4G來檢測您的位置時,在某些情況下它可能會偏離5KM。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.