Reputation: 1449
I have developed a Windows 8.1 Store App using C# and I want to detect user's current location. When I am connected with Wi-Fi, I get perfect location but when I am connected to 3G/4G network, I am not getting current location at all or sometimes it gives near by location. I am using the following code to detect current location
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;
Can someone suggest, am I doing anything wrong? Is there any other apps using which I can check current location with 3G/4G network?
Upvotes: 0
Views: 133
Reputation: 17954
This is to be expected as location accuracy varies depending on the method used to calculate the position. Here is the accuracy of location methods used in most common consumer devices (there are commercial devices which are way more accurate, but not used in most mobile phones):
As you can see, when relying on 3G/4G for detecting your location, it can be off by up to 5KM in some cases.
Upvotes: 0